LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 01-18-2005, 05:49 AM   #1
jnusa
Member
 
Registered: Jul 2004
Location: Denmark, Aarhus
Distribution: Ubuntu, Suse
Posts: 98

Rep: Reputation: 15
C profiler tool like in matlab?


I was wondering is there's a profiler tool, that can benchmark a C program and give info like execution time, divided between function, resource consumtion ect. I've done a lot of programming in Matlab, and the profiler tool there is very helpfull, to see which areas of your program isn't very effective.

jnusa
 
Old 01-18-2005, 05:53 AM   #2
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 47
Have a look at Valgrind its a memory debugger and profiler.
 
Old 01-18-2005, 06:16 AM   #3
jnusa
Member
 
Registered: Jul 2004
Location: Denmark, Aarhus
Distribution: Ubuntu, Suse
Posts: 98

Original Poster
Rep: Reputation: 15
Hmm... looks very usefull. Gave me a lot of thinks I need to correct . Doesn't seem to be able to benchmark your program though?!
 
Old 01-18-2005, 06:29 AM   #4
bahramH
Member
 
Registered: Apr 2004
Location: France
Distribution: Mandrake
Posts: 67

Rep: Reputation: 15
Profiling is included in any "respectable" compiler. In C, compile your program with the -p option, and then, after executing your program, use "prof" to see the profile.
If you're using gcc, use the -pg option and "gprof". and have a look at the man page of gprof.
 
Old 01-18-2005, 06:29 AM   #5
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 47
Try GProf Also there is KCachegrind which is based on Valgrind but does more and has a good interface.
 
Old 01-18-2005, 07:42 AM   #6
jnusa
Member
 
Registered: Jul 2004
Location: Denmark, Aarhus
Distribution: Ubuntu, Suse
Posts: 98

Original Poster
Rep: Reputation: 15
Uhhh.... thank you so much leonscape. kCachegrind is pretty awesome... just what I needed. For future reference.... needs to install valgrind, valgrind-callgrind and kcachegrind to make it work.

[EDIT]
missed your post bahramH. Sounds great.. I'll try to add those compiler options-
[/EDIT]

Last edited by jnusa; 01-18-2005 at 07:44 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux System Profiler kazu Linux - Software 3 04-21-2005 12:31 AM
Memory profiler in Linux Franziss Programming 1 02-18-2005 12:29 PM
Terminal cmd for starting Matlab M-file editor without starting matlab fubzot Linux - Software 2 02-15-2005 06:49 AM
profiler for 2-process proxy application flor~ Programming 0 10-14-2004 11:27 AM
Look for a good, inexpensive profiler BrianK Programming 3 08-30-2004 01:29 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration