Skip to content

Commit dc513fd

Browse files
committed
bpf/tracing: Use stage6 of tracing to not duplicate macros
The bpf events are created by the same macro magic as tracefs trace events are. But to hook into bpf, it has its own code. It duplicates many of the same macros as the tracefs macros and this is an issue because it misses bug fixes as well as any new enhancements that come with the other trace macros. As the trace macros have been put into their own staging files, have bpf take advantage of this and use the tracefs stage 6 macros that the "fast ssign" portion of the trace event macro uses. Link: https://lkml.kernel.org/r/20230124202515.873075730@goodmis.org Link: https://lore.kernel.org/lkml/1671181385-5719-1-git-send-email-quic_linyyuan@quicinc.com/ Cc: bpf@vger.kernel.org Cc: Peter Zijlstra <peterz@infradead.org> Cc: Alexei Starovoitov <ast@kernel.org> Cc: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Alexei Starovoitov <ast@kernel.org> Reported-by: Linyu Yuan <quic_linyyuan@quicinc.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent 92a22ce commit dc513fd

1 file changed

Lines changed: 1 addition & 44 deletions

File tree

include/trace/bpf_probe.h

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,7 @@
44

55
#ifdef CONFIG_BPF_EVENTS
66

7-
#undef __entry
8-
#define __entry entry
9-
10-
#undef __get_dynamic_array
11-
#define __get_dynamic_array(field) \
12-
((void *)__entry + (__entry->__data_loc_##field & 0xffff))
13-
14-
#undef __get_dynamic_array_len
15-
#define __get_dynamic_array_len(field) \
16-
((__entry->__data_loc_##field >> 16) & 0xffff)
17-
18-
#undef __get_str
19-
#define __get_str(field) ((char *)__get_dynamic_array(field))
20-
21-
#undef __get_bitmask
22-
#define __get_bitmask(field) (char *)__get_dynamic_array(field)
23-
24-
#undef __get_cpumask
25-
#define __get_cpumask(field) (char *)__get_dynamic_array(field)
26-
27-
#undef __get_sockaddr
28-
#define __get_sockaddr(field) ((struct sockaddr *)__get_dynamic_array(field))
29-
30-
#undef __get_rel_dynamic_array
31-
#define __get_rel_dynamic_array(field) \
32-
((void *)(&__entry->__rel_loc_##field) + \
33-
sizeof(__entry->__rel_loc_##field) + \
34-
(__entry->__rel_loc_##field & 0xffff))
35-
36-
#undef __get_rel_dynamic_array_len
37-
#define __get_rel_dynamic_array_len(field) \
38-
((__entry->__rel_loc_##field >> 16) & 0xffff)
39-
40-
#undef __get_rel_str
41-
#define __get_rel_str(field) ((char *)__get_rel_dynamic_array(field))
42-
43-
#undef __get_rel_bitmask
44-
#define __get_rel_bitmask(field) (char *)__get_rel_dynamic_array(field)
45-
46-
#undef __get_rel_cpumask
47-
#define __get_rel_cpumask(field) (char *)__get_rel_dynamic_array(field)
48-
49-
#undef __get_rel_sockaddr
50-
#define __get_rel_sockaddr(field) ((struct sockaddr *)__get_rel_dynamic_array(field))
7+
#include "stages/stage6_event_callback.h"
518

529
#undef __perf_count
5310
#define __perf_count(c) (c)

0 commit comments

Comments
 (0)