summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2012-06-05 01:23:09 -0400
committerAli Saidi <Ali.Saidi@ARM.com>2012-06-05 01:23:09 -0400
commitaec7a4411683d8b10684f8f70093bcbbc2de8b55 (patch)
tree483c9cfea1ec7e8c9fbda403731b5ff947955bed
parent1b370431d0ac51eb54bfbf17247f935d48995a34 (diff)
downloadgem5-aec7a4411683d8b10684f8f70093bcbbc2de8b55.tar.xz
sim: Add support for tcmalloc if it's installed and available.
This package is available in Ubuntu, Debian, and Redhat as google-perftools. With multiple tests on a single machine I've seen a little over 10% performance gain with tcmalloc.
-rwxr-xr-xSConstruct11
1 files changed, 11 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index 2b3f6a8d8..f0350ac02 100755
--- a/SConstruct
+++ b/SConstruct
@@ -749,6 +749,14 @@ have_posix_clock = \
conf.CheckLibWithHeader('rt', 'time.h', 'C',
'clock_nanosleep(0,0,NULL,NULL);')
+if conf.CheckLib('tcmalloc_minimal'):
+ have_tcmalloc = True
+else:
+ have_tcmalloc = False
+ print termcap.Yellow + termcap.Bold + \
+ "You can get a 12% performance improvement by installing tcmalloc "\
+ "(google-perftools package on Ubuntu or RedHat)." + termcap.Normal
+
if not have_posix_clock:
print "Can't find library for POSIX clocks."
@@ -1011,6 +1019,9 @@ for variant_path in variant_paths:
if env['USE_SSE2']:
env.Append(CCFLAGS=['-msse2'])
+ if have_tcmalloc:
+ env.Append(LIBS=['tcmalloc_minimal'])
+
# The src/SConscript file sets up the build rules in 'env' according
# to the configured variables. It returns a list of environments,
# one for each variant build (debug, opt, etc.)