Xiao Yang
0bbe7f7199
tracing: Fix the race between registering 'snapshot' event trigger and triggering 'snapshot' operation
...
Traced event can trigger 'snapshot' operation(i.e. calls snapshot_trigger()
or snapshot_count_trigger()) when register_snapshot_trigger() has completed
registration but doesn't allocate buffer for 'snapshot' event trigger. In
the rare case, 'snapshot' operation always detects the lack of allocated
buffer so make register_snapshot_trigger() allocate buffer first.
trigger-snapshot.tc in kselftest reproduces the issue on slow vm:
-----------------------------------------------------------
cat trace
...
ftracetest-3028 [002] .... 236.784290: sched_process_fork: comm=ftracetest pid=3028 child_comm=ftracetest child_pid=3036
<...>-2875 [003] .... 240.460335: tracing_snapshot_instance_cond: *** SNAPSHOT NOT ALLOCATED ***
<...>-2875 [003] .... 240.460338: tracing_snapshot_instance_cond: *** stopping trace here! ***
-----------------------------------------------------------
Link: http://lkml.kernel.org/r/20200414015145.66236-1-yangx.jy@cn.fujitsu.com
Cc: stable@vger.kernel.org
Fixes: 93e31ffbf417a ("tracing: Add 'snapshot' event trigger command")
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-04-14 22:02:10 -04:00
..
2020-03-05 13:42:40 -07:00
2020-03-30 19:52:37 -07:00
2020-01-02 21:56:44 -05:00
2019-08-01 14:16:21 -07:00
2020-04-05 10:36:18 -07:00
2020-02-25 19:07:58 -05:00
2020-01-30 09:46:28 -05:00
2020-01-30 09:46:28 -05:00
2017-11-02 11:10:55 +01:00
2019-11-13 09:37:28 -05:00
2020-01-13 13:19:38 -05:00
2020-03-27 16:39:01 -04:00
2017-11-02 11:10:55 +01:00
2020-02-20 17:43:41 -05:00
2019-10-18 15:01:57 +02:00
2018-08-16 19:08:06 -04:00
2020-01-31 12:59:26 -05:00
2020-01-13 13:19:38 -05:00
2018-08-16 19:08:06 -04:00
2020-02-01 13:10:15 -05:00
2020-02-01 13:09:23 -05:00
2020-03-03 17:33:43 -05:00
2019-10-28 12:38:26 +01:00
2018-08-16 19:08:06 -04:00
2019-12-19 18:24:17 -05:00
2020-02-26 10:34:42 -08:00
2020-01-02 19:04:57 -05:00
2020-04-14 22:02:10 -04:00
2020-03-27 16:39:02 -04:00
2019-12-10 10:11:00 +01:00
2020-03-19 19:11:19 -04:00
2020-01-13 13:19:38 -05:00
2020-03-03 17:33:43 -05:00
2020-01-13 13:19:38 -05:00
2020-01-13 13:19:38 -05:00
2018-07-30 18:41:04 -04:00
2018-08-16 19:08:06 -04:00
2020-03-27 16:39:02 -04:00
2020-01-13 13:19:38 -05:00
2017-11-02 11:10:55 +01:00
2020-03-19 17:48:36 -04:00
2018-08-16 19:08:06 -04:00
2019-02-13 08:16:40 +01:00
2019-10-12 20:48:06 -04:00
2019-05-25 23:04:42 -04:00
2020-01-27 10:56:02 -05:00
2020-01-22 07:09:20 -05:00
2020-01-30 09:46:10 -05:00
2020-01-13 13:19:38 -05:00
2018-01-23 15:57:29 -05:00
2020-01-13 13:19:38 -05:00
2020-01-21 18:39:54 -05:00
2020-01-02 22:04:07 -05:00
2020-01-24 18:06:48 -05:00
2019-11-14 13:15:11 -05:00
2020-02-06 07:12:11 +00:00
2020-02-24 16:17:14 -08:00
2020-04-03 11:30:50 -04:00
2020-03-27 16:39:02 -04:00
2019-12-19 18:26:00 -05:00
2018-08-16 19:08:06 -04:00