public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Tom Zanussi <tom.zanussi@linux.intel.com>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Subject: Re: [RFC][PATCH] tracing: Show available event triggers when no trigger is set
Date: Wed, 08 Jan 2014 16:50:47 +0900	[thread overview]
Message-ID: <87a9f6di94.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <20140107103548.0a84536d@gandalf.local.home> (Steven Rostedt's message of "Tue, 7 Jan 2014 10:35:48 -0500")

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);

  parent reply	other threads:[~2014-01-08  7:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07 15:35 [RFC][PATCH] tracing: Show available event triggers when no trigger is set Steven Rostedt
2014-01-07 23:34 ` Tom Zanussi
2014-01-08  2:07   ` Steven Rostedt
2014-01-08  7:50 ` Namhyung Kim [this message]
2014-01-09 22:06   ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a9f6di94.fsf@sejong.aot.lge.com \
    --to=namhyung@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=rostedt@goodmis.org \
    --cc=tom.zanussi@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox