[RFC PATCH 3/5] fs/proc: Introduce /proc/all/status

Eugene Lubarsky
2020-08-10T14:59:40Z

Returns status lines for all visible processes in the existing format.

Signed-off-by: Eugene Lubarsky <elubarsky.linux@gmail.com>
---
fs/proc/base.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 8396a38ba7d2..5982fd43dd21 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -3897,6 +3897,14 @@ static int proc_all_statm(struct seq_file *m, void *v)
}

+
+static int proc_all_status(struct seq_file *m, void *v)
+{
+ struct all_iter *iter = (struct all_iter *) v;
+
+ return proc_pid_status(m, iter->ns, iter->tgid_iter.task->thread_pid, iter->tgid_iter.task);
+}
+
#define PROC_ALL_OPS(NAME) static const struct seq_operations proc_all_##NAME##_ops = { \
.start = proc_all_start, \
.next = proc_all_next, \
@@ -3906,6 +3914,7 @@ static int proc_all_statm(struct seq_file *m, void *v)

PROC_ALL_OPS(stat);
PROC_ALL_OPS(statm);
+PROC_ALL_OPS(status);

#define PROC_ALL_CREATE(NAME) \
do { \
@@ -3922,4 +3931,5 @@ void __init proc_all_init(void)

PROC_ALL_CREATE(stat);
PROC_ALL_CREATE(statm);
+ PROC_ALL_CREATE(status);
}
--
2.25.1