diff options
Diffstat (limited to 'src/libs6ps')
-rw-r--r-- | src/libs6ps/s6ps_pfield.c | 36 | ||||
-rw-r--r-- | src/libs6ps/s6ps_statparse.c | 8 |
2 files changed, 40 insertions, 4 deletions
diff --git a/src/libs6ps/s6ps_pfield.c b/src/libs6ps/s6ps_pfield.c index 6d84ea0..ae589aa 100644 --- a/src/libs6ps/s6ps_pfield.c +++ b/src/libs6ps/s6ps_pfield.c @@ -25,6 +25,10 @@ static char const *const fieldheaders[PFIELD_PHAIL] = "SESSION", "TTY", "TPGID", + "MINFLT", + "CMINFLT", + "MAJFLT", + "CMAJFLT", "UTIME", "STIME", "CUTIME", @@ -64,6 +68,10 @@ static char const *const opttable[PFIELD_PHAIL] = "sess", "tty", "tpgid", + "minflt", + "cminflt", + "majflt", + "cmajflt", "utime", "stime", "cutime", @@ -257,6 +265,30 @@ static int fmt_jiffies (s6ps_auxinfo_t *aux, pscan_t *p, size_t *pos, size_t *le return 1 ; } +static int fmt_minflt (s6ps_auxinfo_t *aux, pscan_t *p, size_t *pos, size_t *len) +{ + (void)aux ; + return fmt_64(p, pos, len, p->minflt) ; +} + +static int fmt_cminflt (s6ps_auxinfo_t *aux, pscan_t *p, size_t *pos, size_t *len) +{ + (void)aux ; + return fmt_64(p, pos, len, p->cminflt) ; +} + +static int fmt_majflt (s6ps_auxinfo_t *aux, pscan_t *p, size_t *pos, size_t *len) +{ + (void)aux ; + return fmt_64(p, pos, len, p->majflt) ; +} + +static int fmt_cmajflt (s6ps_auxinfo_t *aux, pscan_t *p, size_t *pos, size_t *len) +{ + (void)aux ; + return fmt_64(p, pos, len, p->cmajflt) ; +} + static int fmt_utime (s6ps_auxinfo_t *aux, pscan_t *p, size_t *pos, size_t *len) { return fmt_jiffies(aux, p, pos, len, p->utime) ; @@ -545,6 +577,10 @@ static pfieldfmt_func_ref const pfieldfmt_table[PFIELD_PHAIL] = &fmt_session, &fmt_ttynr, &fmt_tpgid, + &fmt_minflt, + &fmt_cminflt, + &fmt_majflt, + &fmt_cmajflt, &fmt_utime, &fmt_stime, &fmt_cutime, diff --git a/src/libs6ps/s6ps_statparse.c b/src/libs6ps/s6ps_statparse.c index 8cc5a93..601e14a 100644 --- a/src/libs6ps/s6ps_statparse.c +++ b/src/libs6ps/s6ps_statparse.c @@ -116,10 +116,10 @@ int s6ps_statparse (pscan_t *p) &p->ttynr, &p->tpgid, &dummy64, - &dummy64, - &dummy64, - &dummy64, - &dummy64, + &p->minflt, + &p->cminflt, + &p->majflt, + &p->cmajflt, &p->utime, &p->stime, &p->cutime, |