Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 15th, 2004, 3:29 PM   #1
akilhoffer
Newbie
 
Join Date: Sep 2004
Posts: 3
Rep Power: 0 akilhoffer is on a distinguished road
I wish to add some performance monitoring capabilities to a Linux application I built in C++. I have no idea what APIs are available to accomplish this, however. Are there any built into the Linux kernel? There are lots of apps out there that do this, but how did they do it? Surely, there is some built-in portion of LInux that allows C/C++ developers to access this. Anyone??
akilhoffer is offline   Reply With Quote
Old Sep 15th, 2004, 3:54 PM   #2
Ashcroft
Programmer
 
Join Date: Sep 2004
Posts: 38
Rep Power: 0 Ashcroft is on a distinguished road
If you are looking for memory, descriptor, cpu, and so on utilization I'd suggest using the proc filesystem. The details will vary depending on what linux kernel version you have, but the basic idea is that /proc/$pid (where $pid is the process id of the proc you are interested in) will contain files that describe the process, this is where 'ps' and 'top' get their information on many systems.

There is a 'profil' call that will give you an estimate of the percentage of time spent in the various functions in your program - it is somewhat clumsy to use so I'd suggest just using the profiler if you want to gather that sort of data.
Ashcroft is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:53 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC