Skip to content

Commit

Permalink
tracing: Exclude 'generic fields' from histograms
Browse files Browse the repository at this point in the history
There are a small number of 'generic fields' (comm/COMM/cpu/CPU) that
are found by trace_find_event_field() but are only meant for
filtering.  Specifically, they unlike normal fields, they have a size
of 0 and thus wreak havoc when used as a histogram key.

Exclude these (return -EINVAL) when used as histogram keys.

Link: http://lkml.kernel.org/r/956154cbc3e8a4f0633d619b886c97f0f0edf7b4.1506105045.git.tom.zanussi@linux.intel.com

Signed-off-by: Tom Zanussi <[email protected]>
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
  • Loading branch information
tzanussi authored and rostedt committed Oct 4, 2017
1 parent 1a149d7 commit a15f7fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/trace/trace_events_hist.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ static int create_val_field(struct hist_trigger_data *hist_data,
}

field = trace_find_event_field(file->event_call, field_name);
if (!field) {
if (!field || !field->size) {
ret = -EINVAL;
goto out;
}
Expand Down Expand Up @@ -548,7 +548,7 @@ static int create_key_field(struct hist_trigger_data *hist_data,
}

field = trace_find_event_field(file->event_call, field_name);
if (!field) {
if (!field || !field->size) {
ret = -EINVAL;
goto out;
}
Expand Down

0 comments on commit a15f7fc

Please sign in to comment.