Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1348095
| From | Steven Rostedt <rostedt@goodmis.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v15 03/23] tracing: Add hist trigger support for multiple values ('vals=' param) |
| Date | 2016-03-02 15:40 +0100 |
| Message-ID | <r8g6u-uK-33@gated-at.bofh.it> (permalink) |
| References | <r6t7Q-5QF-3@gated-at.bofh.it> <r6t7S-5QF-61@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v15 03/23] tracing: Add hist trigger support for multiple values ('vals=' param) Tom Zanussi <tom.zanussi@linux.intel.com> - 2016-02-26 17:10 +0100
Re: [PATCH v15 03/23] tracing: Add hist trigger support for multiple values ('vals=' param) Steven Rostedt <rostedt@goodmis.org> - 2016-03-02 15:40 +0100
csiph-web