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


Groups > linux.kernel > #1261757 > unrolled thread

[for-next][PATCH 01/13] tracing: Call on_each_cpu() when adding or removing single pids from set_event_pid

Started bySteven Rostedt <rostedt@goodmis.org>
First post2015-11-03 19:10 +0100
Last post2015-11-03 19:10 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [for-next][PATCH 01/13] tracing: Call on_each_cpu() when adding or removing single pids from  set_event_pid Steven Rostedt <rostedt@goodmis.org> - 2015-11-03 19:10 +0100

#1261757 — [for-next][PATCH 01/13] tracing: Call on_each_cpu() when adding or removing single pids from set_event_pid

FromSteven Rostedt <rostedt@goodmis.org>
Date2015-11-03 19:10 +0100
Subject[for-next][PATCH 01/13] tracing: Call on_each_cpu() when adding or removing single pids from set_event_pid
Message-ID<qqObU-6gN-15@gated-at.bofh.it>
From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

For the case where pids are already in set_event_pid, and one is added or
removed then each CPU should be checked to make sure that the new or old pid
is on or not on a CPU.

 For example:

 # echo 123 >> set_event_pid

or

 # echo '!123' >> set_event_pid

Link: http://lkml.kernel.org/r/20151030061643.GA19480@cac

Suggested-by: Jiaxing Wang <hello.wjx@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace_events.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index fb0261e90acc..292bccf3e011 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -1729,14 +1729,15 @@ ftrace_event_pid_write(struct file *filp, const char __user *ubuf,
 						 tr, INT_MAX);
 		register_trace_prio_sched_wakeup(event_filter_pid_sched_wakeup_probe_post,
 						 tr, 0);
-
-		/*
-		 * Ignoring of pids is done at task switch. But we have to
-		 * check for those tasks that are currently running.
-		 */
-		on_each_cpu(ignore_task_cpu, tr, 1);
 	}
 
+	/*
+	 * Ignoring of pids is done at task switch. But we have to
+	 * check for those tasks that are currently running.
+	 * Always do this in case a pid was appended or removed.
+	 */
+	on_each_cpu(ignore_task_cpu, tr, 1);
+
 	mutex_unlock(&event_mutex);
 
 	ret = read;
-- 
2.6.1


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web