327 questions
28
votes
7
answers
30k
views
gprof reports no time accumulated
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
gprof gives no output
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
gprof produces empty output
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
How to exclude a function from Gprof activity during running
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
Empty profile with -p on gcc [closed]
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
GCC gprof line-by-line error "somebody miscounted"
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
Why does gprof significantly underestimate the program's running time?
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
What does the filename "gmon.out" stand for?
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
gprof: unexpected EOF after reading 48/271618093 bins? [closed]
What does this error mean for gprof? I'm running gcc -pg.
10
votes
1
answer
4k
views
Profile Generate vs PG
Can anybody explain to me the difference between profile-generate and the pg options?
17
votes
1
answer
13k
views
gcc: undefined reference to _mcount (gprof instrumentation)
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
gcc -pg creates a.out instead of gmon.out
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
How to solve problem using gcc -pg on alpine?
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
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 ...
10
votes
2
answers
16k
views
What does -Wall flag do when I compile it with the program?
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 ...