Fixed some comments in statclock(). The previous commit made it clearer
that one comment was attached to null code.
This commit is contained in:
parent
a3e4a9264f
commit
61f11af11f
@ -361,7 +361,9 @@ stopprofclock(p)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Statistics clock. Grab profile sample, and if divider reaches 0,
|
* Statistics clock. Grab profile sample, and if divider reaches 0,
|
||||||
* do process and kernel statistics.
|
* do process and kernel statistics. Most of the statistics are only
|
||||||
|
* used by user-level statistics programs. The main exceptions are
|
||||||
|
* p->p_uticks, p->p_sticks, p->p_iticks, and p->p_estcpu.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
statclock(frame)
|
statclock(frame)
|
||||||
@ -378,6 +380,10 @@ statclock(frame)
|
|||||||
struct vmspace *vm;
|
struct vmspace *vm;
|
||||||
|
|
||||||
if (curproc != NULL && CLKF_USERMODE(frame)) {
|
if (curproc != NULL && CLKF_USERMODE(frame)) {
|
||||||
|
/*
|
||||||
|
* Came from user mode; CPU was in user state.
|
||||||
|
* If this process is being profiled, record the tick.
|
||||||
|
*/
|
||||||
p = curproc;
|
p = curproc;
|
||||||
if (p->p_flag & P_PROFIL)
|
if (p->p_flag & P_PROFIL)
|
||||||
addupc_intr(p, CLKF_PC(frame), 1);
|
addupc_intr(p, CLKF_PC(frame), 1);
|
||||||
@ -388,8 +394,7 @@ statclock(frame)
|
|||||||
if (--pscnt > 0)
|
if (--pscnt > 0)
|
||||||
return;
|
return;
|
||||||
/*
|
/*
|
||||||
* Came from user mode; CPU was in user state.
|
* Charge the time as appropriate.
|
||||||
* If this process is being profiled record the tick.
|
|
||||||
*/
|
*/
|
||||||
p->p_uticks++;
|
p->p_uticks++;
|
||||||
if (p->p_nice > NZERO)
|
if (p->p_nice > NZERO)
|
||||||
@ -441,11 +446,6 @@ statclock(frame)
|
|||||||
}
|
}
|
||||||
pscnt = psdiv;
|
pscnt = psdiv;
|
||||||
|
|
||||||
/*
|
|
||||||
* We maintain statistics shown by user-level statistics
|
|
||||||
* programs: the amount of time in each cpu state.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (p != NULL) {
|
if (p != NULL) {
|
||||||
schedclock(p);
|
schedclock(p);
|
||||||
|
|
||||||
|
@ -361,7 +361,9 @@ stopprofclock(p)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Statistics clock. Grab profile sample, and if divider reaches 0,
|
* Statistics clock. Grab profile sample, and if divider reaches 0,
|
||||||
* do process and kernel statistics.
|
* do process and kernel statistics. Most of the statistics are only
|
||||||
|
* used by user-level statistics programs. The main exceptions are
|
||||||
|
* p->p_uticks, p->p_sticks, p->p_iticks, and p->p_estcpu.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
statclock(frame)
|
statclock(frame)
|
||||||
@ -378,6 +380,10 @@ statclock(frame)
|
|||||||
struct vmspace *vm;
|
struct vmspace *vm;
|
||||||
|
|
||||||
if (curproc != NULL && CLKF_USERMODE(frame)) {
|
if (curproc != NULL && CLKF_USERMODE(frame)) {
|
||||||
|
/*
|
||||||
|
* Came from user mode; CPU was in user state.
|
||||||
|
* If this process is being profiled, record the tick.
|
||||||
|
*/
|
||||||
p = curproc;
|
p = curproc;
|
||||||
if (p->p_flag & P_PROFIL)
|
if (p->p_flag & P_PROFIL)
|
||||||
addupc_intr(p, CLKF_PC(frame), 1);
|
addupc_intr(p, CLKF_PC(frame), 1);
|
||||||
@ -388,8 +394,7 @@ statclock(frame)
|
|||||||
if (--pscnt > 0)
|
if (--pscnt > 0)
|
||||||
return;
|
return;
|
||||||
/*
|
/*
|
||||||
* Came from user mode; CPU was in user state.
|
* Charge the time as appropriate.
|
||||||
* If this process is being profiled record the tick.
|
|
||||||
*/
|
*/
|
||||||
p->p_uticks++;
|
p->p_uticks++;
|
||||||
if (p->p_nice > NZERO)
|
if (p->p_nice > NZERO)
|
||||||
@ -441,11 +446,6 @@ statclock(frame)
|
|||||||
}
|
}
|
||||||
pscnt = psdiv;
|
pscnt = psdiv;
|
||||||
|
|
||||||
/*
|
|
||||||
* We maintain statistics shown by user-level statistics
|
|
||||||
* programs: the amount of time in each cpu state.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (p != NULL) {
|
if (p != NULL) {
|
||||||
schedclock(p);
|
schedclock(p);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user