lkml.org 
[lkml]   [2014]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 7/7] tracing: change filter_free_subsystem_*() to check ->subsystem rather then ->name
On Fri, 11 Jul 2014 21:06:55 +0200
Oleg Nesterov <oleg@redhat.com> wrote:

> filter_free_subsystem_preds() and filter_free_subsystem_filters()
> can rely on file->system->subsystem and avoid strcmp().
>
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
> ---
> kernel/trace/trace_events_filter.c | 9 ++-------
> 1 files changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
> index 54a125c..59655bc 100644
> --- a/kernel/trace/trace_events_filter.c
> +++ b/kernel/trace/trace_events_filter.c
> @@ -846,13 +846,10 @@ static void filter_free_subsystem_preds(struct event_subsystem *system,
> struct trace_array *tr)
> {
> struct ftrace_event_file *file;
> - struct ftrace_event_call *call;
>
> list_for_each_entry(file, &tr->events, list) {
> - call = file->event_call;
> - if (strcmp(call->class->system, system->name) != 0)
> + if (file->system->subsystem != system)

This is only used on one place. What about just passing in dir instead
of system and then do:

if (file->system != dir)
> continue;

-- Steve

> -
> __remove_filter(file);
> }
> }
> @@ -874,11 +871,9 @@ static void filter_free_subsystem_filters(struct event_subsystem *system,
> struct trace_array *tr)
> {
> struct ftrace_event_file *file;
> - struct ftrace_event_call *call;
>
> list_for_each_entry(file, &tr->events, list) {
> - call = file->event_call;
> - if (strcmp(call->class->system, system->name) != 0)
> + if (file->system->subsystem != system)
> continue;
> __free_subsystem_filter(file);
> }



\
 
 \ /
  Last update: 2014-07-14 23:41    [W:1.678 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site