gprof: Any way to specify the location of profile data
The default the profile file is from the executable is run and the file is called gmon.out. Is there any way to specify a new location? I'm using gcc 3.4.6 on i386/linux2.6 ...
The default the profile file is from the executable is run and the file is called gmon.out. Is there any way to specify a new location? I'm using gcc 3.4.6 on i386/linux2.6 ...
I ran gprof on a C++ program that took 16.637s, according to time(), and I got this for the first line of output: % cumulative self self total time seconds seconds calls s/call s/call name 31.07 0.32 0.32 5498021 0.00 0.00 [whatever] Why does it list 31.07% of time if ...
Profiling my C++ code with gprof, I discovered that a significant portion of my time is spent calling one virtual method over and over. The method itself is short and could probably be inlined if it wasn't virtual. What are some ways I could speed this up short of rewriting it all to not be virtual? ...
when using gprof: gprof options [executable-file [profile-data-files...]] [> outfile] if you have options to pass to the executable like: gprof a.out --varfred=32 then gprof assumes that i am passing an invalid option to gprof instead of the a.out. Any way to get around this? ...
I'm working on a project where I need to find which functions get called in various Linux programs (written in C) given particular inputs. My current approach has been to compile a program with -pg (profiling option), run it, and find which functions get called by processing gprof's output. Only functions that are called at least once ap...
I use GNU gprof 2.15.94.0.2.2 to do profiling of my C++ program, which has large call cycles. I expected to see something like below in the call graph output as gprof's documentation indicates: index % time self children called name ---------------------------------------- 1.77 0 1/1 main [2] [...
Can gprof be used to profile a multi-threaded program that uses pthreads? That is, will its output include the time used in all the threads? ...
I am looking for a list of compilers able to generate a gprof output. ...
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 gprof. Unfortunately my call graph contains all zeroes for all time columns. The values in the "called" columns have reasonable values so it...
I'm having trouble running gprof on OS X. The file test.c is: #include <stdio.h> int main() { printf("Hello, World!\n"); return 0; } and my terminal looks like: $ gcc -pg test.c $ gcc -pg -o test test.c $ ./test Hello, World! $ gprof test gprof: file: test is not of the host architecture Edit: also, it doesn't generate the fil...
What is the command line format to display function call graph for a method in templated class with gprof? For simple C method you would specify it like: gprof -f foo myprogram > gprof.output How do you specify method parse from the following: template <typename T> class A { public: template <typename X> bool parse(X& x,...
Is it possible to use gprof to line-profile a single function in C++? gprof -l -F function_name ... does not seem to work. Thanks, Bi. ...
We use g++ 4.2.4 and I'm trying to track down some performance problems in my code. I'm running gprof to generate the profile, and I'm getting the following "strangeness" in that the most expensive function is __tcf_0: Each sample counts as 0.01 seconds. % cumulative self self total time seconds sec...
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 gprof is unable to accumulate any time .Please help . Here is one of my sample function. b...
I have the following method to swap two double arrays (double**) in c++. Profiling the code, the method is accounting for 7% of the runtime... I was thinking that this should be a low cost operation, any suggestions? I am new with c++, but i was hoping to just swap the references to the arrays. 62 void Solver::Swap(double** &v1, dou...
I am trying to profile a shared library but there is an error when I invoke gprof: $ export LD_PROFILE=libMy.so $ ./a.out $ gprof -q libMy.so /var/tmp/libMy.so.profile gprof: file /var/tmp/libMy.so.profile has unsupported version 131071 Shared library was compiled with -ggdb -pg flags. gcc version 4.2.1, gprof versio...
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 takes to run? ...
I have a series of blackbox tests made from shell scripts (Similar to that of the tests for GNU Hello). I am trying to get it to generate the flat-profile automatically if the gmon.out is found (and it will be if the project was configured with --enable-prof). The problem is that the tests are in a different directory then the executab...
I am running gprof on my executable, but the executable spends a lot of time wait()ing for child processes to complete. Is the time spent waiting factored in to the gprof timings? ...
I have a host application and I have written a plug-in. I compile my plug-in down to a shared object (say foo.so), and the host application will load it via dlopen. In this case, my host application is the opt tool from llvm (though I don't think that's important to the question). I'd like to compile my plug-in with profiling enabled ...