aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/perf/scripts/python/export-to-postgresql.py
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2021-03-17 13:05:09 -0700
committerAlexei Starovoitov <ast@kernel.org>2021-03-17 18:48:05 -0700
commit9ae2c26e43248b722e79fe867be38062c9dd1e5f (patch)
tree63141ed8cdfad03afaa036f477da212228920ad9 /tools/perf/scripts/python/export-to-postgresql.py
parentbpf: net: Emit anonymous enum with BPF_TCP_CLOSE value explicitly (diff)
downloadwireguard-linux-9ae2c26e43248b722e79fe867be38062c9dd1e5f.tar.xz
wireguard-linux-9ae2c26e43248b722e79fe867be38062c9dd1e5f.zip
libbpf: provide NULL and KERNEL_VERSION macros in bpf_helpers.h
Given that vmlinux.h is not compatible with headers like stddef.h, NULL poses an annoying problem: it is defined as #define, so is not captured in BTF, so is not emitted into vmlinux.h. This leads to users either sticking to explicit 0, or defining their own NULL (as progs/skb_pkt_end.c does). But it's easy for bpf_helpers.h to provide (conditionally) NULL definition. Similarly, KERNEL_VERSION is another commonly missed macro that came up multiple times. So this patch adds both of them, along with offsetof(), that also is typically defined in stddef.h, just like NULL. This might cause compilation warning for existing BPF applications defining their own NULL and/or KERNEL_VERSION already: progs/skb_pkt_end.c:7:9: warning: 'NULL' macro redefined [-Wmacro-redefined] #define NULL 0 ^ /tmp/linux/tools/testing/selftests/bpf/tools/include/vmlinux.h:4:9: note: previous definition is here #define NULL ((void *)0) ^ It is trivial to fix, though, so long-term benefits outweight temporary inconveniences. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/r/20210317200510.1354627-2-andrii@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions