LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Function Profiling (https://www.linuxquestions.org/questions/linux-software-2/function-profiling-675939/)

hai12345 10-12-2008 11:16 PM

Function Profiling
 
hi,

I have created one project in eclipse. I have updated my eclipse with Test and Performance Tools Platform (TPTP) tool. Now I got Profiling and Logging option.

While trying to create profile configuration, java application is available but there is no option for C/C++.

1. Is possible to do function profiling for c code in Eclipse?
2. In profiling configuration one of the option is there Attach to agent, in that how can add agent?

thanks,

traene 10-15-2008 03:40 PM

No idea about profiling out of eclipse for c/c++ programms. However, you could try to compile your progamme on the command line. Just add '-ggdb -pg' to the compiler options. This will create a binary with profiling enabled.

When you run your programm and let it quit in a proper way, you will get a 'gprof.out' file in the CWD. You can examine this file with gprof like so:
gprof 'YOUR_BINARY' gprof.out

This will dump the function profiling data to STDOUT.

hai12345 10-18-2008 06:34 AM

hi traene,
thanks,
i was compile successfully.but error is coming while try to creating exe.

pls give some more details abt this

hai12345 10-18-2008 07:11 AM

hi,
while compiling gmon.out file is creating. but how can open that one.

traene 10-18-2008 10:21 AM

Basically, its what i stated:
Code:

gprof 'YOUR_BINARY' gprof.out
Maybe the following helps:
http://www.cs.utah.edu/dept/old/texi...gprof_toc.html

Additionaly try info / man pages for gprof.

hai12345 10-20-2008 04:05 AM

hi traene,

thanks.
now i getting correct result.

that link is very useful for function profiling.
thanks a lot.


All times are GMT -5. The time now is 10:28 AM.