![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Sep 2004
Posts: 3
Rep Power: 0
![]() |
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??
|
|
|
|
|
|
#2 |
|
Programmer
Join Date: Sep 2004
Posts: 38
Rep Power: 0
![]() |
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. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|