Xiao Yang
7054f86f26
tracing: Fix the race between registering 'snapshot' event trigger and triggering 'snapshot' operation
...
commit 0bbe7f719985efd9adb3454679ecef0984cb6800 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-24 08:00:56 +02:00
..
2020-04-02 16:34:37 +02:00
2020-04-02 16:34:27 +02:00
2017-08-22 18:43:23 -07:00
2020-01-27 14:46:34 +01:00
2020-02-14 16:32:20 -05:00
2017-11-02 11:10:55 +01:00
2020-04-24 08:00:28 +02:00
2019-10-07 18:55:09 +02:00
2020-04-24 08:00:29 +02:00
2020-01-09 10:17:53 +01:00
2019-12-01 09:13:17 +01:00
2019-05-31 06:47:33 -07:00
2020-04-24 08:00:26 +02:00
2020-02-14 16:32:20 -05:00
2020-04-24 08:00:56 +02:00
2018-01-10 09:31:17 +01:00
2018-02-16 20:23:05 +01:00
2017-05-03 11:05:15 -07:00
2017-11-02 11:10:55 +01:00
2019-12-17 20:37:27 +01:00
2020-03-11 18:02:55 +01:00
2017-09-03 20:21:24 -04:00
2020-03-11 18:02:48 +01:00
2019-12-01 09:14:03 +01:00
2018-11-13 11:15:08 -08:00
2017-11-02 11:10:55 +01:00
2018-05-16 10:10:26 +02:00
2017-07-31 13:09:49 +02:00
2020-04-24 08:00:41 +02:00
2018-01-17 09:45:27 +01:00
2020-01-09 10:17:54 +01:00
2018-08-03 07:50:38 +02:00
2017-11-02 11:10:55 +01:00
2019-10-11 18:18:42 +02:00
2017-11-02 11:10:55 +01:00
2020-01-09 10:17:56 +01:00
2017-09-23 16:50:20 -04:00
2019-12-05 15:38:26 +01:00
2020-04-02 16:34:21 +02:00
2017-12-20 10:10:18 +01:00
2019-04-20 09:15:05 +02:00
2018-12-05 19:41:17 +01:00
2019-09-21 07:15:38 +02:00
2017-11-02 11:10:55 +01:00
2018-08-03 07:50:22 +02:00
2019-11-24 08:23:15 +01:00
2017-07-12 16:26:02 -07:00
2017-11-02 11:10:55 +01:00
2017-07-12 16:26:00 -07:00
2020-04-24 08:00:44 +02:00
2020-03-11 18:02:57 +01:00
2017-07-12 16:25:59 -07:00
2018-08-03 07:50:21 +02:00
2019-12-05 15:38:22 +01:00
2019-01-13 10:01:02 +01:00
2020-02-14 16:32:06 -05:00
2020-04-02 16:34:20 +02:00
2020-04-13 10:34:27 +02:00
2019-10-17 13:43:19 -07:00
2017-10-03 17:54:26 -07:00
2019-07-31 07:28:21 +02:00
2017-08-21 12:47:31 -07:00
2020-01-23 08:20:32 +01:00
2017-11-02 11:10:55 +01:00
2019-03-13 14:03:20 -07:00
2018-04-24 09:36:22 +02:00
2018-05-22 18:54:04 +02:00
2020-04-24 08:00:38 +02:00
2019-02-12 19:46:13 +01:00
2017-10-04 10:53:54 +02:00
2017-11-02 11:10:55 +01:00
2018-08-15 18:12:47 +02:00
2018-09-05 09:26:36 +02:00
2017-11-02 11:10:55 +01:00
2019-06-15 11:54:52 +02:00
2017-11-02 11:10:55 +01:00
2020-01-04 13:59:57 +01:00
2017-12-25 14:26:21 +01:00
2020-01-09 10:17:53 +01:00
2017-07-25 13:04:45 -07:00
2018-05-09 09:51:50 +02:00
2017-12-20 10:10:18 +01:00
2017-09-08 18:26:50 -07:00
2017-08-29 15:14:38 +02:00
2018-09-09 19:56:00 +02:00
2018-09-09 19:56:00 +02:00
2018-09-05 09:26:42 +02:00
2020-02-28 16:36:05 +01:00
2017-11-06 12:26:49 -08:00
2020-03-20 10:54:16 +01:00