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: 93e31ffbf4
("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-30 19:52:37 -07:00
2020-04-03 11:30:20 -07:00
2020-04-07 10:43:42 -07:00
2020-04-03 13:12:26 -07:00
2020-04-08 21:46:57 +02:00
2020-04-08 11:33:46 +02:00
2020-04-10 15:36:22 -07:00
2020-03-30 19:14:28 -07:00
2019-11-27 11:42:01 -08:00
2020-04-08 12:05:07 +02:00
2020-04-06 21:42:36 +02:00
2020-04-10 13:18:57 -07:00
2020-03-30 16:17:15 -07:00
2020-04-08 11:35:27 +02:00
2020-04-07 12:37:21 +02:00
2020-04-14 22:02:10 -04:00
2020-03-25 11:50:48 +01:00
2019-12-18 18:07:31 +01:00
2019-06-05 17:37:17 +02:00
2020-03-23 18:19:06 +01:00
2020-04-06 08:58:42 -07:00
2020-03-31 15:04:17 -07:00
2020-03-12 10:42:51 -04:00
2020-02-22 20:36:47 -05:00
2020-03-12 10:42:51 -04:00
2019-06-05 17:37:17 +02:00
2020-02-21 11:22:15 -08:00
2020-02-04 03:05:26 +00:00
2020-02-14 16:05:04 +01:00
2019-06-05 17:36:37 +02:00
2020-03-30 18:06:39 -07:00
2019-06-19 17:09:06 +02:00
2019-05-21 10:50:45 +02:00
2020-03-25 10:04:01 -05:00
2019-05-21 11:52:39 +02:00
2019-09-25 17:51:39 -07:00
2020-04-02 11:22:17 -07:00
2020-04-07 10:43:42 -07:00
2019-06-03 15:49:06 +02:00
2020-04-07 10:43:37 -07:00
2019-10-06 09:11:37 -06:00
2020-03-30 16:17:15 -07:00
2019-11-11 20:10:01 +09:00
2019-05-21 10:50:45 +02:00
2019-07-12 11:05:40 -07:00
2020-03-21 16:00:24 +01:00
2019-08-29 15:10:10 +01:00
2020-04-07 10:43:44 -07:00
2020-03-25 10:04:01 -05:00
2019-05-21 10:50:46 +02:00
2019-05-21 10:50:46 +02:00
2019-12-08 14:37:36 +01:00
2019-11-12 11:35:32 +01:00
2019-12-04 19:44:14 -08:00
2020-01-08 16:32:55 +00:00
2019-09-06 23:58:44 +02:00
2020-01-08 16:32:55 +00:00
2020-01-08 16:32:55 +00:00
2020-01-08 16:32:55 +00:00
2019-05-24 20:16:01 +02:00
2020-04-10 15:36:22 -07:00
2020-01-09 12:40:13 +01:00
2019-05-30 11:26:39 -07:00
2020-03-20 13:06:20 +01:00
2020-02-04 03:05:26 +00:00
2020-01-31 10:30:41 -08:00
2019-08-05 18:39:56 -04:00
2019-08-05 18:39:56 -04:00
2019-05-24 17:27:11 +02:00
2020-04-09 12:52:34 -07:00
2020-03-21 18:56:06 -07:00
2020-01-14 12:20:48 +01:00
2020-03-06 12:28:24 +11:00
2019-11-25 09:15:42 +01:00
2019-08-19 21:54:16 -07:00
2020-02-28 16:29:12 -06:00
2020-04-10 12:59:56 -07:00
2020-02-04 03:05:26 +00:00
2020-01-18 13:51:39 +01:00
2019-05-21 10:50:45 +02:00
2019-09-24 15:54:09 -07:00
2019-12-25 10:41:20 +01:00
2020-03-31 17:29:33 -07:00
2020-04-02 11:22:17 -07:00
2020-03-25 12:59:37 +01:00
2019-05-21 10:50:45 +02:00
2020-03-21 16:03:54 +01:00
2019-11-11 10:30:59 +01:00
2020-01-17 10:19:21 +01:00
2019-11-15 14:38:30 +01:00
2020-03-03 19:34:32 +01:00
2019-11-26 13:03:56 -06:00
2020-01-09 16:42:29 -07:00
2020-04-02 09:35:31 -07:00
2020-03-02 14:06:33 -07:00
2019-12-04 15:18:39 +01:00
2019-05-21 11:52:39 +02:00
2020-03-30 18:06:39 -07:00
2019-07-18 11:51:00 -07:00
2019-12-18 18:07:31 +01:00
2020-04-07 21:51:27 +02:00
2019-05-21 10:50:45 +02:00
2020-02-07 15:34:12 +01:00
2019-07-08 19:36:47 -07:00
2019-05-21 10:50:45 +02:00
2019-07-08 19:36:47 -07:00
2019-06-05 17:37:17 +02:00
2019-06-05 17:37:17 +02:00
2020-01-17 11:19:22 +01:00
2020-04-08 11:35:20 +02:00