linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Tom Zanussi <tom.zanussi@linux.intel.com>
Cc: masami.hiramatsu.pt@hitachi.com, namhyung@kernel.org,
	josh@joshtriplett.org, andi@firstfloor.org,
	mathieu.desnoyers@efficios.com, peterz@infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v15 10/23] tracing: Add hist trigger 'execname' modifier
Date: Wed, 2 Mar 2016 12:39:31 -0500	[thread overview]
Message-ID: <20160302123931.37f28d4a@gandalf.local.home> (raw)
In-Reply-To: <733e60a8acc79f777502cbe6c98d5abd2c33a17e.1456501855.git.tom.zanussi@linux.intel.com>

On Fri, 26 Feb 2016 10:01:13 -0600
Tom Zanussi <tom.zanussi@linux.intel.com> wrote:


> +static void hist_trigger_elt_copy(struct tracing_map_elt *to,
> +				  struct tracing_map_elt *from)
> +{
> +	char *comm_from = from->private_data;
> +	char *comm_to = to->private_data;
> +
> +	if (comm_from)
> +		memcpy(comm_to, comm_from, TASK_COMM_LEN + 1);
> +}
> +
> +static void hist_trigger_elt_init(struct tracing_map_elt *elt)
> +{
> +	char *comm = elt->private_data;
> +
> +	if (comm)
> +		save_comm(comm, current);
> +}
> +
> +static const struct tracing_map_ops hist_trigger_ops = {
> +	.elt_alloc	= hist_trigger_elt_alloc,
> +	.elt_copy	= hist_trigger_elt_copy,
> +	.elt_free	= hist_trigger_elt_free,
> +	.elt_init	= hist_trigger_elt_init,

These are only used for saving or displaying comm. Wouldn't adding that
in the name be better. Otherwise it looks like they are more generic. I
find that dangerous, especially since they just assume that the
private_data is a string.

What about hist_trigger_elt_comm_*

?

-- Steve

> +};
> +
>  static void destroy_hist_field(struct hist_field *hist_field)
>  {
>  	kfree(hist_field);
> @@ -399,6 +467,9 @@ static int create_key_field(struct hist_trigger_data *hist_data,
>  			flags |= HIST_FIELD_FL_SYM;
>  		else if (strcmp(field_str, "sym-offset") == 0)
>  			flags |= HIST_FIELD_FL_SYM_OFFSET;
> +		else if ((strcmp(field_str, "execname") == 0) &&
> +			 (strcmp(field_name, "common_pid") == 0))
> +			flags |= HIST_FIELD_FL_EXECNAME;
>  		else {
>  			ret = -EINVAL;
>  			goto out;

  reply	other threads:[~2016-03-02 17:39 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26 16:01 [PATCH 00/23] tracing: 'hist' triggers Tom Zanussi
2016-02-26 16:01 ` [PATCH v15 01/23] tracing: Update some tracing_map constants and comments Tom Zanussi
2016-02-26 16:01 ` [PATCH v15 02/23] tracing: Add 'hist' event trigger command Tom Zanussi
2016-03-02 14:33   ` Steven Rostedt
2016-02-26 16:01 ` [PATCH v15 03/23] tracing: Add hist trigger support for multiple values ('vals=' param) Tom Zanussi
2016-03-02 14:38   ` Steven Rostedt
2016-02-26 16:01 ` [PATCH v15 04/23] tracing: Add hist trigger support for compound keys Tom Zanussi
2016-02-26 16:01 ` [PATCH v15 05/23] tracing: Add hist trigger support for user-defined sorting ('sort=' param) Tom Zanussi
2016-02-26 16:01 ` [PATCH v15 06/23] tracing: Add hist trigger support for pausing and continuing a trace Tom Zanussi
2016-02-26 16:01 ` [PATCH v15 07/23] tracing: Add hist trigger support for clearing " Tom Zanussi
2016-02-26 16:01 ` [PATCH v15 08/23] tracing: Add hist trigger 'hex' modifier for displaying numeric fields Tom Zanussi
2016-02-26 16:01 ` [PATCH v15 09/23] tracing: Add hist trigger 'sym' and 'sym-offset' modifiers Tom Zanussi
2016-02-26 16:01 ` [PATCH v15 10/23] tracing: Add hist trigger 'execname' modifier Tom Zanussi
2016-03-02 17:39   ` Steven Rostedt [this message]
2016-03-02 19:51     ` Tom Zanussi
2016-02-26 16:01 ` [PATCH v15 11/23] tracing: Add hist trigger 'syscall' modifier Tom Zanussi
2016-02-26 16:01 ` [PATCH v15 12/23] tracing: Add hist trigger support for stacktraces as keys Tom Zanussi
2016-02-26 16:01 ` [PATCH v15 13/23] tracing: Support string type key properly Tom Zanussi
2016-02-26 16:01 ` [PATCH v15 14/23] tracing: Remove restriction on string position in hist trigger keys Tom Zanussi
2016-02-26 16:01 ` [PATCH v15 15/23] tracing: Add enable_hist/disable_hist triggers Tom Zanussi
2016-02-26 16:01 ` [PATCH v15 16/23] tracing: Add 'hist' trigger Documentation Tom Zanussi
2016-02-26 16:01 ` [PATCH v15 17/23] tracing: Add support for multiple hist triggers per event Tom Zanussi
2016-02-26 16:01 ` [PATCH v15 18/23] tracing: Add support for named triggers Tom Zanussi
2016-02-26 16:01 ` [PATCH v15 19/23] tracing: Add support for named hist triggers Tom Zanussi
2016-02-26 16:01 ` [PATCH v15 20/23] kselftests/ftrace : Add event trigger testcases Tom Zanussi
2016-02-26 16:01 ` [PATCH v15 21/23] kselftests/ftrace: Add hist " Tom Zanussi
2016-02-26 16:01 ` [PATCH v15 22/23] tracing: Add hist trigger 'log2' modifier Tom Zanussi
2016-02-26 16:01 ` [PATCH v15 23/23] kselftests/ftrace: Add a test for log2 modifier of hist trigger Tom Zanussi

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=20160302123931.37f28d4a@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=andi@firstfloor.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.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;
as well as URLs for NNTP newsgroup(s).