Skip to content

Commit 4ede125

Browse files
committed
Merge tag 'trace-v5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing fix from Steven Rostedt: "This fixes a small race between allocating a snapshot buffer and setting the snapshot trigger. On a slow machine, the trigger can occur before the snapshot is allocated causing a warning to be displayed in the ring buffer, and no snapshot triggering. Reversing the allocation and the enabling of the trigger fixes the problem" * tag 'trace-v5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Fix the race between registering 'snapshot' event trigger and triggering 'snapshot' operation
2 parents 86d32f9 + 0bbe7f7 commit 4ede125

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

kernel/trace/trace_events_trigger.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,14 +1088,10 @@ register_snapshot_trigger(char *glob, struct event_trigger_ops *ops,
10881088
struct event_trigger_data *data,
10891089
struct trace_event_file *file)
10901090
{
1091-
int ret = register_trigger(glob, ops, data, file);
1092-
1093-
if (ret > 0 && tracing_alloc_snapshot_instance(file->tr) != 0) {
1094-
unregister_trigger(glob, ops, data, file);
1095-
ret = 0;
1096-
}
1091+
if (tracing_alloc_snapshot_instance(file->tr) != 0)
1092+
return 0;
10971093

1098-
return ret;
1094+
return register_trigger(glob, ops, data, file);
10991095
}
11001096

11011097
static int

0 commit comments

Comments
 (0)