Skip to contentSkip to conversation

trace-cmd record: Have --module affect function filters listed after it

PATCH New Steven Rostedt 1 participant 1 message Jul 31, 2017 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trace-cmd record: Have --module affect function filters listed after it

When the --module option is used, have it affect the remaining filters that come after it. Keep the old behavior that no other filter is needed if only filtering all modules in function filter.

'--module snd' is equivalent to '-l :mod:snd'

'--module snd -l "*jack*"' is equivalent to '-l "*jack*:mod:snd"'

'--module snd -n "*"' is equivalent to '-n :mod:snd'

---
 Documentation/trace-cmd-record.1.txt |  9 ++++++-
 trace-local.h                        |  3 ++-
 trace-record.c                       | 52 +++++++++++++++++++++++-------------
 3 files changed, 44 insertions(+), 20 deletions(-)
Documentation/trace-cmd-record.1.txt +8 -1
index c1228bd..ca3cbfe 100644
@@ -274,8 +274,15 @@ OPTIONS
 
 *--module* 'module'::
     Filter a module's name in function tracing. It is equivalent to adding
+    ':mod:module' after all other functions being filtered. If no other function
+    filter is listed, then all modules functions will be filtered in the filter.
+
+    '--module snd'  is equivalent to  '-l :mod:snd'
+
+    '--module snd -l "*jack*"' is equivalent to '-l "*jack*:mod:snd"'
+
+    '--module snd -n "*"' is equivalent to '-n :mod:snd'
 
-    *-l :mod:module*
 
 *--profile*::
     With the *--profile* option, "trace-cmd" will enable tracing that can
trace-local.h +2 -1
index ee2f0c9..157b2c6 100644
@@ -147,6 +147,7 @@ char *strstrip(char *str);
 struct func_list {
 	struct func_list *next;
 	const char *func;
+	const char *mod;
 };
 
 struct buffer_instance {
@@ -161,9 +162,9 @@ struct buffer_instance {
 	struct event_list	*sched_wakeup_new_event;
 
 	const char		*plugin;
+	char			*filter_mod;
 	struct func_list	*filter_funcs;
 	struct func_list	*notrace_funcs;
-	struct func_list	*filter_mods;
 
 	const char		*clock;
 
trace-record.c +34 -18

134 lines not on this page · raw message

Signature · 1 line
2.9.3