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
1 answer

Unable to view complete output from gprof profiler

In spite of compiling my code with -pg flag set, I am unable to view the complete details of the gprof output from gmon.out Specifically, I am not getting the details of calls, self Ts/call and total Ts/call. This is the output of gprof…
Swaroop
  • 1,219
  • 3
  • 16
  • 32
0
votes
0 answers

Interpreting profiler log for STL based code

I did a generalization a an algorithm implementation. Now, the new implementation runs more than 100 times slower than the old one. My guess is that the source unnecessary use of inefficiency is implicit copy constructors that I somehow introduced.…
Artium
  • 5,147
  • 8
  • 39
  • 60
0
votes
1 answer

Disable profiling on certain function and all its descendants

Is it possible preferably with a function attribute to disable profiling on a certain function? I want to do this because I need to profile the time spent in multithreaded parts of a program. I do not care about the details of the particular…
user877329
  • 6,717
  • 8
  • 46
  • 88
0
votes
0 answers

*** glibc detected *** : free() : invalid pointer c++

I'm having some trouble when trying to execute the following code :https://github.com/Itseez/opencv/blob/master/samples/cpp/facedetect.cpp With this modification in memory allocation: for(;;) { // IplImage* iplImg = cvQueryFrame( capture ); …
The Beast
  • 1,629
  • 2
  • 29
  • 42
0
votes
0 answers

How to use the profiler in c++ with raspberry pi 2

I'm using the gprof profiler to know the execution time of my functions and the performance of the code. The code is about face detection in C++ using the raspberry pi 2 and the camera module. i'm using gprof => what i get in output is : i think…
The Beast
  • 1,629
  • 2
  • 29
  • 42
0
votes
1 answer

How to make gcc generate information for gprof?

I know that I should use -pg switch and run compiled program but it is not working. I am playing with cpuminer source code to learn something about Intel intrinsics and vectorization rather than for coins. What to know where cpuminer spends most of…
Marcin Badtke
  • 599
  • 5
  • 9
0
votes
1 answer

Min heap with std::priority_queue is my bottleneck

Alternative title: Implement min heap with something faster than std::priority_queue. grpof gave me: time seconds seconds calls s/call s/call name 84.12 105.54 105.54 320000 0.00 0.00 …
gsamaras
  • 71,951
  • 46
  • 188
  • 305
0
votes
2 answers

GCC Profiler, time unaccounted for

I am currently using the min-gw GCC profiler tool gprof to find the slow portions of my code. I compile the code with gcc -p -pg -o3 example.c -o example.exe After running the file I use gprof example.exe > data.txt My program prints its running…
AndrewGrant
  • 786
  • 7
  • 17
0
votes
0 answers

gprof collect no time data in program with lua 5.2 state

I'm trying measure overhead, we get by using lua script in C++ program. I decided to use gprof for that. I wrote simple program like: Create lua state Load lua libs Do file with lua script The problem is that gmon.out cointains no time data. It…
user2800697
  • 27
  • 1
  • 6
0
votes
1 answer

Dangled with std::mt19937 and profiling the code with gprof

I have in my .h file this code: std::mt19937 rng(time(NULL)); // mersenne numbers int random(int n) { std::uniform_int_distribution distribution(0, n); return distribution(rng); } but I never call random(). When I am profiling the code…
gsamaras
  • 71,951
  • 46
  • 188
  • 305
0
votes
0 answers

profiling c code using gprof

for a seemingly large code for AES when I profile the code using gprof with following command cc file1.c file2.c -pg ./a.out gprof a.out gmon.out > analysis.txt cat analysis.txt the output file shows time as 0 for all function calls Flat…
Himanshu Sourav
  • 700
  • 1
  • 10
  • 35
0
votes
1 answer

Linking error while building automoc4

I have installed KDE libs. And I am trying to compile kcachegrind. However this error message appears: CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message): Did not find automoc4…
Yuchen
  • 30,852
  • 26
  • 164
  • 234
0
votes
1 answer

_fu2___ZSt4cout is taking 21.49% of the running time in my C++ code

I am using gprof to optimize my C++ code, and I am obtaining the following results: Flat profile: Each sample counts as 0.01 seconds. % cumulative self self total time seconds seconds calls s/call s/call name …
Jaime Ivan Cervantes
  • 3,579
  • 1
  • 40
  • 38
0
votes
1 answer

How to compare several Gprof profiler reports?

In multiple run of my C program with different parameter values, I get multiple profiling report files. This is too difficult to read and compare. Is there a way I can get a comparison file, preferably with graphs to show , how the performance…
gpuguy
  • 4,607
  • 17
  • 67
  • 125
0
votes
1 answer

Automating the profling of C program using GPROF

I am profiling a matrix multiplication C program using gprof. That C program has a general structure like this; int main() { int n; printf("enter size of square matrices"); scanf("%d", &n); data(matM); //fill matrices with n x n random data…
user2799508
  • 844
  • 1
  • 15
  • 41