All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] tracing: remove ftrace:function TRACE_EVENT_FL_USE_CALL_FILTER flag
@ 2015-03-03  7:21 He Kuang
  2015-03-03  7:21 ` [PATCH 2/2] tracing: remove macro TRACE_EVENT_FL_USE_CALL_FILTER and related codes He Kuang
  2015-03-10  3:46 ` [PATCH 1/2] tracing: remove ftrace:function TRACE_EVENT_FL_USE_CALL_FILTER flag He Kuang
  0 siblings, 2 replies; 4+ messages in thread
From: He Kuang @ 2015-03-03  7:21 UTC (permalink / raw)
  To: tom.zanussi, rostedt; +Cc: mingo, wangnan0, linux-kernel

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.

Signed-off-by: He Kuang <hekuang@huawei.com>
---
 kernel/trace/trace_export.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c
index 12e2b99..174a6a7 100644
--- a/kernel/trace/trace_export.c
+++ b/kernel/trace/trace_export.c
@@ -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;
-- 
2.2.0.33.gc18b867


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

* [PATCH 2/2] tracing: remove macro TRACE_EVENT_FL_USE_CALL_FILTER and related codes
  2015-03-03  7:21 [PATCH 1/2] tracing: remove ftrace:function TRACE_EVENT_FL_USE_CALL_FILTER flag He Kuang
@ 2015-03-03  7:21 ` He Kuang
  2015-03-10  3:46 ` [PATCH 1/2] tracing: remove ftrace:function TRACE_EVENT_FL_USE_CALL_FILTER flag He Kuang
  1 sibling, 0 replies; 4+ messages in thread
From: He Kuang @ 2015-03-03  7:21 UTC (permalink / raw)
  To: tom.zanussi, rostedt; +Cc: mingo, wangnan0, linux-kernel

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

Signed-off-by: He Kuang <hekuang@huawei.com>
---
 include/linux/ftrace_event.h       |  2 --
 kernel/trace/trace_events_filter.c | 68 ++++++--------------------------------
 2 files changed, 11 insertions(+), 59 deletions(-)

diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index c674ee8..fd6bf18 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -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),
 };
 
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index ced69da..cc61e0b 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -645,10 +645,7 @@ static void append_filter_err(struct filter_parse_state *ps,
 
 static inline struct event_filter *event_filter(struct ftrace_event_file *file)
 {
-	if (file->event_call->flags & TRACE_EVENT_FL_USE_CALL_FILTER)
-		return file->event_call->filter;
-	else
-		return file->filter;
+	return file->filter;
 }
 
 /* caller must hold event_mutex */
@@ -782,12 +779,7 @@ static void __free_preds(struct event_filter *filter)
 
 static void filter_disable(struct ftrace_event_file *file)
 {
-	struct ftrace_event_call *call = file->event_call;
-
-	if (call->flags & TRACE_EVENT_FL_USE_CALL_FILTER)
-		call->flags &= ~TRACE_EVENT_FL_FILTERED;
-	else
-		file->flags &= ~FTRACE_EVENT_FL_FILTERED;
+	file->flags &= ~FTRACE_EVENT_FL_FILTERED;
 }
 
 static void __free_filter(struct event_filter *filter)
@@ -839,13 +831,8 @@ static int __alloc_preds(struct event_filter *filter, int n_preds)
 
 static inline void __remove_filter(struct ftrace_event_file *file)
 {
-	struct ftrace_event_call *call = file->event_call;
-
 	filter_disable(file);
-	if (call->flags & TRACE_EVENT_FL_USE_CALL_FILTER)
-		remove_filter_string(call->filter);
-	else
-		remove_filter_string(file->filter);
+	remove_filter_string(file->filter);
 }
 
 static void filter_free_subsystem_preds(struct ftrace_subsystem_dir *dir,
@@ -862,15 +849,8 @@ static void filter_free_subsystem_preds(struct ftrace_subsystem_dir *dir,
 
 static inline void __free_subsystem_filter(struct ftrace_event_file *file)
 {
-	struct ftrace_event_call *call = file->event_call;
-
-	if (call->flags & TRACE_EVENT_FL_USE_CALL_FILTER) {
-		__free_filter(call->filter);
-		call->filter = NULL;
-	} else {
-		__free_filter(file->filter);
-		file->filter = NULL;
-	}
+	__free_filter(file->filter);
+	file->filter = NULL;
 }
 
 static void filter_free_subsystem_filters(struct ftrace_subsystem_dir *dir,
@@ -1664,55 +1644,30 @@ fail:
 
 static inline void event_set_filtered_flag(struct ftrace_event_file *file)
 {
-	struct ftrace_event_call *call = file->event_call;
-
-	if (call->flags & TRACE_EVENT_FL_USE_CALL_FILTER)
-		call->flags |= TRACE_EVENT_FL_FILTERED;
-	else
-		file->flags |= FTRACE_EVENT_FL_FILTERED;
+	file->flags |= FTRACE_EVENT_FL_FILTERED;
 }
 
 static inline void event_set_filter(struct ftrace_event_file *file,
 				    struct event_filter *filter)
 {
-	struct ftrace_event_call *call = file->event_call;
-
-	if (call->flags & TRACE_EVENT_FL_USE_CALL_FILTER)
-		rcu_assign_pointer(call->filter, filter);
-	else
-		rcu_assign_pointer(file->filter, filter);
+	rcu_assign_pointer(file->filter, filter);
 }
 
 static inline void event_clear_filter(struct ftrace_event_file *file)
 {
-	struct ftrace_event_call *call = file->event_call;
-
-	if (call->flags & TRACE_EVENT_FL_USE_CALL_FILTER)
-		RCU_INIT_POINTER(call->filter, NULL);
-	else
-		RCU_INIT_POINTER(file->filter, NULL);
+	RCU_INIT_POINTER(file->filter, NULL);
 }
 
 static inline void
 event_set_no_set_filter_flag(struct ftrace_event_file *file)
 {
-	struct ftrace_event_call *call = file->event_call;
-
-	if (call->flags & TRACE_EVENT_FL_USE_CALL_FILTER)
-		call->flags |= TRACE_EVENT_FL_NO_SET_FILTER;
-	else
-		file->flags |= FTRACE_EVENT_FL_NO_SET_FILTER;
+	file->flags |= FTRACE_EVENT_FL_NO_SET_FILTER;
 }
 
 static inline void
 event_clear_no_set_filter_flag(struct ftrace_event_file *file)
 {
-	struct ftrace_event_call *call = file->event_call;
-
-	if (call->flags & TRACE_EVENT_FL_USE_CALL_FILTER)
-		call->flags &= ~TRACE_EVENT_FL_NO_SET_FILTER;
-	else
-		file->flags &= ~FTRACE_EVENT_FL_NO_SET_FILTER;
+	file->flags &= ~FTRACE_EVENT_FL_NO_SET_FILTER;
 }
 
 static inline bool
@@ -1723,8 +1678,7 @@ event_no_set_filter_flag(struct ftrace_event_file *file)
 	if (file->flags & FTRACE_EVENT_FL_NO_SET_FILTER)
 		return true;
 
-	if ((call->flags & TRACE_EVENT_FL_USE_CALL_FILTER) &&
-	    (call->flags & TRACE_EVENT_FL_NO_SET_FILTER))
+	if (call->flags & TRACE_EVENT_FL_NO_SET_FILTER)
 		return true;
 
 	return false;
-- 
2.2.0.33.gc18b867


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

* Re: [PATCH 1/2] tracing: remove ftrace:function TRACE_EVENT_FL_USE_CALL_FILTER flag
  2015-03-03  7:21 [PATCH 1/2] tracing: remove ftrace:function TRACE_EVENT_FL_USE_CALL_FILTER flag He Kuang
  2015-03-03  7:21 ` [PATCH 2/2] tracing: remove macro TRACE_EVENT_FL_USE_CALL_FILTER and related codes He Kuang
@ 2015-03-10  3:46 ` He Kuang
  1 sibling, 0 replies; 4+ messages in thread
From: He Kuang @ 2015-03-10  3:46 UTC (permalink / raw)
  To: tom.zanussi, rostedt, mingo; +Cc: wangnan0, linux-kernel

ping..
On 2015/3/3 15:21, He Kuang wrote:
> 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.
>
> Signed-off-by: He Kuang <hekuang@huawei.com>
> ---
>   kernel/trace/trace_export.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c
> index 12e2b99..174a6a7 100644
> --- a/kernel/trace/trace_export.c
> +++ b/kernel/trace/trace_export.c
> @@ -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;



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

* Re: [PATCH 1/2] tracing: remove ftrace:function TRACE_EVENT_FL_USE_CALL_FILTER flag
@ 2015-03-04  7:17 Alexei Starovoitov
  0 siblings, 0 replies; 4+ messages in thread
From: Alexei Starovoitov @ 2015-03-04  7:17 UTC (permalink / raw)
  To: He Kuang; +Cc: Tom Zanussi, Steven Rostedt, Ingo Molnar, wangnan0, linux-kernel

On Mon, Mar 2, 2015 at 11:21 PM, He Kuang <hekuang@huawei.com> wrote:
> 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.

every time I looked at this piece of code was wondering
about the same. So intent definitely looks good to me.
Thanks for cleaning it up.

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

end of thread, other threads:[~2015-03-10  3:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-03  7:21 [PATCH 1/2] tracing: remove ftrace:function TRACE_EVENT_FL_USE_CALL_FILTER flag He Kuang
2015-03-03  7:21 ` [PATCH 2/2] tracing: remove macro TRACE_EVENT_FL_USE_CALL_FILTER and related codes He Kuang
2015-03-10  3:46 ` [PATCH 1/2] tracing: remove ftrace:function TRACE_EVENT_FL_USE_CALL_FILTER flag He Kuang
2015-03-04  7:17 Alexei Starovoitov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.