Steven Rostedt
ef7f38df89
tracing: Do not register unsupported perf events
Synthetic events currently do not have a function to register perf events.
This leads to calling the tracepoint register functions with a NULL
function pointer which triggers:
------------[ cut here ]------------
WARNING: kernel/tracepoint.c:175 at tracepoint_add_func+0x357/0x370, CPU#2: perf/2272
Modules linked in: kvm_intel kvm irqbypass
CPU: 2 UID: 0 PID: 2272 Comm: perf Not tainted 6.18.0-ftest-11964-ge022764176fc-dirty #323 PREEMPTLAZY
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.17.0-debian-1.17.0-1 04/01/2014
RIP: 0010:tracepoint_add_func+0x357/0x370
Code: 28 9c e8 4c 0b f5 ff eb 0f 4c 89 f7 48 c7 c6 80 4d 28 9c e8 ab 89 f4 ff 31 c0 5b 41 5c 41 5d 41 5e 41 5f 5d c3 cc cc cc cc cc <0f> 0b 49 c7 c6 ea ff ff ff e9 ee fe ff ff 0f 0b e9 f9 fe ff ff 0f
RSP: 0018:ffffabc0c44d3c40 EFLAGS: 00010246
RAX: 0000000000000001 RBX: ffff9380aa9e4060 RCX: 0000000000000000
RDX: 000000000000000a RSI: ffffffff9e1d4a98 RDI: ffff937fcf5fd6c8
RBP: 0000000000000001 R08: 0000000000000007 R09: ffff937fcf5fc780
R10: 0000000000000003 R11: ffffffff9c193910 R12: 000000000000000a
R13: ffffffff9e1e5888 R14: 0000000000000000 R15: ffffabc0c44d3c78
FS: 00007f6202f5f340(0000) GS:ffff93819f00f000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055d3162281a8 CR3: 0000000106a56003 CR4: 0000000000172ef0
Call Trace:
<TASK>
tracepoint_probe_register+0x5d/0x90
synth_event_reg+0x3c/0x60
perf_trace_event_init+0x204/0x340
perf_trace_init+0x85/0xd0
perf_tp_event_init+0x2e/0x50
perf_try_init_event+0x6f/0x230
? perf_event_alloc+0x4bb/0xdc0
perf_event_alloc+0x65a/0xdc0
__se_sys_perf_event_open+0x290/0x9f0
do_syscall_64+0x93/0x7b0
? entry_SYSCALL_64_after_hwframe+0x76/0x7e
? trace_hardirqs_off+0x53/0xc0
entry_SYSCALL_64_after_hwframe+0x76/0x7e
Instead, have the code return -ENODEV, which doesn't warn and has perf
error out with:
# perf record -e synthetic:futex_wait
Error:
The sys_perf_event_open() syscall returned with 19 (No such device) for event (synthetic:futex_wait).
"dmesg | grep -i perf" may provide additional information.
Ideally perf should support synthetic events, but for now just fix the
warning. The support can come later.
Cc: [email protected]
Cc: Masami Hiramatsu <[email protected]>
Cc: Mathieu Desnoyers <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Link: https://patch.msgid.link/[email protected]
Fixes: 4b147936fa ("tracing: Add support for 'synthetic' events")
Reported-by: Ian Rogers <[email protected]>
Signed-off-by: Steven Rostedt (Google) <[email protected]>
2025-12-17 15:47:35 -05:00
..
2025-12-05 14:36:21 -08:00
2025-12-05 13:52:43 -08:00
2025-11-12 10:00:14 -08:00
2025-10-24 12:56:20 +02:00
2025-12-11 08:14:23 +09:00
2025-11-04 08:35:37 +01:00
2025-12-09 12:22:25 +01:00
2025-12-10 17:21:30 +09:00
2025-11-09 21:19:44 -08:00
2025-12-14 06:07:09 +12:00
2025-10-02 08:31:44 -07:00
2025-12-03 13:46:48 -08:00
2025-12-10 16:07:44 -08:00
2025-12-03 12:18:07 -08:00
2025-12-06 14:01:20 -08:00
2025-11-28 16:50:45 +01:00
2025-12-05 17:29:04 -08:00
2025-12-03 12:18:07 -08:00
2025-12-06 12:31:21 -08:00
2025-12-05 17:29:04 -08:00
2025-12-17 15:47:35 -05:00
2025-10-29 10:29:58 +01:00
2025-06-24 20:30:37 +09:00
2025-11-04 12:36:49 +01:00
2025-09-23 12:37:35 +02:00
2025-10-03 10:19:44 -07:00
2025-09-23 12:37:35 +02:00
2025-09-10 19:55:00 -04:00
2025-10-22 19:28:06 -04:00
2025-11-07 16:38:34 -05:00
2025-11-07 16:50:42 -05:00
2025-12-03 16:53:19 +01:00
2025-03-07 22:03:09 -06:00
2025-07-31 18:23:53 -07:00
2025-03-04 18:44:29 -08:00
2025-11-14 10:01:52 +01:00
2025-12-10 15:49:11 +09:00
2025-09-13 17:32:55 -07:00
2025-11-15 10:52:01 -08:00
2025-05-21 10:48:21 -07:00
2025-11-12 10:00:15 -08:00
2025-12-01 13:45:41 -08:00
2025-05-27 19:40:33 -07:00
2025-12-06 14:01:20 -08:00
2025-12-06 14:01:20 -08:00
2025-10-30 20:10:27 +01:00
2025-08-06 10:23:36 +09:00
2025-11-20 14:03:43 -08:00
2025-02-21 15:05:38 +01:00
2025-01-13 22:40:36 -08:00
2025-03-10 11:54:46 +01:00
2025-09-28 11:36:14 -07:00
2025-11-24 16:56:24 +01:00
2025-02-21 10:25:33 +01:00
2025-02-21 09:20:30 +01:00
2025-11-27 14:24:33 -08:00
2025-09-17 16:25:41 +02:00
2025-09-13 17:32:44 -07:00
2025-11-27 14:24:42 -08:00
2025-03-16 22:30:47 -07:00
2025-09-13 17:32:43 -07:00
2025-08-02 12:01:38 -07:00
2025-08-02 12:01:38 -07:00
2024-12-24 09:46:49 +01:00
2025-07-15 18:45:34 +09:00
2025-11-27 15:44:53 +01:00
2025-11-27 14:24:42 -08:00
2025-10-16 11:13:53 +02:00
2025-01-28 13:48:37 +01:00
2025-11-27 14:24:33 -08:00
2025-11-11 10:01:31 +01:00
2025-11-14 13:10:38 +01:00
2025-11-14 13:10:38 +01:00
2025-11-14 18:15:49 +08:00
2025-12-06 14:01:20 -08:00
2025-08-16 21:47:25 +02:00
2025-11-11 10:01:32 +01:00
2025-01-28 13:48:37 +01:00
2025-11-11 10:01:32 +01:00
2025-11-04 08:30:50 +01:00
2025-04-01 10:06:52 -07:00
2025-11-16 17:28:11 -08:00
2025-11-27 14:24:45 -08:00
2025-11-04 08:34:39 +01:00
2024-11-14 16:09:51 -08:00
2025-11-12 10:00:13 -08:00
2025-09-30 11:11:21 -07:00
2025-11-25 19:45:40 +01:00
2025-11-19 18:06:50 +01:00
2025-06-13 08:47:20 +02:00
2025-09-17 16:25:41 +02:00
2025-03-30 15:44:36 -07:00
2025-07-01 15:02:03 +02:00
2025-08-21 20:09:20 +02:00
2025-10-02 18:44:54 -07:00
2025-04-14 14:13:41 +02:00
2025-11-27 15:45:38 +01:00
2025-10-29 10:29:54 +01:00
2025-08-14 15:26:30 -07:00
2025-03-21 15:30:10 -04:00
2025-08-19 13:38:20 +02:00
2025-08-02 12:01:38 -07:00
2025-01-28 13:48:37 +01:00
2025-09-25 09:23:54 +02:00
2025-11-11 10:01:32 +01:00
2025-01-28 13:48:37 +01:00
2025-09-29 11:20:29 -07:00
2025-09-21 17:44:20 -04:00
2025-11-27 14:24:44 -08:00
2025-11-19 12:17:28 +01:00
2025-07-31 11:28:03 -04:00
2025-09-13 17:32:53 -07:00
2025-12-06 14:01:20 -08:00
2025-11-21 09:45:36 -10:00