Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+11 -3
-1
kernel/trace/trace.h
··· 15 15 #include <linux/trace_seq.h> 16 16 #include <linux/trace_events.h> 17 17 #include <linux/compiler.h> 18 - #include <linux/trace_seq.h> 19 18 #include <linux/glob.h> 20 19 21 20 #ifdef CONFIG_FTRACE_SYSCALLS
+11 -2
kernel/trace/trace_events_hist.c
··· 59 59 C(NO_CLOSING_PAREN, "No closing paren found"), \ 60 60 C(SUBSYS_NOT_FOUND, "Missing subsystem"), \ 61 61 C(INVALID_SUBSYS_EVENT, "Invalid subsystem or event name"), \ 62 - C(INVALID_REF_KEY, "Using variable references as keys not supported"), \ 62 + C(INVALID_REF_KEY, "Using variable references in keys not supported"), \ 63 63 C(VAR_NOT_FOUND, "Couldn't find variable"), \ 64 64 C(FIELD_NOT_FOUND, "Couldn't find field"), 65 65 ··· 1854 1854 struct hist_elt_data *elt_data; 1855 1855 u64 var_val = 0; 1856 1856 1857 + if (WARN_ON_ONCE(!elt)) 1858 + return var_val; 1859 + 1857 1860 elt_data = elt->private_data; 1858 1861 var_val = elt_data->var_ref_vals[hist_field->var_ref_idx]; 1859 1862 ··· 3585 3582 struct track_data *track_data = tr->cond_snapshot->cond_data; 3586 3583 struct hist_elt_data *elt_data, *track_elt_data; 3587 3584 struct snapshot_context *context = cond_data; 3585 + struct action_data *action; 3588 3586 u64 track_val; 3589 3587 3590 3588 if (!track_data) 3591 3589 return false; 3592 3590 3591 + action = track_data->action_data; 3592 + 3593 3593 track_val = get_track_val(track_data->hist_data, context->elt, 3594 3594 track_data->action_data); 3595 + 3596 + if (!action->track_data.check_val(track_data->track_val, track_val)) 3597 + return false; 3595 3598 3596 3599 track_data->track_val = track_val; 3597 3600 memcpy(track_data->key, context->key, track_data->key_len); ··· 4512 4503 goto out; 4513 4504 } 4514 4505 4515 - if (hist_field->flags & HIST_FIELD_FL_VAR_REF) { 4506 + if (field_has_hist_vars(hist_field, 0)) { 4516 4507 hist_err(tr, HIST_ERR_INVALID_REF_KEY, errpos(field_str)); 4517 4508 destroy_hist_field(hist_field, 0); 4518 4509 ret = -EINVAL;