summaryrefslogtreecommitdiff
path: root/src/libs6ps
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-09-07 23:48:17 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2023-09-07 23:48:49 +0000
commite8c7ac9a7990d41daada0f2a3b49ba7030051b49 (patch)
treed44f4fdc78f97bc350b639b7a3fa37947241d88d /src/libs6ps
parent74266756a204f730fef84d30f8ad5ba5627a4921 (diff)
downloads6-linux-utils-e8c7ac9a7990d41daada0f2a3b49ba7030051b49.tar.xz
Prepare for 2.6.2.0, add minflt/majflt to s6-ps
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/libs6ps')
-rw-r--r--src/libs6ps/s6ps_pfield.c36
-rw-r--r--src/libs6ps/s6ps_statparse.c8
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,