]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Support PPC in arch_specific_syscall_pfx
authorDaniel Müller <deso@posteo.net>
Thu, 28 Jul 2022 22:23:45 +0000 (22:23 +0000)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 28 Jul 2022 23:11:18 +0000 (16:11 -0700)
commitde08cf871869e7c1133cdeac8ba8a09d10af07af
treedcc7992c8dbc9545a243b73c53cf37c541104269
parenta5d5b415a253cf9df0f33d9b777e6a80c18d837b
libbpf: Support PPC in arch_specific_syscall_pfx

Commit d3c0116c98d2 ("libbpf: add ksyscall/kretsyscall sections support
for syscall kprobes") added the arch_specific_syscall_pfx() function,
which returns a string representing the architecture in use. As it turns
out this function is currently not aware of Power PC, where NULL is
returned. That's being flagged by the libbpf CI system, which builds for
ppc64le and the compiler sees a NULL pointer being passed in to a %s
format string.
With this change we add representations for two more architectures, for
Power PC and Power PC 64, and also adjust the string format logic to
handle NULL pointers gracefully, in an attempt to prevent similar issues
with other architectures in the future.

Fixes: d3c0116c98d2 ("libbpf: add ksyscall/kretsyscall sections support for syscall kprobes")
Signed-off-by: Daniel Müller <deso@posteo.net>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220728222345.3125975-1-deso@posteo.net
tools/lib/bpf/libbpf.c