Re: Non-priv way to collect job stats under Intel?
Re: Non-priv way to collect job stats under Intel?
- Subject: Re: Non-priv way to collect job stats under Intel?
- From: almisr <email@hidden>
- Date: Wed, 2 Aug 2006 11:38:47 +0200
1. system_cmds src ?
2. sysctl could give what u want
man 3 sysctl
-------------------------------------
int mib[2], freq;
u_int miblen = 2;
size_t len;
float speed;
char *u;
mib[0] = CTL_HW ;
mib[1] = HW_CPU_FREQ ;
len = sizeof(freq);
if (sysctl(mib, miblen, &freq, &len, NULL, 0) == -1)
{
//err
}
-------------------------------------
int i, mib[4];
size_t len;
struct kinfo_proc kp;
/* Fill out the first three components of the mib */
len = 4;
sysctlnametomib("kern.proc.pid", mib, &len);
/* Fetch and print entries for pid's < 100 */
for (i = 0; i < 100; i++) {
mib[3] = i;
len = sizeof(kp);
if (sysctl(mib, 4, &kp, &len, NULL, 0) == -1)
perror("sysctl");
else if (len > 0)
printkproc(&kp);
}
Best Regards
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden