LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-12-2008, 11:16 PM   #1
hai12345
LQ Newbie
 
Registered: Jun 2008
Posts: 9

Rep: Reputation: 0
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,
 
Old 10-15-2008, 03:40 PM   #2
traene
Member
 
Registered: Jan 2005
Distribution: Archlinux, Debian, Centos
Posts: 222

Rep: Reputation: 35
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.
 
Old 10-18-2008, 06:34 AM   #3
hai12345
LQ Newbie
 
Registered: Jun 2008
Posts: 9

Original Poster
Rep: Reputation: 0
hi traene,
thanks,
i was compile successfully.but error is coming while try to creating exe.

pls give some more details abt this
 
Old 10-18-2008, 07:11 AM   #4
hai12345
LQ Newbie
 
Registered: Jun 2008
Posts: 9

Original Poster
Rep: Reputation: 0
hi,
while compiling gmon.out file is creating. but how can open that one.
 
Old 10-18-2008, 10:21 AM   #5
traene
Member
 
Registered: Jan 2005
Distribution: Archlinux, Debian, Centos
Posts: 222

Rep: Reputation: 35
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.
 
Old 10-20-2008, 04:05 AM   #6
hai12345
LQ Newbie
 
Registered: Jun 2008
Posts: 9

Original Poster
Rep: Reputation: 0
hi traene,

thanks.
now i getting correct result.

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


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Makefile and profiling disruptive Programming 2 01-22-2007 08:57 AM
php profiling alaios Fedora 0 12-08-2004 01:13 PM
Maybe we need more racial profiling right now jaz General 29 07-27-2004 08:42 PM
kernel profiling bluefiord02 Linux - Software 1 04-06-2004 02:43 PM
Profiling in linux bluefiord02 Linux - General 1 04-06-2004 12:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration