Questions tagged [gprof]
gprof is a GNU tool used for code profiling.
319
questions
0
votes
0
answers
29
views
gprof not working - BFD: Dwarf Error: Could not find abbrev number 84
I'm trying to use gprof to profile my code but I get that error from cmd (title)
I tried gcc -g -pg -o test wordle.c to generate a text.exe file from my wordle.c. I ran the test.exe once so that gmon....
0
votes
0
answers
38
views
gprof's output gmon.out not appearing when cancelling slurm job before its finish
I am profiling a Fortran code with gprof.
I run this code on a cluster, where I request 24 cores from 1 node.
The job is submitted via slurm.
The command to run the code, inside the submission.sh I ...
0
votes
1
answer
193
views
How do one visualize gprof profiling data as a flamegraph?
I've profiled a C++ application using GNU gprof. It would be really nice to visualize the data and for that purpose I found a python utility gprof2dot, which creates a graph from the gprof data, nice! ...
0
votes
0
answers
59
views
Adding gprof to C++ Program that takes in arguments
I have been using gprof recently and now I was trying to include this on a big project but the thing is that since my executable needs a argument to work every time I execute the gprof like:
grof <...
1
vote
0
answers
45
views
gprof - Top times spent in `std::bad_variant_accesss::~bad_variant_access()`?
I'm trying to measure performance of some code I wrote. I compiled it with g++ with -pg flag, and when after running it I execute grpof, I reliably get std::bad_variant_access::~bad_variant_access() ...
0
votes
1
answer
56
views
gprof only showing calls - C program in Ubuntu with WSL1
I am having an issue with "gprof" while using WSL1 and "gcc" in Ubuntu. The only information it displays is the "calls" and anything else is set as 0.00. I do not think ...
0
votes
0
answers
208
views
How to use gprof when my program need command line parameters?
I'm doing a profiling using gprof this way:
Compile and link the program with a -pg flag
Execute ./myProgram param1 param2 which generates the gmon.out file
Execute gprof ./myProgram gmon.out > ...
0
votes
0
answers
50
views
configure python to enable C level code profiling
the configuration gives an option for this,
./configure --enable-profiling
but how exactly do I use this,
I would like to profile C functions, as I run python code.
0
votes
0
answers
35
views
gprof displays no time accumulated
I am trying to use gprof to profile my code. However, when I compile with the flag -pg, gprof displays no time accumulated and the report contains all 0's. The version I have is GNU gprof (GNU ...
3
votes
1
answer
127
views
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 ...
0
votes
0
answers
76
views
Using gprof on a multitask ADA source code, I get the analysis of only the main task
I follow all the steps to instrumentalize, run and analyse the obtained output (gmon.out), but the text file obtained shows the analysis of the execution of the main task only.
I've read about similar ...
0
votes
0
answers
87
views
gprof generating only flat profile
I am profiling a fortran code with gprof. The code uses a c pre processor and mpifort wrapper with aocc (AMD compiler) to compile. I am specifying -pg flag for compilation as well as linking. But the ...
1
vote
0
answers
46
views
gprof shows every fonction (even summary) at 0%
I have a well working sort programm which I want to analyse with gprof.
Here is the code. It create random list of integers and sort it. It does the job :
#include <stdlib.h>
#include <stdio....
-4
votes
1
answer
111
views
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....
0
votes
0
answers
55
views
Using gprof and speeding up element-wise array multiplication in C++
I am using gprof as a profiler for my code for the purpose of enhancing efficiency/speed of my code and possibly parallelizing it eventually. I was able to profile the code and found out big portion ...
11
votes
1
answer
401
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 ...
0
votes
0
answers
1k
views
How to do profiling a C++ project with gprof?
I have a big C++ program in VS code under Ubuntu 18.4, I am using CMake. I need to Know what areas are spending more time and memory space. I am a beginner in coding in Linux and using CMakeLists.txt ...
9
votes
1
answer
1k
views
gprof producing no output for a program that takes reasonable time to execute
I know that similar questions have been asked before, but:
In regards to gprof produces empty output I am using GCC 10.2.0 from MSYS2 on Windows 10, i.e. it's a MingW64 distribution. I have also ...
0
votes
0
answers
133
views
How to run gprof on non-terminating multi-threaded C++ program?
I can't call std::exit from an arbitrary thread (or via a signal handler), because other still-running threads will experience undefined behavior (typically, a segfault).
Normally, to exit the program,...
4
votes
0
answers
805
views
WSL gprof reporting zero times
I'm trying to use gprof in WSL on Windows 10. I hadn't anticipated any difficulty, because it worked fine last time I used it in an Ubuntu virtual box on Windows 7. Following as before the directives ...
0
votes
0
answers
166
views
Understanding why some functions are not profiled in Gprof?
I am trying to use gprof and the legend reads for the calls column
calls the number of times this function was invoked, if
this function is profiled, else blank.
I have some functions ...
-1
votes
1
answer
70
views
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 ...
0
votes
0
answers
179
views
Add custom scope with gcc and gprof
I am profiling my C++ program, but I would like to profile specific parts of my functions, as for-loops, some parts of some functions. By compiling with -pg, I can only see the samples at a function ...
0
votes
0
answers
122
views
C++-11 class template instantiations crash gprof... any advice?
I'm teaching a course on C++ 11 and Linux this fall, and wanted to show the students gprof, so I built a little "word count" program with multiple threads; it runs blazingly quickly and ...
1
vote
1
answer
697
views
How to use a makefile with gprof to recompile dependencies?
I have a makefile which compiles and links together objects to create an executable. In order to profile, I need to use an additional flag -pg before compiling. Here is my current makefile:
# objects ...
1
vote
2
answers
372
views
What are these c++ std functions in my gprof output which are taking quite a lot of time?
gprof output. I have used deques, std::vector and std::move in my code.
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time ...
4
votes
1
answer
208
views
Gprof shows regular functions in the app as called from <spontaneous>
So - I've been writing a language interpreter as a side project for a year now. Today I have finally decided to test its performance for the first time! Maybe I should have done that sooner... turns ...
0
votes
1
answer
66
views
Profiling the same C function called with different arguments
Some confusion using a profiler while working on a fixed-point DSP code.
When I run gprof on the following code:
main()
{
...
g_apply( &g_mono, in_mono );
g_apply( &g_stereo,...
1
vote
0
answers
734
views
How to use GNU gprof profiler on macOS Mojave?
I want to use GNU gprof that comes with GCC to profile my C program. However, it returns __dyld section not supported error when I compile with the -pg flag and try to run the program:
$ gcc -pg main....
1
vote
1
answer
102
views
gprof output shows a nonexistent call graph edge
I'm interested in profiling the function grep_source_is_binary()[1], whose code goes as following:
static int grep_source_is_binary(struct grep_source *gs,
struct index_state *...
1
vote
1
answer
212
views
gprof declares too much as “spontaneous” with Eigen
I have a C++ project which uses the Eigen matrix library. In order to improve performance I need to get a profile for it. I have tried using gprof, but the profile contains a bunch of results like ...
3
votes
1
answer
727
views
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 &...
6
votes
1
answer
5k
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 ...
0
votes
1
answer
2k
views
GPROF profiling tool is inaccurate execution time
I tried to test my cpp code using gprof on ubuntu.
But I found some bug.
When gprof calculates execution time, the minimum time unit is 0.01 seconds.
For example, if execution time of my function ...
1
vote
1
answer
1k
views
How to compile a Fortran code for profiling with gprof in OpenMPI?
I am able to compile my Openmpi code using gfortran compiler. The compile syntax I give is :
mpif90 -o mycode.exe mycode.f90
mpirun -np 4 ./mycode.exe
It works. And now I want to profile my code ...
3
votes
0
answers
306
views
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. ...
3
votes
1
answer
2k
views
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 ...
4
votes
0
answers
403
views
Exclude C++ standard library function calls from gprof output
I am using the C++ standard library in some C++ code and this makefile:
CC=g++
CXXFLAGS=-Wall -Werror -ggdb3 -std=c++11 -pedantic $(OTHERFLAGS)
cpp_sort: cpp_sort.o
g++ -o $@ $(CXXFLAGS) $^
clean:...
5
votes
1
answer
2k
views
How do I get meaningful results from gprof on an MPI code?
I am optimising an MPI code and I am working with Gprof.
The problem is that the results I obtained are completely unreasonable. My workflow is the following:
compiling the code adding -pg as a ...
0
votes
1
answer
139
views
GProf: What are __cosl_internal and __sinl_internal functions?
I've been profiling my program using gprof and noticed the following appear near the top:
Each sample counts as 0.01 seconds.
% cumulative self self total
time ...
0
votes
1
answer
66
views
Can a simple multi-dimensional array dereference be slow?
I'm struggling to understand the output I'm getting from gprof.
I have a simple wrapper class around a 2D array that I need to be contiguous in memory.
Its constructor and the method I use to ...
0
votes
1
answer
100
views
no profiling data created while compiling with gcc
I want to use the gprof profiling option in order to speed up my code. I am compiling with gcc. The problem is that there is not output file created 'gmon.out' or so. Here is a sample of the Makefile ...
0
votes
1
answer
649
views
gprof Not Showing Call Information
I successfully compile and run my Fortran code with the -pg flag using the gfortran compiler. gprof produces a gmon.out file. When I run gprof on the file and take a look at the resultant *.txt file, ...
3
votes
0
answers
405
views
Function never called but shown by gprof for C code?
I am having the upper issue and was wondering if this is a bug or I am using gprof wrong?
So as usual I compile my C code with -pg commands, and then after running it I do gprof ./my_program gmon....
1
vote
0
answers
2k
views
how can i install Gprof on Ubuntu?
i want to use Gprofiler and I have Ubuntu on virtual Box.
run following command:
$ gprof
$ a.out: No such file or directory
$ apt-get install binutils
but when i run gprof , i have this error again
...
2
votes
3
answers
429
views
Do (sampling) profilers still "lie" these days?
Most of my limited experience with profiling native code is on a GPU rather than on a CPU, but I see some CPU profiling in my future...
Now, I've just read this blog post:
How profilers lie: The ...
0
votes
1
answer
37
views
Can I still profile my code when the load exceeds the cores?
Sometimes I need to profile an application while simultaneously needing to fire off a large number of unrelated calculations. Often I will launch off multiple jobs so that the load exceeds the number ...
1
vote
0
answers
64
views
Visual Studio profiler too much noise in results
Can I restrict the results in Visual Studio? I just want to see results for code that I have written. I am following the "500 line openGL" tutorial and I am jealous of his results in the tutorial.
% ...
3
votes
0
answers
168
views
Does gcc -pg option affect core size?
I am working with gcc -pg option in order to do some profiling on my C++ program usign gprof.
I have added -pg option to both linking and compiling, and added a call to exit(0) in order to have a ...
0
votes
1
answer
165
views
BLAS routines in profiler?
I'm trying to profile some Fortran code that calls GEMM to do matrix multiplication.
I used to use double precision and was seeing dgemm calls as I would expect, but now that I've switched to single ...