lkml.org 
[lkml]   [2013]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH 5/6] tracing: Introduce remove_event_file_dir()
From
Date
On Tue, 2013-07-23 at 22:59 +0200, Oleg Nesterov wrote:

> static void remove_event_from_tracers(struct ftrace_event_call *call)
> {
> struct ftrace_event_file *file;
> struct trace_array *tr;
>
> do_for_each_event_file_safe(tr, file) {
> -
> - if (file->event_call != call)
> - continue;
> -
> - list_del(&file->list);
> - debugfs_remove_recursive(file->dir);
> - remove_subsystem(file->system);
> - kmem_cache_free(file_cachep, file);
> -
> - /*
> - * The do_for_each_event_file_safe() is
> - * a double loop. After finding the call for this
> - * trace_array, we use break to jump to the next
> - * trace_array.
> - */
> - break;
> + if (file->event_call == call) {

I don't care if you do it this way because it's just two lines, but the
reason I do the:

if (file->event_call != call)
continue;

is to keep the indentation down.

-- Steve

> + remove_event_file_dir(file);
> + /*
> + * The do_for_each_event_file_safe() is
> + * a double loop. After finding the call for this
> + * trace_array, we use break to jump to the next
> + * trace_array.
> + */
> + break;
> + }
> } while_for_each_event_file();
> }
>
> @@ -2298,12 +2300,8 @@ __trace_remove_event_dirs(struct trace_array *tr)
> {
> struct ftrace_event_file *file, *next;
>
> - list_for_each_entry_safe(file, next, &tr->events, list) {
> - list_del(&file->list);
> - debugfs_remove_recursive(file->dir);
> - remove_subsystem(file->system);
> - kmem_cache_free(file_cachep, file);
> - }
> + list_for_each_entry_safe(file, next, &tr->events, list)
> + remove_event_file_dir(file);
> }
>
> static void




\
 
 \ /
  Last update: 2013-07-24 22:41    [W:0.121 / U:43.120 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site