public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] tracing: introduce for_each_token macro
@ 2010-11-09  9:12 Yuanhan Liu
  2010-11-09  9:12 ` [PATCH 2/4] tracing: introduce trace_set_clr_module_event Yuanhan Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Yuanhan Liu @ 2010-11-09  9:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: rostedt, fweisbec, mingo, chris, Yuanhan Liu

Introduce for_each_token macro to parse the trace event list.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
---
 kernel/trace/trace_events.c |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 0725eea..fe15b7c 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -1218,6 +1218,11 @@ void trace_remove_event_call(struct ftrace_event_call *call)
 	mutex_unlock(&event_mutex);
 }
 
+#define for_each_token(token, buf) 				\
+	for (token = strsep(&buf, ","); 			\
+	     token && *token; 					\
+	     token = strsep(&buf, ","))
+
 #define for_each_event(event, start, end)			\
 	for (event = start;					\
 	     (unsigned long)event < (unsigned long)end;		\
@@ -1430,14 +1435,7 @@ static __init int event_trace_init(void)
 				       &ftrace_event_format_fops);
 	}
 
-	while (true) {
-		token = strsep(&buf, ",");
-
-		if (!token)
-			break;
-		if (!*token)
-			continue;
-
+	for_each_token(token, buf) {
 		ret = ftrace_set_clr_event(token, 1);
 		if (ret)
 			pr_warning("Failed to enable trace event: %s\n", token);
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2010-11-11  1:05 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-09  9:12 [PATCH 1/4] tracing: introduce for_each_token macro Yuanhan Liu
2010-11-09  9:12 ` [PATCH 2/4] tracing: introduce trace_set_clr_module_event Yuanhan Liu
2010-11-09 11:23   ` Yuanhan Liu
2010-11-09 11:27     ` Chris Wilson
2010-11-09 13:20       ` Yuanhan Liu
2010-11-09 13:31         ` Chris Wilson
2010-11-09 13:56           ` Steven Rostedt
2010-11-09 14:06             ` Yuanhan Liu
2010-11-09 13:59           ` Yuanhan Liu
2010-11-09 14:01             ` Steven Rostedt
2010-11-09 14:11           ` [PATCH] Delegate unknown module parameters to interested parties Chris Wilson
2010-11-09 14:39             ` Steven Rostedt
2010-11-10  5:51               ` Rusty Russell
2010-11-10 13:56                 ` Steven Rostedt
2010-11-11  0:35                   ` Rusty Russell
2010-11-11  1:05                     ` Steven Rostedt
2010-11-09  9:12 ` [PATCH 3/4] tracing: update trace-events-sample.c Yuanhan Liu
2010-11-09  9:12 ` [PATCH 4/4] tracing: update the trace/events.txt documentation Yuanhan Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox