Skip to main content
28 votes
7 answers
30k views

I'm trying to profile a C++ application with gprof on a machine running OSX 10.5.7. I compile with g++ in the usual way, but using -pg flags, run the application and try to view the call graph with ...
9 votes
3 answers
9k views

I am trying to use gprof to profile some numerical code I am developing, but gprof seems to fail to collect data from my program. Here is my command line: g++ -Wall -O3 -g -pg -o fftw_test fftw_test....
29 votes
2 answers
10k views

I'm running Ubuntu 16.10 and trying to profile a program using gprof. I compile with the flag -pg and the program is single-threaded. The actual compile commands are: g++ -I. -std=c++11 -Wall -Wextra ...
0 votes
1 answer
61 views

Suppose i have function foo void foo() { //do something } Now this fn foo is now called by other function defined in other files. if gprof is enabled it would do profiling activity and subroutines ...
2 votes
1 answer
76 views

I have 2 projects in c. They both are configured with CMake using similar CMakeLists.txt. The first generates gmon.out file normally. It can be seen with gprof. The second generates barely empty gmon....
15 votes
3 answers
1k views

I would like to use gcc's gprof line-by-line profiling. But after compiling my program, running it and executing gprof -l binary_name I get messages like: gprof: somebody miscounted: ltab.len=9403 ...
6 votes
4 answers
7k views

I have this program that takes 2.34 seconds to run, and gprof says it only takes 1.18 seconds. I've read answers elsewhere suggesting that gprof can get it wrong if e.g the program is I/O bound, but ...
1 vote
1 answer
519 views

The GNU compiler toolset has a profiler "gprof" for performance analysis of C++ programs. With the -pg switch, the gcc compiler will make executables that write a data file, "gmon.out&...
0 votes
3 answers
5k views

What does this error mean for gprof? I'm running gcc -pg.
10 votes
1 answer
4k views

Can anybody explain to me the difference between profile-generate and the pg options?
17 votes
1 answer
13k views

When compiling my c++ sources with the -pg option to inject gprof profile instrumentation code the compile fails with the undefined reference to _mcount error. Without this option everything compiles ...
0 votes
2 answers
464 views

How can I make my gcc -pg create a gmon.out file instead of an a.out? I'm trying to profile my CPU using gprof, but when I compile my .c file I get an a.out, which is not what I need.
1 vote
0 answers
278 views

I have dockerfile: FROM alpine:3.18.2 WORKDIR /app RUN apk add gdb gcc musl-dev make binutils COPY ./src /app RUN gcc main.c -pg -o app But compilation fails with an error: /usr/lib/gcc/x86_64-alpine-...
4 votes
3 answers
1k views

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 ...
10 votes
2 answers
16k views

I am following a tutorial that says how to profile the program using gprof and the command given is like this gcc -Wall -pg test_gprof.c test_gprof_new.c -o test_gprof But it doesn'y give any ...

15 30 50 per page
1
2 3 4 5
22