mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-01 08:27:59 +00:00
- Catch up to proc flag changes.
This commit is contained in:
parent
168666be74
commit
b939335607
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=71569
@ -123,19 +123,23 @@ procfs_dostatus(curp, p, pfs, uio)
|
||||
DOCHECK();
|
||||
}
|
||||
|
||||
if (p->p_flag & P_INMEM) {
|
||||
mtx_enter(&sched_lock, MTX_SPIN);
|
||||
if (p->p_sflag & PS_INMEM) {
|
||||
struct timeval ut, st;
|
||||
|
||||
calcru(p, &ut, &st, (struct timeval *) NULL);
|
||||
mtx_exit(&sched_lock, MTX_SPIN);
|
||||
ps += snprintf(ps, psbuf + sizeof(psbuf) - ps,
|
||||
" %ld,%ld %ld,%ld %ld,%ld",
|
||||
p->p_stats->p_start.tv_sec,
|
||||
p->p_stats->p_start.tv_usec,
|
||||
ut.tv_sec, ut.tv_usec,
|
||||
st.tv_sec, st.tv_usec);
|
||||
} else
|
||||
} else {
|
||||
mtx_exit(&sched_lock, MTX_SPIN);
|
||||
ps += snprintf(ps, psbuf + sizeof(psbuf) - ps,
|
||||
" -1,-1 -1,-1 -1,-1");
|
||||
}
|
||||
DOCHECK();
|
||||
|
||||
ps += snprintf(ps, psbuf + sizeof(psbuf) - ps, " %s",
|
||||
|
@ -123,19 +123,23 @@ procfs_dostatus(curp, p, pfs, uio)
|
||||
DOCHECK();
|
||||
}
|
||||
|
||||
if (p->p_flag & P_INMEM) {
|
||||
mtx_enter(&sched_lock, MTX_SPIN);
|
||||
if (p->p_sflag & PS_INMEM) {
|
||||
struct timeval ut, st;
|
||||
|
||||
calcru(p, &ut, &st, (struct timeval *) NULL);
|
||||
mtx_exit(&sched_lock, MTX_SPIN);
|
||||
ps += snprintf(ps, psbuf + sizeof(psbuf) - ps,
|
||||
" %ld,%ld %ld,%ld %ld,%ld",
|
||||
p->p_stats->p_start.tv_sec,
|
||||
p->p_stats->p_start.tv_usec,
|
||||
ut.tv_sec, ut.tv_usec,
|
||||
st.tv_sec, st.tv_usec);
|
||||
} else
|
||||
} else {
|
||||
mtx_exit(&sched_lock, MTX_SPIN);
|
||||
ps += snprintf(ps, psbuf + sizeof(psbuf) - ps,
|
||||
" -1,-1 -1,-1 -1,-1");
|
||||
}
|
||||
DOCHECK();
|
||||
|
||||
ps += snprintf(ps, psbuf + sizeof(psbuf) - ps, " %s",
|
||||
|
@ -854,13 +854,15 @@ RetryFault:;
|
||||
vm_page_activate(fs.m);
|
||||
}
|
||||
|
||||
if (curproc && (curproc->p_flag & P_INMEM) && curproc->p_stats) {
|
||||
mtx_enter(&sched_lock, MTX_SPIN);
|
||||
if (curproc && (curproc->p_sflag & PS_INMEM) && curproc->p_stats) {
|
||||
if (hardfault) {
|
||||
curproc->p_stats->p_ru.ru_majflt++;
|
||||
} else {
|
||||
curproc->p_stats->p_ru.ru_minflt++;
|
||||
}
|
||||
}
|
||||
mtx_exit(&sched_lock, MTX_SPIN);
|
||||
|
||||
/*
|
||||
* Unlock everything, and return
|
||||
|
Loading…
Reference in New Issue
Block a user