Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1376330

[PATCH 09/15] task_diag: add a flag to mark incomplete messages

From Andrey Vagin <avagin@openvz.org>
Newsgroups linux.kernel
Subject [PATCH 09/15] task_diag: add a flag to mark incomplete messages
Date 2016-04-12 01:40 +0200
Message-ID <rmTAZ-5Gv-1@gated-at.bofh.it> (permalink)
References <rmTAZ-5Gv-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


If all information about a process don't fit in a message, it's marked
by the TASK_DIAG_FLAG_CONT flag and the next message will describe the
same process.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
---
 fs/proc/task_diag.c            | 3 +++
 include/uapi/linux/task_diag.h | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/fs/proc/task_diag.c b/fs/proc/task_diag.c
index 00db32d..cd10374 100644
--- a/fs/proc/task_diag.c
+++ b/fs/proc/task_diag.c
@@ -415,6 +415,7 @@ static int task_diag_fill(struct task_struct *tsk, struct sk_buff *skb,
 	msg = nlmsg_data(nlh);
 	msg->pid  = task_pid_nr_ns(tsk, pidns);
 	msg->tgid = task_tgid_nr_ns(tsk, pidns);
+	msg->flags |= TASK_DIAG_FLAG_CONT;
 
 	if (show_flags & TASK_DIAG_SHOW_BASE) {
 		if (i >= n)
@@ -450,6 +451,8 @@ static int task_diag_fill(struct task_struct *tsk, struct sk_buff *skb,
 		i++;
 	}
 
+	msg->flags &= ~TASK_DIAG_FLAG_CONT;
+
 	nlmsg_end(skb, nlh);
 	if (cb)
 		cb->attr = 0;
diff --git a/include/uapi/linux/task_diag.h b/include/uapi/linux/task_diag.h
index 8bccd02..e967c5b 100644
--- a/include/uapi/linux/task_diag.h
+++ b/include/uapi/linux/task_diag.h
@@ -13,6 +13,8 @@ struct task_diag_msg {
 	__u32 flags;
 };
 
+#define TASK_DIAG_FLAG_CONT 0x00000001
+
 enum {
 	TASK_DIAG_BASE	= 0,
 	TASK_DIAG_CRED,
-- 
2.5.5

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 09/15] task_diag: add a flag to mark incomplete messages Andrey Vagin <avagin@openvz.org> - 2016-04-12 01:40 +0200

csiph-web