Questions tagged [gprof]

gprof is a GNU tool used for code profiling.

To use it you need to compile your code with gcc and the option -pg. Then execute your software; it will create a file named "gmon.out". gprof can analyze this file and provide you with performance information about the execution of your software.

322 questions
0
votes
3 answers

Format of parameter to display call graph for templated method with gprof?

What is the command line format to display function call graph for a method in templated class with gprof? For simple C method you would specify it like: gprof -f foo myprogram > gprof.output How do you specify method parse from the…
stefanB
  • 77,323
  • 27
  • 116
  • 141
0
votes
1 answer

How to calculate time for a cilk_spawn

thanks for looking at the post I am benchmarking some Cilk Plus code and was looking to calculate the time required to complete a "spawn" operation. I am interested in calculating only the time required to do a spawn and not the computational time…
boffin
  • 639
  • 2
  • 13
  • 26
-1
votes
1 answer

g++ compilation fails when profiling enabled

I have a working program, which I want to profile. Thus, I just added a -pg switch to the Makefile. This gives thousands of repetitions of this same message: /tmp/ccOlI4CC.s:62095: Error: bad expression /tmp/ccOlI4CC.s:62095: Error: junk…
Firestorm
  • 127
  • 1
  • 13
-1
votes
1 answer

random() function same values in linux (while grof ing)

When I try to generate random values for various sorting algorithm to gprof them and compare the results, I noticed the random() function was creating same values within an instance and in same order. Is there a way to get rid of it? Example I tried…
nt fury
  • 39
  • 1
  • 9
-3
votes
1 answer

C: Can I make my program look to be running in 0 secs

Is there any way when I run time command with option -c on my program it show me 0 secs under user section? Is this what we'd call that the program is not CPU bound? I have a program for which I'm always getting 0.01 secs. I've done some…
Diwakar Sharma
  • 415
  • 1
  • 9
  • 26
-4
votes
2 answers

How to improve a function?

I have a program that counts 2 to the power 26 and the root of result number. Program's source code is contained in several files and I compiled it by makefile with -pg flag. I run it by gprof ./main and as a result I got: Each sample counts as…
krzyhub
  • 6,285
  • 11
  • 42
  • 68
-6
votes
1 answer

how to get profiling information from a Windows DLL with gprof?

I've created my DLL using -pg option (compilation and link), and managed to run its code and to call exit at some point. A file gmon.out is created, so far so good. But when I do gprof mydll.dll gmon.out no useful information is printed. When I do…
Jean-François Fabre
  • 137,073
  • 23
  • 153
  • 219
1 2 3
21
22