Clean up process accounting some more. Unfortunately, it is still not
quite right on i386 as the CPU who runs statclock() doesn't have a valid clockframe to calculate statistics with.
This commit is contained in:
parent
bbbb2579b4
commit
77044cb6d9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=65782
@ -2507,13 +2507,11 @@ forwarded_statclock(int id, int pscnt, int *astmap)
|
||||
if (pscnt > 1)
|
||||
return;
|
||||
|
||||
if (p == SMP_prvspace[id].globaldata.gd_idleproc) {
|
||||
p->p_sticks++;
|
||||
if (p == SMP_prvspace[id].globaldata.gd_idleproc)
|
||||
cp_time[CP_IDLE]++;
|
||||
} else {
|
||||
p->p_sticks++;
|
||||
else
|
||||
cp_time[CP_SYS]++;
|
||||
}
|
||||
break;
|
||||
case CHECKSTATE_INTR:
|
||||
default:
|
||||
@ -2536,7 +2534,6 @@ forwarded_statclock(int id, int pscnt, int *astmap)
|
||||
p->p_iticks++;
|
||||
cp_time[CP_INTR]++;
|
||||
}
|
||||
if (p != SMP_prvspace[id].globaldata.gd_idleproc) {
|
||||
schedclock(p);
|
||||
|
||||
/* Update resource usage integrals and maximums. */
|
||||
@ -2550,7 +2547,6 @@ forwarded_statclock(int id, int pscnt, int *astmap)
|
||||
if (ru->ru_maxrss < rss)
|
||||
ru->ru_maxrss = rss;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -2507,13 +2507,11 @@ forwarded_statclock(int id, int pscnt, int *astmap)
|
||||
if (pscnt > 1)
|
||||
return;
|
||||
|
||||
if (p == SMP_prvspace[id].globaldata.gd_idleproc) {
|
||||
p->p_sticks++;
|
||||
if (p == SMP_prvspace[id].globaldata.gd_idleproc)
|
||||
cp_time[CP_IDLE]++;
|
||||
} else {
|
||||
p->p_sticks++;
|
||||
else
|
||||
cp_time[CP_SYS]++;
|
||||
}
|
||||
break;
|
||||
case CHECKSTATE_INTR:
|
||||
default:
|
||||
@ -2536,7 +2534,6 @@ forwarded_statclock(int id, int pscnt, int *astmap)
|
||||
p->p_iticks++;
|
||||
cp_time[CP_INTR]++;
|
||||
}
|
||||
if (p != SMP_prvspace[id].globaldata.gd_idleproc) {
|
||||
schedclock(p);
|
||||
|
||||
/* Update resource usage integrals and maximums. */
|
||||
@ -2550,7 +2547,6 @@ forwarded_statclock(int id, int pscnt, int *astmap)
|
||||
if (ru->ru_maxrss < rss)
|
||||
ru->ru_maxrss = rss;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -2507,13 +2507,11 @@ forwarded_statclock(int id, int pscnt, int *astmap)
|
||||
if (pscnt > 1)
|
||||
return;
|
||||
|
||||
if (p == SMP_prvspace[id].globaldata.gd_idleproc) {
|
||||
p->p_sticks++;
|
||||
if (p == SMP_prvspace[id].globaldata.gd_idleproc)
|
||||
cp_time[CP_IDLE]++;
|
||||
} else {
|
||||
p->p_sticks++;
|
||||
else
|
||||
cp_time[CP_SYS]++;
|
||||
}
|
||||
break;
|
||||
case CHECKSTATE_INTR:
|
||||
default:
|
||||
@ -2536,7 +2534,6 @@ forwarded_statclock(int id, int pscnt, int *astmap)
|
||||
p->p_iticks++;
|
||||
cp_time[CP_INTR]++;
|
||||
}
|
||||
if (p != SMP_prvspace[id].globaldata.gd_idleproc) {
|
||||
schedclock(p);
|
||||
|
||||
/* Update resource usage integrals and maximums. */
|
||||
@ -2550,7 +2547,6 @@ forwarded_statclock(int id, int pscnt, int *astmap)
|
||||
if (ru->ru_maxrss < rss)
|
||||
ru->ru_maxrss = rss;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -2507,13 +2507,11 @@ forwarded_statclock(int id, int pscnt, int *astmap)
|
||||
if (pscnt > 1)
|
||||
return;
|
||||
|
||||
if (p == SMP_prvspace[id].globaldata.gd_idleproc) {
|
||||
p->p_sticks++;
|
||||
if (p == SMP_prvspace[id].globaldata.gd_idleproc)
|
||||
cp_time[CP_IDLE]++;
|
||||
} else {
|
||||
p->p_sticks++;
|
||||
else
|
||||
cp_time[CP_SYS]++;
|
||||
}
|
||||
break;
|
||||
case CHECKSTATE_INTR:
|
||||
default:
|
||||
@ -2536,7 +2534,6 @@ forwarded_statclock(int id, int pscnt, int *astmap)
|
||||
p->p_iticks++;
|
||||
cp_time[CP_INTR]++;
|
||||
}
|
||||
if (p != SMP_prvspace[id].globaldata.gd_idleproc) {
|
||||
schedclock(p);
|
||||
|
||||
/* Update resource usage integrals and maximums. */
|
||||
@ -2550,7 +2547,6 @@ forwarded_statclock(int id, int pscnt, int *astmap)
|
||||
if (ru->ru_maxrss < rss)
|
||||
ru->ru_maxrss = rss;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -2507,13 +2507,11 @@ forwarded_statclock(int id, int pscnt, int *astmap)
|
||||
if (pscnt > 1)
|
||||
return;
|
||||
|
||||
if (p == SMP_prvspace[id].globaldata.gd_idleproc) {
|
||||
p->p_sticks++;
|
||||
if (p == SMP_prvspace[id].globaldata.gd_idleproc)
|
||||
cp_time[CP_IDLE]++;
|
||||
} else {
|
||||
p->p_sticks++;
|
||||
else
|
||||
cp_time[CP_SYS]++;
|
||||
}
|
||||
break;
|
||||
case CHECKSTATE_INTR:
|
||||
default:
|
||||
@ -2536,7 +2534,6 @@ forwarded_statclock(int id, int pscnt, int *astmap)
|
||||
p->p_iticks++;
|
||||
cp_time[CP_INTR]++;
|
||||
}
|
||||
if (p != SMP_prvspace[id].globaldata.gd_idleproc) {
|
||||
schedclock(p);
|
||||
|
||||
/* Update resource usage integrals and maximums. */
|
||||
@ -2550,7 +2547,6 @@ forwarded_statclock(int id, int pscnt, int *astmap)
|
||||
if (ru->ru_maxrss < rss)
|
||||
ru->ru_maxrss = rss;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -2507,13 +2507,11 @@ forwarded_statclock(int id, int pscnt, int *astmap)
|
||||
if (pscnt > 1)
|
||||
return;
|
||||
|
||||
if (p == SMP_prvspace[id].globaldata.gd_idleproc) {
|
||||
p->p_sticks++;
|
||||
if (p == SMP_prvspace[id].globaldata.gd_idleproc)
|
||||
cp_time[CP_IDLE]++;
|
||||
} else {
|
||||
p->p_sticks++;
|
||||
else
|
||||
cp_time[CP_SYS]++;
|
||||
}
|
||||
break;
|
||||
case CHECKSTATE_INTR:
|
||||
default:
|
||||
@ -2536,7 +2534,6 @@ forwarded_statclock(int id, int pscnt, int *astmap)
|
||||
p->p_iticks++;
|
||||
cp_time[CP_INTR]++;
|
||||
}
|
||||
if (p != SMP_prvspace[id].globaldata.gd_idleproc) {
|
||||
schedclock(p);
|
||||
|
||||
/* Update resource usage integrals and maximums. */
|
||||
@ -2550,7 +2547,6 @@ forwarded_statclock(int id, int pscnt, int *astmap)
|
||||
if (ru->ru_maxrss < rss)
|
||||
ru->ru_maxrss = rss;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -389,7 +389,6 @@ statclock(frame)
|
||||
}
|
||||
pscnt = psdiv;
|
||||
|
||||
if (p != idleproc) {
|
||||
schedclock(p);
|
||||
|
||||
/* Update resource usage integrals and maximums. */
|
||||
@ -403,7 +402,6 @@ statclock(frame)
|
||||
if (ru->ru_maxrss < rss)
|
||||
ru->ru_maxrss = rss;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2507,13 +2507,11 @@ forwarded_statclock(int id, int pscnt, int *astmap)
|
||||
if (pscnt > 1)
|
||||
return;
|
||||
|
||||
if (p == SMP_prvspace[id].globaldata.gd_idleproc) {
|
||||
p->p_sticks++;
|
||||
if (p == SMP_prvspace[id].globaldata.gd_idleproc)
|
||||
cp_time[CP_IDLE]++;
|
||||
} else {
|
||||
p->p_sticks++;
|
||||
else
|
||||
cp_time[CP_SYS]++;
|
||||
}
|
||||
break;
|
||||
case CHECKSTATE_INTR:
|
||||
default:
|
||||
@ -2536,7 +2534,6 @@ forwarded_statclock(int id, int pscnt, int *astmap)
|
||||
p->p_iticks++;
|
||||
cp_time[CP_INTR]++;
|
||||
}
|
||||
if (p != SMP_prvspace[id].globaldata.gd_idleproc) {
|
||||
schedclock(p);
|
||||
|
||||
/* Update resource usage integrals and maximums. */
|
||||
@ -2550,7 +2547,6 @@ forwarded_statclock(int id, int pscnt, int *astmap)
|
||||
if (ru->ru_maxrss < rss)
|
||||
ru->ru_maxrss = rss;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user