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 03/23] tracing: Add hist trigger support for multiple values ('vals=' param)
Date: Wed, 2 Mar 2016 09:38:59 -0500	[thread overview]
Message-ID: <20160302093859.0565709d@gandalf.local.home> (raw)
In-Reply-To: <6535574de7ff2478a1784343648d147637ed0a75.1456501855.git.tom.zanussi@linux.intel.com>

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

> +static int create_val_field(struct hist_trigger_data *hist_data,
> +			    unsigned int val_idx,
> +			    struct trace_event_file *file,
> +			    char *field_str)
> +{
> +	struct ftrace_event_field *field = NULL;
> +	unsigned long flags = 0;
> +	int ret = 0;
> +
> +	if (WARN_ON(val_idx >= TRACING_MAP_VALS_MAX))
> +		return -EINVAL;
> +	field = trace_find_event_field(file->event_call, field_str);
> +	if (!field) {
> +		ret = -EINVAL;
> +		goto out;
> +	}
> +
> +	hist_data->fields[val_idx] = create_hist_field(field, flags);
> +	if (!hist_data->fields[val_idx]) {
> +		ret = -ENOMEM;
> +		goto out;
> +	}
> +
> +	if (WARN_ON(++hist_data->n_vals > TRACING_MAP_VALS_MAX))
> +		ret = -EINVAL;

Again, move the increment out of the WARN_ON().

> + out:
> +	return ret;
> +}
> +

-- Steve

  reply	other threads:[~2016-03-02 14: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 [this message]
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
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=20160302093859.0565709d@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).