Commit a2c48d98 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'trace-v5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull tracing fixes from Steven Rostedt:
 "Tom Zanussi sent me some small fixes and cleanups to the histogram
  code and I forgot to incorporate them.

  I also added a small clean up patch that was sent to me a while ago
  and I just noticed it"

* tag 'trace-v5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  kernel/trace/trace.h: Remove duplicate header of trace_seq.h
  tracing: Add a check_val() check before updating cond_snapshot() track_val
  tracing: Check keys for variable references in expressions too
  tracing: Prevent hist_field_var_ref() from accessing NULL tracing_map_elts
parents 2409207a 4eebe38a
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include <linux/trace_seq.h> #include <linux/trace_seq.h>
#include <linux/trace_events.h> #include <linux/trace_events.h>
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/trace_seq.h>
#include <linux/glob.h> #include <linux/glob.h>
#ifdef CONFIG_FTRACE_SYSCALLS #ifdef CONFIG_FTRACE_SYSCALLS
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
C(NO_CLOSING_PAREN, "No closing paren found"), \ C(NO_CLOSING_PAREN, "No closing paren found"), \
C(SUBSYS_NOT_FOUND, "Missing subsystem"), \ C(SUBSYS_NOT_FOUND, "Missing subsystem"), \
C(INVALID_SUBSYS_EVENT, "Invalid subsystem or event name"), \ C(INVALID_SUBSYS_EVENT, "Invalid subsystem or event name"), \
C(INVALID_REF_KEY, "Using variable references as keys not supported"), \ C(INVALID_REF_KEY, "Using variable references in keys not supported"), \
C(VAR_NOT_FOUND, "Couldn't find variable"), \ C(VAR_NOT_FOUND, "Couldn't find variable"), \
C(FIELD_NOT_FOUND, "Couldn't find field"), C(FIELD_NOT_FOUND, "Couldn't find field"),
...@@ -1854,6 +1854,9 @@ static u64 hist_field_var_ref(struct hist_field *hist_field, ...@@ -1854,6 +1854,9 @@ static u64 hist_field_var_ref(struct hist_field *hist_field,
struct hist_elt_data *elt_data; struct hist_elt_data *elt_data;
u64 var_val = 0; u64 var_val = 0;
if (WARN_ON_ONCE(!elt))
return var_val;
elt_data = elt->private_data; elt_data = elt->private_data;
var_val = elt_data->var_ref_vals[hist_field->var_ref_idx]; var_val = elt_data->var_ref_vals[hist_field->var_ref_idx];
...@@ -3582,14 +3585,20 @@ static bool cond_snapshot_update(struct trace_array *tr, void *cond_data) ...@@ -3582,14 +3585,20 @@ static bool cond_snapshot_update(struct trace_array *tr, void *cond_data)
struct track_data *track_data = tr->cond_snapshot->cond_data; struct track_data *track_data = tr->cond_snapshot->cond_data;
struct hist_elt_data *elt_data, *track_elt_data; struct hist_elt_data *elt_data, *track_elt_data;
struct snapshot_context *context = cond_data; struct snapshot_context *context = cond_data;
struct action_data *action;
u64 track_val; u64 track_val;
if (!track_data) if (!track_data)
return false; return false;
action = track_data->action_data;
track_val = get_track_val(track_data->hist_data, context->elt, track_val = get_track_val(track_data->hist_data, context->elt,
track_data->action_data); track_data->action_data);
if (!action->track_data.check_val(track_data->track_val, track_val))
return false;
track_data->track_val = track_val; track_data->track_val = track_val;
memcpy(track_data->key, context->key, track_data->key_len); memcpy(track_data->key, context->key, track_data->key_len);
...@@ -4503,7 +4512,7 @@ static int create_key_field(struct hist_trigger_data *hist_data, ...@@ -4503,7 +4512,7 @@ static int create_key_field(struct hist_trigger_data *hist_data,
goto out; goto out;
} }
if (hist_field->flags & HIST_FIELD_FL_VAR_REF) { if (field_has_hist_vars(hist_field, 0)) {
hist_err(tr, HIST_ERR_INVALID_REF_KEY, errpos(field_str)); hist_err(tr, HIST_ERR_INVALID_REF_KEY, errpos(field_str));
destroy_hist_field(hist_field, 0); destroy_hist_field(hist_field, 0);
ret = -EINVAL; ret = -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment