Messages in this thread | | | Date | Thu, 11 Nov 2021 11:11:04 +0100 | Subject | Re: [PATCH 7/7] tools/testing/selftests/bpf: make it adopt to task comm size change | From | David Hildenbrand <> |
| |
On 08.11.21 09:38, Yafang Shao wrote: > The hard-coded 16 is used in various bpf progs. These progs get task > comm either via bpf_get_current_comm() or prctl() or > bpf_core_read_str(), all of which can work well even if the task comm size > is changed. > > In these BPF programs, one thing to be improved is the > sched:sched_switch tracepoint args. As the tracepoint args are derived > from the kernel, we'd better make it same with the kernel. So the macro > TASK_COMM_LEN is converted to type enum, then all the BPF programs can > get it through BTF. > > The BPF program which wants to use TASK_COMM_LEN should include the header > vmlinux.h. Regarding the test_stacktrace_map and test_tracepoint, as the > type defined in linux/bpf.h are also defined in vmlinux.h, so we don't > need to include linux/bpf.h again. > > Signed-off-by: Yafang Shao <laoar.shao@gmail.com> > Acked-by: Andrii Nakryiko <andrii@kernel.org> > Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> > Cc: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com> > Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com> > Cc: Michal Miroslaw <mirq-linux@rere.qmqm.pl> > Cc: Peter Zijlstra <peterz@infradead.org> > Cc: Steven Rostedt <rostedt@goodmis.org> > Cc: Matthew Wilcox <willy@infradead.org> > Cc: David Hildenbrand <david@redhat.com> > Cc: Al Viro <viro@zeniv.linux.org.uk> > Cc: Kees Cook <keescook@chromium.org> > Cc: Petr Mladek <pmladek@suse.com>
Acked-by: David Hildenbrand <david@redhat.com>
-- Thanks,
David / dhildenb
| |