diff options
Diffstat (limited to 'cachegrind')
-rw-r--r-- | cachegrind/Makefile.am | 3 | ||||
-rw-r--r-- | cachegrind/cg-s390x.c | 73 | ||||
-rw-r--r-- | cachegrind/cg_branchpred.c | 2 | ||||
-rwxr-xr-x | cachegrind/tests/filter_stderr | 4 |
4 files changed, 80 insertions, 2 deletions
diff --git a/cachegrind/Makefile.am b/cachegrind/Makefile.am index 81680813..12636537 100644 --- a/cachegrind/Makefile.am +++ b/cachegrind/Makefile.am @@ -44,7 +44,8 @@ CACHEGRIND_SOURCES_COMMON = \ cg-x86-amd64.c \ cg-ppc32.c \ cg-ppc64.c \ - cg-arm.c + cg-arm.c \ + cg-s390x.c cachegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES = \ $(CACHEGRIND_SOURCES_COMMON) diff --git a/cachegrind/cg-s390x.c b/cachegrind/cg-s390x.c new file mode 100644 index 00000000..905a15f5 --- /dev/null +++ b/cachegrind/cg-s390x.c @@ -0,0 +1,73 @@ + +/*--------------------------------------------------------------------*/ +/*--- s390x-specific definitions. cg-s390x.c ---*/ +/*--------------------------------------------------------------------*/ + +/* + This file is part of Cachegrind, a Valgrind tool for cache + profiling programs. + + Copyright IBM Corp. 2010-2011 + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307, USA. + + The GNU General Public License is contained in the file COPYING. +*/ + +/* Contributed by Christian Borntraeger */ + +#if defined(VGA_s390x) + +#include "pub_tool_basics.h" +#include "pub_tool_libcbase.h" +#include "pub_tool_libcassert.h" +#include "pub_tool_libcprint.h" + +#include "cg_arch.h" + +void VG_(configure_caches)(cache_t* I1c, cache_t* D1c, cache_t* L2c, + Bool all_caches_clo_defined) +{ + // Set caches to z10 default. + // See IBM Journal of Research and Development + // Issue Date: Jan. 2009 + // Volume: 53 Issue:1 + // fixs390: have a table for all available models and check /proc/cpuinfo + *I1c = (cache_t) { 65536, 4, 256 }; + *D1c = (cache_t) { 131072, 8, 256 }; + *L2c = (cache_t) { 3145728, 12, 256 }; + + // Warn if config not completely specified from cmd line. Note that + // this message is slightly different from the one we give on x86/AMD64 + // when auto-detection fails; this lets us filter out this one (which is + // not important) in the regression test suite without filtering the + // x86/AMD64 one (which we want to see if it ever occurs in the + // regression test suite). + // + // If you change this message, please update + // cachegrind/tests/filter_stderr! + // + if (!all_caches_clo_defined) { + VG_(dmsg)("Warning: Cannot auto-detect cache config on s390x, using one " + "or more defaults \n"); + } +} + +#endif + +/*--------------------------------------------------------------------*/ +/*--- end cg-s390x.c ---*/ +/*--------------------------------------------------------------------*/ diff --git a/cachegrind/cg_branchpred.c b/cachegrind/cg_branchpred.c index 4eb6982a..9bd6b2ee 100644 --- a/cachegrind/cg_branchpred.c +++ b/cachegrind/cg_branchpred.c @@ -48,6 +48,8 @@ # define N_IADDR_LO_ZERO_BITS 2 #elif defined(VGA_x86) || defined(VGA_amd64) # define N_IADDR_LO_ZERO_BITS 0 +#elif defined(VGA_s390x) +# define N_IADDR_LO_ZERO_BITS 1 #else # error "Unsupported architecture" #endif diff --git a/cachegrind/tests/filter_stderr b/cachegrind/tests/filter_stderr index 9209dd57..46340c93 100755 --- a/cachegrind/tests/filter_stderr +++ b/cachegrind/tests/filter_stderr @@ -18,4 +18,6 @@ sed "/warning: Pentium 4 with 12 KB micro-op instruction trace cache/d" | sed "/Simulating a 16 KB I-cache with 32 B lines/d" | sed "/warning: L3 cache found, using its data for the LL simulation./d" | sed "/Warning: Cannot auto-detect cache config on PPC.., using one or more defaults/d" | -sed "/Warning: Cannot auto-detect cache config on ARM, using one or more defaults/d" +sed "/Warning: Cannot auto-detect cache config on ARM, using one or more defaults/d" | +sed "/Warning: Cannot auto-detect cache config on s390x, using one or more defaults/d" + |