06-04-2008
9,
0
Join Date: May 2008
Last Activity: 18 November 2008, 1:21 PM EST
Posts: 9
Thanks Given: 0
Thanked 0 Times in 0 Posts
CPUs information on IBM AIX 4.3
Hi,
I would like to know how can i get information like %user %kernel %idle etc for each cpu. Getting the infomation for the complete system cpu usage is given below but can you help me in getting each cpu information from cpu 0 to cpu n-1. Is there any kernel symbol for that and if there is how to offset into it.
static struct nlist nlst[] = {
{ "sysinfo", 0, 0, 0, 0, 0 }, /* 0 */
};
if (knlist(nlst, 1, sizeof(struct nlist)) != 0) {
perror("knlist");
return -1;
sysinfo_offset = nlst[0].n_value;
struct sysinfo s_info;
// then i read the value from kmem using
// get sysinfo structure
getkval(sysinfo_offset, (caddr_t)&s_info, sizeof s_info, "sysinfo");
Thanks a lot
Regards,
Raja