lkml.org 
[lkml]   [2014]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC][PATCH] tracing: Show available event triggers when no trigger is set
Date
Hi Steve,

On Tue, 7 Jan 2014 10:35:48 -0500, Steven Rostedt wrote:
> Currently there's no way to know what triggers exist on a kernel without
> looking at the source of the kernel or randomly trying out triggers.
> Instead of creating another file in the debugfs system, simply show
> what available triggers are there when cat'ing the trigger file when
> it has no events:
>
> [root /sys/kernel/debug/tracing]# cat events/sched/sched_switch/trigger
> # Available triggers:
> # disable_event enable_event stacktrace snapshot traceoff traceon
>
> This stays consistent with other debugfs files where meta data like
> this is always proceeded with a '#' at the start of the line so that
> tools can strip these out.

[SNIP]
> + if (v == SHOW_AVAILABLE_TRIGGERS) {
> + seq_puts(m, "# Available triggers:\n");
> + seq_putc(m, '#');
> + mutex_lock(&trigger_cmd_mutex);
> + list_for_each_entry(p, &trigger_commands, list)

I guess the list_for_each_entry_reverse() will give a more intuitive
result here:

[root /sys/kernel/debug/tracing]# cat events/sched/sched_switch/trigger
# Available triggers:
# traceon traceoff snapshot stacktrace enable_event disable_event

Thanks,
Namhyung


> + seq_printf(m, " %s", p->name);
> + seq_putc(m, '\n');
> + mutex_unlock(&trigger_cmd_mutex);
> + return 0;
> + }
>
> data = list_entry(v, struct event_trigger_data, list);
> data->ops->print(m, data->ops, data);


\
 
 \ /
  Last update: 2014-01-08 09:21    [W:0.072 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site