use procsinfo64 and get proc_state.priority from that

This commit is contained in:
Doug MacEachern 2005-11-23 01:24:29 +00:00
parent 6b7a36f521
commit 92a33c7caf
2 changed files with 6 additions and 7 deletions

View File

@ -1078,7 +1078,7 @@ int sigar_proc_mem_get(sigar_t *sigar, sigar_pid_t pid,
sigar_proc_mem_t *procmem) sigar_proc_mem_t *procmem)
{ {
int status = sigar_getprocs(sigar, pid); int status = sigar_getprocs(sigar, pid);
struct procsinfo *pinfo = sigar->pinfo; struct procsinfo64 *pinfo = sigar->pinfo;
if (status != SIGAR_OK) { if (status != SIGAR_OK) {
return status; return status;
@ -1097,7 +1097,7 @@ int sigar_proc_cred_get(sigar_t *sigar, sigar_pid_t pid,
sigar_proc_cred_t *proccred) sigar_proc_cred_t *proccred)
{ {
int status = sigar_getprocs(sigar, pid); int status = sigar_getprocs(sigar, pid);
struct procsinfo *pinfo = sigar->pinfo; struct procsinfo64 *pinfo = sigar->pinfo;
if (status != SIGAR_OK) { if (status != SIGAR_OK) {
return status; return status;
@ -1122,7 +1122,7 @@ int sigar_proc_time_get(sigar_t *sigar, sigar_pid_t pid,
sigar_proc_time_t *proctime) sigar_proc_time_t *proctime)
{ {
int status = sigar_getprocs(sigar, pid); int status = sigar_getprocs(sigar, pid);
struct procsinfo *pinfo = sigar->pinfo; struct procsinfo64 *pinfo = sigar->pinfo;
if (status != SIGAR_OK) { if (status != SIGAR_OK) {
return status; return status;
@ -1141,7 +1141,7 @@ int sigar_proc_state_get(sigar_t *sigar, sigar_pid_t pid,
sigar_proc_state_t *procstate) sigar_proc_state_t *procstate)
{ {
int status = sigar_getprocs(sigar, pid); int status = sigar_getprocs(sigar, pid);
struct procsinfo *pinfo = sigar->pinfo; struct procsinfo64 *pinfo = sigar->pinfo;
tid_t tid = 0; tid_t tid = 0;
struct thrdsinfo64 thrinfo; struct thrdsinfo64 thrinfo;
@ -1150,11 +1150,9 @@ int sigar_proc_state_get(sigar_t *sigar, sigar_pid_t pid,
} }
if (getthrds(pid, &thrinfo, sizeof(thrinfo), &tid, 1) == 1) { if (getthrds(pid, &thrinfo, sizeof(thrinfo), &tid, 1) == 1) {
procstate->priority = thrinfo.ti_pri;
procstate->processor = thrinfo.ti_affinity; procstate->processor = thrinfo.ti_affinity;
} }
else { else {
procstate->priority = SIGAR_FIELD_NOTIMPL;
procstate->processor = SIGAR_FIELD_NOTIMPL; procstate->processor = SIGAR_FIELD_NOTIMPL;
} }
@ -1162,6 +1160,7 @@ int sigar_proc_state_get(sigar_t *sigar, sigar_pid_t pid,
procstate->ppid = pinfo->pi_ppid; procstate->ppid = pinfo->pi_ppid;
procstate->nice = pinfo->pi_nice; procstate->nice = pinfo->pi_nice;
procstate->tty = pinfo->pi_ttyd; procstate->tty = pinfo->pi_ttyd;
procstate->priority = pinfo->pi_pri;
procstate->threads = pinfo->pi_thcount; procstate->threads = pinfo->pi_thcount;
switch (pinfo->pi_state) { switch (pinfo->pi_state) {

View File

@ -67,7 +67,7 @@ struct sigar_t {
swaps_t swaps; swaps_t swaps;
time_t last_getprocs; time_t last_getprocs;
sigar_pid_t last_pid; sigar_pid_t last_pid;
struct procsinfo *pinfo; struct procsinfo64 *pinfo;
struct cpuinfo *cpuinfo; struct cpuinfo *cpuinfo;
int cpuinfo_size; int cpuinfo_size;
int cpu_mhz; int cpu_mhz;