Rafael Mendonca
342a4a2f99
tracing/eprobe: Fix warning in filter creation
...
The filter pointer (filterp) passed to create_filter() function must be a
pointer that references a NULL pointer, otherwise, we get a warning when
adding a filter option to the event probe:
root@localhost:/sys/kernel/tracing# echo 'e:egroup/stat_runtime_4core sched/sched_stat_runtime \
runtime=$runtime:u32 if cpu < 4' >> dynamic_events
[ 5034.340439] ------------[ cut here ]------------
[ 5034.341258] WARNING: CPU: 0 PID: 223 at kernel/trace/trace_events_filter.c:1939 create_filter+0x1db/0x250
[...] stripped
[ 5034.345518] RIP: 0010:create_filter+0x1db/0x250
[...] stripped
[ 5034.351604] Call Trace:
[ 5034.351803] <TASK>
[ 5034.351959] ? process_preds+0x1b40/0x1b40
[ 5034.352241] ? rcu_read_lock_bh_held+0xd0/0xd0
[ 5034.352604] ? kasan_set_track+0x29/0x40
[ 5034.352904] ? kasan_save_alloc_info+0x1f/0x30
[ 5034.353264] create_event_filter+0x38/0x50
[ 5034.353573] __trace_eprobe_create+0x16f4/0x1d20
[ 5034.353964] ? eprobe_dyn_event_release+0x360/0x360
[ 5034.354363] ? mark_held_locks+0xa6/0xf0
[ 5034.354684] ? _raw_spin_unlock_irqrestore+0x35/0x60
[ 5034.355105] ? trace_hardirqs_on+0x41/0x120
[ 5034.355417] ? _raw_spin_unlock_irqrestore+0x35/0x60
[ 5034.355751] ? __create_object+0x5b7/0xcf0
[ 5034.356027] ? lock_is_held_type+0xaf/0x120
[ 5034.356362] ? rcu_read_lock_bh_held+0xb0/0xd0
[ 5034.356716] ? rcu_read_lock_bh_held+0xd0/0xd0
[ 5034.357084] ? kasan_set_track+0x29/0x40
[ 5034.357411] ? kasan_save_alloc_info+0x1f/0x30
[ 5034.357715] ? __kasan_kmalloc+0xb8/0xc0
[ 5034.357985] ? write_comp_data+0x2f/0x90
[ 5034.358302] ? __sanitizer_cov_trace_pc+0x25/0x60
[ 5034.358691] ? argv_split+0x381/0x460
[ 5034.358949] ? write_comp_data+0x2f/0x90
[ 5034.359240] ? eprobe_dyn_event_release+0x360/0x360
[ 5034.359620] trace_probe_create+0xf6/0x110
[ 5034.359940] ? trace_probe_match_command_args+0x240/0x240
[ 5034.360376] eprobe_dyn_event_create+0x21/0x30
[ 5034.360709] create_dyn_event+0xf3/0x1a0
[ 5034.360983] trace_parse_run_command+0x1a9/0x2e0
[ 5034.361297] ? dyn_event_release+0x500/0x500
[ 5034.361591] dyn_event_write+0x39/0x50
[ 5034.361851] vfs_write+0x311/0xe50
[ 5034.362091] ? dyn_event_seq_next+0x40/0x40
[ 5034.362376] ? kernel_write+0x5b0/0x5b0
[ 5034.362637] ? write_comp_data+0x2f/0x90
[ 5034.362937] ? __sanitizer_cov_trace_pc+0x25/0x60
[ 5034.363258] ? ftrace_syscall_enter+0x544/0x840
[ 5034.363563] ? write_comp_data+0x2f/0x90
[ 5034.363837] ? __sanitizer_cov_trace_pc+0x25/0x60
[ 5034.364156] ? write_comp_data+0x2f/0x90
[ 5034.364468] ? write_comp_data+0x2f/0x90
[ 5034.364770] ksys_write+0x158/0x2a0
[ 5034.365022] ? __ia32_sys_read+0xc0/0xc0
[ 5034.365344] __x64_sys_write+0x7c/0xc0
[ 5034.365669] ? syscall_enter_from_user_mode+0x53/0x70
[ 5034.366084] do_syscall_64+0x60/0x90
[ 5034.366356] entry_SYSCALL_64_after_hwframe+0x63/0xcd
[ 5034.366767] RIP: 0033:0x7ff0b43938f3
[...] stripped
[ 5034.371892] </TASK>
[ 5034.374720] ---[ end trace 0000000000000000 ]---
Link: https://lore.kernel.org/all/20221108202148.1020111-1-rafaelmendsr@gmail.com/
Fixes: 752be5c5c910 ("tracing/eprobe: Add eprobe filter support")
Signed-off-by: Rafael Mendonca <rafaelmendsr@gmail.com>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
2022-11-18 10:15:34 +09:00
..
2022-11-04 00:24:12 +01:00
2022-10-17 18:52:43 -07:00
2022-09-28 09:02:20 +02:00
2022-09-26 19:46:18 -07:00
2022-10-10 17:53:04 -07:00
2022-10-03 14:03:25 -07:00
2022-11-02 12:22:05 +01:00
2022-09-07 21:53:50 +02:00
2022-10-20 21:27:22 -07:00
2022-09-19 15:08:38 +02:00
2022-10-11 17:42:58 -06:00
2022-10-10 11:36:19 -07:00
2022-10-11 17:42:55 -06:00
2022-10-10 12:16:19 -07:00
2022-10-25 14:53:19 +02:00
2022-09-29 15:20:52 +02:00
2022-10-20 15:34:49 -07:00
2022-10-17 16:41:25 +02:00
2022-10-11 17:42:55 -06:00
2022-11-18 10:15:34 +09:00
2022-09-26 19:46:22 -07:00
2022-08-22 18:50:06 -04:00
2022-04-25 14:37:28 +02:00
2022-09-01 17:39:30 -04:00
2022-08-29 19:47:03 -04:00
2022-09-07 11:30:15 -04:00
2022-10-04 11:05:43 -07:00
2022-09-26 19:46:09 -07:00
2022-09-26 10:13:13 -07:00
2022-07-05 13:33:00 -07:00
2022-07-05 13:32:59 -07:00
2022-05-23 17:51:12 -07:00
2022-08-28 14:02:44 -07:00
2022-09-26 19:46:07 -07:00
2022-10-12 11:00:22 -07:00
2022-07-05 13:32:59 -07:00
2022-09-11 21:55:11 -07:00
2022-10-12 11:00:22 -07:00
2022-09-07 21:53:50 +02:00
2022-09-29 04:40:15 +09:00
2022-07-15 18:21:49 +00:00
2022-09-30 16:50:39 +02:00
2022-04-15 14:49:55 -07:00
2022-06-24 09:48:55 +02:00
2022-07-17 17:31:39 -07:00
2022-10-03 17:11:07 -07:00
2022-10-03 14:03:23 -07:00
2022-09-11 21:55:08 -07:00
2022-09-11 21:55:06 -07:00
2022-09-11 21:55:06 -07:00
2022-09-11 21:55:06 -07:00
2022-11-18 10:15:34 +09:00
2022-09-11 21:55:06 -07:00
2022-10-09 16:01:59 -07:00
2022-09-11 21:55:12 -07:00
2022-10-03 14:03:20 -07:00
2022-05-19 19:30:30 +02:00
2022-09-13 10:38:43 -07:00
2022-09-01 16:55:35 +02:00
2022-04-29 14:38:00 -07:00
2022-06-29 13:07:16 +02:00
2022-09-11 21:55:12 -07:00
2022-09-07 21:53:50 +02:00
2022-10-04 15:59:36 +02:00
2022-10-03 14:21:43 -07:00
2022-07-21 17:19:25 -07:00
2022-08-01 15:21:42 +02:00
2022-04-11 17:07:29 -07:00
2022-05-03 14:11:58 -07:00
2022-10-10 09:10:28 -07:00
2022-10-10 12:49:34 -07:00
2022-09-11 21:55:10 -07:00
2022-07-05 13:32:59 -07:00
2022-05-08 01:33:09 -07:00
2022-05-24 11:11:13 -07:00
2022-08-20 15:17:45 -07:00
2022-10-10 10:41:21 -07:00
2022-09-08 16:56:45 -07:00
2022-10-10 17:53:04 -07:00
2022-09-11 21:55:10 -07:00
2022-08-29 12:47:15 +01:00
2022-09-26 13:01:18 -04:00
2022-04-29 14:38:03 -07:00
2022-05-18 18:24:57 -05:00
2022-09-07 21:53:50 +02:00
2022-10-09 16:24:05 -07:00
2022-05-19 23:25:47 -04:00
2022-10-23 12:01:01 -07:00
2022-08-02 19:24:24 -07:00
2022-06-23 18:41:40 +02:00
2022-08-06 16:38:17 -07:00
2022-10-03 17:11:07 -07:00