scons: Drop gprof support for profile builds; tweak optimization flags instead.
authorJosé Fonseca <jfonseca@vmware.com>
Sun, 20 Sep 2009 17:07:16 +0000 (18:07 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Sun, 20 Sep 2009 17:09:34 +0000 (18:09 +0100)
gprof is useful for shared libraries, hence our drivers. Nevertheless
profilers like oprofile can benefit from disabling some relatively
minor optimizations for more accurate / complete results.

scons/gallium.py

index 47b0774..38782ac 100644 (file)
@@ -334,7 +334,11 @@ def generate(env):
         else:
             ccflags += ['-O3', '-g3']
         if env['profile']:
-            ccflags += ['-pg']
+            # See http://code.google.com/p/jrfonseca/wiki/Gprof2Dot#Which_options_should_I_pass_to_gcc_when_compiling_for_profiling?
+            ccflags += [
+                '-fno-omit-frame-pointer',
+                '-fno-optimize-sibling-calls',
+            ]
         if env['machine'] == 'x86':
             ccflags += [
                 '-m32',