add proc_state.processor

This commit is contained in:
Doug MacEachern committed 2005-11-23 01:16:52 +00:00
1 parent 2f1ecff921
commit 6b7a36f521
6 files changed
+20 -1

No files matched your search

+11 -1
View File
@@ -1142,16 +1142,26 @@ int sigar_proc_state_get(sigar_t *sigar, sigar_pid_t pid,
{
int status = sigar_getprocs(sigar, pid);
struct procsinfo *pinfo = sigar->pinfo;
tid_t tid = 0;
struct thrdsinfo64 thrinfo;
if (status != SIGAR_OK) {
return status;
}
if (getthrds(pid, &thrinfo, sizeof(thrinfo), &tid, 1) == 1) {
procstate->priority = thrinfo.ti_pri;
procstate->processor = thrinfo.ti_affinity;
}
else {
procstate->priority = SIGAR_FIELD_NOTIMPL;
procstate->processor = SIGAR_FIELD_NOTIMPL;
}
SIGAR_SSTRCPY(procstate->name, pinfo->pi_comm);
procstate->ppid = pinfo->pi_ppid;
procstate->nice = pinfo->pi_nice;
procstate->tty = pinfo->pi_ttyd;
procstate->priority = SIGAR_FIELD_NOTIMPL; /* XXX getthrds() */
procstate->threads = pinfo->pi_thcount;
switch (pinfo->pi_state) {
+1
View File
@@ -333,6 +333,7 @@ int sigar_proc_state_get(sigar_t *sigar, sigar_pid_t pid,
procstate->priority = pinfo->pst_pri;
procstate->nice = pinfo->pst_nice;
procstate->threads = pinfo->pst_nlwps;
procstate->processor = pinfo->pst_procnum;
switch (pinfo->pst_stat) {
case PS_SLEEP:
+1
View File
@@ -661,6 +661,7 @@ int sigar_proc_state_get(sigar_t *sigar, sigar_pid_t pid,
procstate->priority = pinfo->pr_lwp.pr_pri;
procstate->nice = pinfo->pr_lwp.pr_nice - NZERO;
procstate->threads = pinfo->pr_nlwp;
procstate->processor = pinfo->pr_lwp.pr_onpro;
switch (pinfo->pr_lwp.pr_state) {
case SONPROC: