perf bpf: Add linux/socket.h to the headers accessible to bpf proggies
Subsystems (2)
tip-bot for Arnaldo Carvalho de Melo
merge botCommit-ID: 403f833d15a33bfd8e50dd79fa8e25fb4aa132f6 Gitweb: https://git.kernel.org/tip/403f833d15a33bfd8e50dd79fa8e25fb4aa132f6 Author: Arnaldo Carvalho de Melo <[email protected]> AuthorDate: Wed, 29 Aug 2018 17:41:53 -0300 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 30 Aug 2018 15:52:20 -0300
perf bpf: Add linux/socket.h to the headers accessible to bpf proggies
So that we don't have to define sockaddr_storage in the augmented_syscalls.c bpf example when hooking into syscalls needing it, idea is to mimic the system headers. Eventually we probably need to have sys/socket.h, etc. Start by having at least linux/socket.h.
Cc Adrian Hunter <[email protected]>
Cc David Ahern <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Wang Nan <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
---
tools/perf/Makefile.perf | 4 +++-
{include/uapi => tools/perf/include/bpf}/linux/socket.h | 2 ++
2 files changed, 5 insertions(+), 1 deletion(-)tools/perf/Makefile.perf +3 -1
@@ -779,7 +779,9 @@ endif ifndef NO_LIBBPF $(call QUIET_INSTALL, bpf-headers) \ $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perf_include_instdir_SQ)/bpf'; \ - $(INSTALL) include/bpf/*.h -t '$(DESTDIR_SQ)$(perf_include_instdir_SQ)/bpf' + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perf_include_instdir_SQ)/bpf/linux'; \ + $(INSTALL) include/bpf/*.h -t '$(DESTDIR_SQ)$(perf_include_instdir_SQ)/bpf'; \ + $(INSTALL) include/bpf/linux/*.h -t '$(DESTDIR_SQ)$(perf_include_instdir_SQ)/bpf/linux' $(call QUIET_INSTALL, bpf-examples) \ $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perf_examples_instdir_SQ)/bpf'; \ $(INSTALL) examples/bpf/*.c -t '$(DESTDIR_SQ)$(perf_examples_instdir_SQ)/bpf'
tools/perf/include/bpf/linux/socket.h renamed from include/uapi/linux/socket.h +2 -0
@@ -19,4 +19,6 @@ struct __kernel_sockaddr_storage {/* _SS_MAXSIZE value minus size of ss_family */ } __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */ +#define sockaddr_storage __kernel_sockaddr_storage +#endif /* _UAPI_LINUX_SOCKET_H */