gprof

How to build-in gprof support to a program built with SCons?

Greetings, Here is my SConstruct file: env = Environment() env.Append(CCFLAGS=['-g','-pg']) env.Program(target='program1', source= ['program1.c']) Also here is the output of the compilation: scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... gcc -o program1.o -c -g -pg program1.c g...

Change the name of gmon.out file when compiling with -pg

Good morning Is it possible to change the default name of the file gmon.out, which is created when the profile flag (-pg) is set when compiling with gcc, to, for example, [executable name].gmon.out? I need this because I have more than one executables, which are located in the same directory, and have to run parallel. thanks in advan...

Time Sampling Problems with gprof

I am attempting to profile some c++ code, compiled with g++ including the option -pg, using gprof. However, in spite of the fact that the program takes 10-15 minutes to run on my computer (with the CPU maxed out), the % time, cumulative seconds and self seconds columns of the table produced by gprof are entirely 0.00s! The calls column c...

How to compile driver to be profiled with Gprof

Simple question.. how to compile driver to be profiled with Gprof? My current Makefile: obj-m += hello-2.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean Works just fine ( I can load the driver etc. ), but if I try to add -pg options to t...

Alternative to -pg with Clang?

I wish to profile CPU (sample if possible), with as small a performance impact as possible (hence similar to GCC's -pg), binaries compiled with Clang. Is there an alternative that uses instrumentation of the code, or produces output similar to gprof? ...