C/C++ library for CPU statistics

Hi all,

This is my first post, so at the beginning I would like to be nice and say: "Hello all!" :slight_smile:
I am looking for a C/C++ library for Linux CPU statistics. All I found is that it is possible to parse two files: /proc/cpuinfo and /proc/stat to gain some needed information, but I would like to know if there is a nice library for doing this (ex. Solaris kstat.h equivalent).

Thanks is advace. Regards.

I have found the kernel_stat.h library. There is a structure:

struct kernel_stat {
struct cpu_usage_stat {
unsigned int user;
unsigned int nice;
...
}
unsigned int irqs[NR_IRQS];
}

Can anyone tell me how to fill in this structure with data? Thanks in advance.