Steven Rostedt
65b1971147
tracing: Do not register unsupported perf events
commit ef7f38df890f5dcd2ae62f8dbde191d72f3bebae upstream.
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: stable@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://patch.msgid.link/20251216182440.147e4453@gandalf.local.home
Fixes: 4b147936fa ("tracing: Add support for 'synthetic' events")
Reported-by: Ian Rogers <irogers@google.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-11 15:22:01 +01:00
..
2026-01-11 15:21:25 +01:00
2026-01-11 15:21:27 +01:00
2023-09-05 11:01:47 -07:00
2024-08-03 08:54:34 +02:00
2026-01-11 15:21:38 +01:00
2024-04-03 15:28:50 +02:00
2025-11-24 10:29:23 +01:00
2025-11-24 10:29:22 +01:00
2025-11-24 10:30:06 +01:00
2025-02-08 09:51:48 +01:00
2025-08-15 12:08:49 +02:00
2026-01-11 15:21:43 +01:00
2026-01-11 15:21:07 +01:00
2025-08-28 16:28:28 +02:00
2025-08-28 16:28:17 +02:00
2025-06-04 14:42:00 +02:00
2025-09-19 16:32:03 +02:00
2026-01-11 15:21:42 +01:00
2025-12-01 11:41:38 +01:00
2026-01-11 15:22:01 +01:00
2025-02-27 04:10:52 -08:00
2024-01-31 16:18:49 -08:00
2022-08-22 18:50:06 -04:00
2022-04-25 14:37:28 +02:00
2023-11-28 17:19:56 +00:00
2024-02-05 20:14:14 +00:00
2025-08-15 12:08:39 +02:00
2024-07-11 12:49:18 +02:00
2025-08-15 12:08:39 +02:00
2024-05-02 16:32:50 +02:00
2023-08-08 16:48:47 -04:00
2022-09-26 10:13:13 -07:00
2023-03-14 19:32:38 -07:00
2023-06-05 09:57:20 +02:00
2023-01-13 11:48:15 +01:00
2025-01-23 17:21:17 +01:00
2024-05-02 16:32:47 +02:00
2023-12-20 17:01:51 +01:00
2023-04-18 16:39:34 -07:00
2025-06-27 11:09:03 +01:00
2022-07-05 13:32:59 -07:00
2023-02-08 13:36:22 +01:00
2025-10-19 16:30:48 +02:00
2025-08-15 12:09:07 +02:00
2025-01-23 17:21:13 +01:00
2022-07-15 18:21:49 +00:00
2023-04-08 13:45:37 -07:00
2023-08-21 13:37:28 -07:00
2023-03-24 11:01:29 +01:00
2024-10-10 11:57:13 +02:00
2022-11-12 18:47:36 -08:00
2023-08-29 17:32:32 -07:00
2022-11-15 00:42:02 -08:00
2026-01-11 15:21:55 +01:00
2024-01-05 15:19:41 +01:00
2022-03-31 10:36:55 +02:00
2025-01-09 13:32:07 +01:00
2025-12-01 11:41:52 +01:00
2025-04-10 14:37:34 +02:00
2024-09-12 11:11:27 +02:00
2022-09-11 21:55:06 -07:00
2023-11-28 17:19:40 +00:00
2023-03-24 20:10:59 -07:00
2024-08-14 13:58:51 +02:00
2023-06-08 12:27:20 -07:00
2023-08-24 16:25:14 -07:00
2024-10-17 15:24:37 +02:00
2022-09-11 21:55:12 -07:00
2024-06-12 11:11:50 +02:00
2023-04-08 13:45:38 -07:00
2023-08-21 11:29:12 -07:00
2024-06-12 11:11:50 +02:00
2025-10-23 16:16:41 +02:00
2025-05-02 07:50:55 +02:00
2025-05-18 08:24:08 +02:00
2024-06-21 14:38:50 +02:00
2023-08-21 13:37:59 -07:00
2025-10-19 16:31:01 +02:00
2024-08-14 13:58:47 +02:00
2023-04-16 14:23:07 +02:00
2023-11-28 17:20:04 +00:00
2023-08-18 10:18:55 -07:00
2026-01-11 15:21:34 +01:00
2025-10-19 16:30:59 +02:00
2023-07-14 15:02:57 -07:00
2026-01-11 15:22:00 +01:00
2025-10-15 11:57:48 +02:00
2024-12-09 10:33:11 +01:00
2025-10-15 11:57:53 +02:00
2024-06-12 11:12:52 +02:00
2025-06-04 14:41:55 +02:00
2023-04-20 11:36:35 +02:00
2022-02-25 09:36:06 +01:00
2024-12-19 18:11:36 +01:00
2022-04-05 09:59:38 +02:00
2022-05-24 11:11:13 -07:00
2024-07-05 09:34:04 +02:00
2025-10-19 16:30:50 +02:00
2022-09-08 16:56:45 -07:00
2023-06-28 16:05:21 -07:00
2026-01-11 15:21:17 +01:00
2022-08-29 12:47:15 +01:00
2023-11-28 17:20:08 +00:00
2023-02-18 14:34:36 -05:00
2022-04-29 14:38:03 -07:00
2025-08-15 12:08:57 +02:00
2023-06-29 15:19:43 -07:00
2023-02-02 22:50:04 -08:00
2022-11-30 20:16:49 -04:00
2022-05-19 23:25:47 -04:00
2023-04-13 11:49:35 -07:00
2025-10-02 13:42:51 +02:00
2025-04-10 14:37:25 +02:00
2023-06-19 16:25:28 -07:00
2024-08-03 08:54:29 +02:00
2025-06-27 11:08:49 +01:00
2023-08-07 15:57:22 -10:00
2025-01-17 13:36:25 +01:00