Skip to contentSkip to conversation

tracing: remove ftrace:function TRACE_EVENT_FL_USE_CALL_FILTER flag

PATCH In review He Kuang 1 participant 3 messages Mar 3, 2015 – Mar 10, 2015

Subsystems (2)
lore
Share & tools
lore

He Kuang

author
#0 lore raw

PATCH 1/2 tracing: remove ftrace:function TRACE_EVENT_FL_USE_CALL_FILTER flag

TRACE_EVENT_FL_USE_CALL_FILTER flag in ftrace:functon event can be removed. This flag was first introduced in commit f306cc82a93d ("tracing: Update event filters for multibuffer").

Now, the only place uses this flag is ftrace:function, but the filter of ftrace:function has a different code path with events/syscalls and events/tracepoints. It uses ftrace_filter_write() and perf's ftrace_profile_set_filter() to set the filter, the functionality of file 'tracing/events/ftrace/function/filter' is bypassed in function init_pred(), in which case, neither call->filter nor file->filter is used.

So we can safely remove TRACE_EVENT_FL_USE_CALL_FILTER flag from ftrace:function events.

---
 kernel/trace/trace_export.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/trace_export.c +1 -1
index 12e2b99..174a6a7 100644
@@ -177,7 +177,7 @@ struct ftrace_event_call __used event_##call = {			\
 	},								\
 	.event.type		= etype,				\
 	.print_fmt		= print,				\
-	.flags			= TRACE_EVENT_FL_IGNORE_ENABLE | TRACE_EVENT_FL_USE_CALL_FILTER, \
+	.flags			= TRACE_EVENT_FL_IGNORE_ENABLE,		\
 };									\
 struct ftrace_event_call __used						\
 __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call;
Signature · 1 line
2.2.0.33.gc18b867
author
#1 lore raw

PATCH 2/2 tracing: remove macro TRACE_EVENT_FL_USE_CALL_FILTER and related codes

After applying the previous patch, TRACE_EVENT_FL_USE_CALL_FILTER and the codes relate to it can be removed.

---
 include/linux/ftrace_event.h       |  2 --
 kernel/trace/trace_events_filter.c | 68 ++++++--------------------------------
 2 files changed, 11 insertions(+), 59 deletions(-)
include/linux/ftrace_event.h +0 -2
index c674ee8..fd6bf18 100644
@@ -250,7 +250,6 @@ enum {
 	TRACE_EVENT_FL_NO_SET_FILTER_BIT,
 	TRACE_EVENT_FL_IGNORE_ENABLE_BIT,
 	TRACE_EVENT_FL_WAS_ENABLED_BIT,
-	TRACE_EVENT_FL_USE_CALL_FILTER_BIT,
 	TRACE_EVENT_FL_TRACEPOINT_BIT,
 };
 
@@ -272,7 +271,6 @@ enum {
 	TRACE_EVENT_FL_NO_SET_FILTER	= (1 << TRACE_EVENT_FL_NO_SET_FILTER_BIT),
 	TRACE_EVENT_FL_IGNORE_ENABLE	= (1 << TRACE_EVENT_FL_IGNORE_ENABLE_BIT),
 	TRACE_EVENT_FL_WAS_ENABLED	= (1 << TRACE_EVENT_FL_WAS_ENABLED_BIT),
-	TRACE_EVENT_FL_USE_CALL_FILTER	= (1 << TRACE_EVENT_FL_USE_CALL_FILTER_BIT),
 	TRACE_EVENT_FL_TRACEPOINT	= (1 << TRACE_EVENT_FL_TRACEPOINT_BIT),
 };
 
kernel/trace/trace_events_filter.c +11 -57

124 lines not on this page · raw message

Signature · 1 line
2.2.0.33.gc18b867
author
#2 lore raw
In reply to He Kuang

ping..

Quoted 33 lines · He Kuang

TRACE_EVENT_FL_USE_CALL_FILTER flag in ftrace:functon event can be removed. This flag was first introduced in commit f306cc82a93d ("tracing: Update event filters for multibuffer").

Now, the only place uses this flag is ftrace:function, but the filter of ftrace:function has a different code path with events/syscalls and events/tracepoints. It uses ftrace_filter_write() and perf's ftrace_profile_set_filter() to set the filter, the functionality of file 'tracing/events/ftrace/function/filter' is bypassed in function init_pred(), in which case, neither call->filter nor file->filter is used.

So we can safely remove TRACE_EVENT_FL_USE_CALL_FILTER flag from ftrace:function events.

---
  kernel/trace/trace_export.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/trace_export.c +1 -1
index 12e2b99..174a6a7 100644
@@ -177,7 +177,7 @@ struct ftrace_event_call __used event_##call = {			\
  	},								\
  	.event.type		= etype,				\
  	.print_fmt		= print,				\
-	.flags			= TRACE_EVENT_FL_IGNORE_ENABLE | TRACE_EVENT_FL_USE_CALL_FILTER, \
+	.flags			= TRACE_EVENT_FL_IGNORE_ENABLE,		\
  };									\
  struct ftrace_event_call __used						\
  __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call;