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
4
votes
3 answers

GCC compiling with -pg doesn't produce binary needed for Gprof

I'm running into a little problem and require some assistance. I would like to run gprof on some OpenMP and MPI hybrid code as a part of my testing. I understand that Gprof relies on a binary file which is created when you compile GCC (or mpicc)…
kfkhalili
  • 996
  • 1
  • 11
  • 24
4
votes
4 answers

Benchmarking (gprof) C++ program. Using eclipse environment

Well I've the following problem. Facts; - Using eclipse - Using MinGW I wanted to benchmark my created C++ program. I searched google and then came; http://www.cs.utah.edu/dept/old/texinfo/as/gprof.html I then wanted to add the "-pg" build command.…
ReWout
  • 41
  • 1
  • 2
4
votes
2 answers

How does a machine with higher CPU performance (according to gprof) have worse real time performacne?

Background I have a computationally intensive program that I am trying to run on a single supercomputer node. Here are the specs of one of the nodes on the supercomputer: OS: Redhat 6 Enterprise 64-bit CPU: Intel 2x 6-core 2.8GHz (12 cores) --…
Neal Kruis
  • 2,055
  • 3
  • 26
  • 49
4
votes
2 answers

Out of memory error. Allocating...

I'm trying to use a gprof command: gprof -s executable.exe gmon.out gmon.sum to merge profiling data gathered from 2 runs of my programs. But the following error appears: gprof: out of memory allocating 3403207348 bytes after a total of 196608…
martin
  • 643
  • 1
  • 10
  • 19
4
votes
1 answer

measuring the time spent on each line, fortran

I wrote a Fortran 95 code and compiled it with gfortran. I used gprof and found the time given by it is significantly less than the CPU time. The gprof tells me the time used by all of the functions is 15.77s. The elapsed CPU time however is 1 min…
4
votes
2 answers

gmon.out is not created when executable forks another executable

I am using gprof for profiling. But gmon.out is not created when I fork another executable inside the main executable which is compiled with option -pg. Any idea how to resolve it.
quartz
  • 747
  • 9
  • 26
4
votes
4 answers

How to modify a C program so that gprof can profile it?

When I run gprof on my C program it says no time accumulated for my program and shows 0 time for all function calls. However it does count the function calls. How do I modify my program so that gprof will be able to count how much time something…
neuromancer
  • 53,769
  • 78
  • 166
  • 223
4
votes
3 answers

unable to accumulate time using gprof - the gnu profiler

I am running cygwin on windows and using latest version of gprof for profiling my code. My problem is that the flat profile shows zero sec for each of the functions in my code, I even tried to loop the functions(tried a for loop for a million) but…
Amol Aggarwal
  • 2,674
  • 3
  • 24
  • 32
3
votes
1 answer

understanding the output of gprof on solaris

I thought of learning gprof.so i started with a simple program. I have written a small program in c below: #include #include void hello(void); int main() { hello(); return 0; } void hello() { int i; for(i=0; i<60; i++) { …
Vijay
  • 65,327
  • 90
  • 227
  • 319
3
votes
0 answers

MinGW gprof inaccurate results?

I've been profiling a program with gprof on Linux (Ubuntu 11.04) and Windows (7, latest version of MinGW), same program on more or less the same dataset each time, and getting significantly different results. (Significantly as in they would lead to…
rwallace
  • 31,405
  • 40
  • 123
  • 242
3
votes
1 answer

Convolution Function Latency Bottleneck

I have implemented a Convolutional Neural Network in C and have been studying what parts of it have the longest latency. Based on my research, the massive amounts of matricial multiplication required by CNNs makes running them on CPUs and even GPUs…
Ricardo
  • 65
  • 5
3
votes
4 answers

Simple operation to waste time?

I'm looking for a simple operation / routine which can "waste" time if repeated continuously. I'm researching how gprof profiles applications, so this "time waster" needs to waste time in the user space and should not require external libraries. IE,…
BSchlinker
  • 3,401
  • 11
  • 51
  • 82
3
votes
1 answer

how to pass -pg to gcc in cygwin

I just want to test -pg, the source file is very simple, my environment is cygwin, $ uname -a CYGWIN_NT-10.0 SHA-LPLATOW 2.8.2(0.313/5/3) 2017-07-12 10:58 x86_64 Cygwin $ vi pgtest.c #include void main(void){ printf("hello,…
netawater
  • 15,214
  • 4
  • 24
  • 21
3
votes
0 answers

How to make gprof report in nanosecond?

I'm trying to profile my C++ application, using gprof I would like to calculate function execution time. However in case some functions run faster than 0.01s it's reported on gprof with value 0.00. How can I change the report time of gprof to…
Mason Ngô
  • 31
  • 3
3
votes
1 answer

Ubuntu, how to find hotspot of program with heavy kernel work? It seems function at kernel.kallsyms doesn't mark as user space function's children

Multi-thread program with heavy kernel work( lock unlock), try to find the hot spot at my code use profiling tools. I wrote a minimum reproducible program. Compile it. Use profiling tool such as perf , gprof with callstack record. None of then can…
Bin Zhou
  • 71
  • 7