Skip to content

Commit ef38c79

Browse files
committed
tracing: Fix race where histograms can be called before the event
commit 94eedf3 ("tracing: Fix race where eprobes can be called before the event") fixed an issue where if an event is soft disabled, and the trigger is being added, there's a small window where the event sees that there's a trigger but does not see that it requires reading the event yet, and then calls the trigger with the record == NULL. This could be solved with adding memory barriers in the hot path, or to make sure that all the triggers requiring a record check for NULL. The latter was chosen. Commit 94eedf3 set the eprobe trigger handle to check for NULL, but the same needs to be done with histograms. Link: https://lore.kernel.org/linux-trace-kernel/[email protected]/ Link: https://lore.kernel.org/linux-trace-kernel/[email protected] Cc: Tom Zanussi <[email protected]> Cc: [email protected] Fixes: 7491e2c ("tracing: Add a probe that attaches to trace events") Reported-by: Masami Hiramatsu (Google) <[email protected]> Acked-by: Masami Hiramatsu (Google) <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 022632f commit ef38c79

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kernel/trace/trace_events_hist.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5143,6 +5143,9 @@ static void event_hist_trigger(struct event_trigger_data *data,
51435143
void *key = NULL;
51445144
unsigned int i;
51455145

5146+
if (unlikely(!rbe))
5147+
return;
5148+
51465149
memset(compound_key, 0, hist_data->key_size);
51475150

51485151
for_each_hist_key_field(i, hist_data) {

0 commit comments

Comments
 (0)