From baf32846d88a55c618222d630b07bdc37d8fecf8 Mon Sep 17 00:00:00 2001 From: Rolf Neugebauer Date: Wed, 14 Jun 2017 13:13:51 -0700 Subject: [PATCH] kernel: Build the perf utility as part of the kernel build The perf utility is somewhat kernel specific so might as well compile it when we compile the kernel. The resulting binary is statically linked (and stripped for size) and is added the resulting kernel packages. Although we add alpine packages such as libunwind and other, it seems that the config detection code for perf/tools does not detect them. Signed-off-by: Rolf Neugebauer --- kernel/Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kernel/Dockerfile b/kernel/Dockerfile index 563df4a06..aa19b7e76 100644 --- a/kernel/Dockerfile +++ b/kernel/Dockerfile @@ -93,6 +93,13 @@ RUN DVER=$(basename $(find /tmp/kernel-modules/lib/modules/ -mindepth 1 -maxdept RUN printf "KERNEL_SOURCE=${KERNEL_SOURCE}\n" > /out/kernel-source-info +# perf (Don't compile for 4.4.x, it's broken and tedious to fix) +RUN if [ "${KERNEL_SERIES}" != "4.4.x" ]; then \ + mkdir -p /build/perf && \ + make -C tools/perf LDFLAGS=-static O=/build/perf && \ + strip /build/perf/perf && \ + cp /build/perf/perf /out; \ + fi FROM scratch ENTRYPOINT []