From c5336564839b26b1b54373417c9227ac83cd8d18 Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Wed, 25 Oct 2017 15:29:21 -0400 Subject: [PATCH] add perf tooling Signed-off-by: Jess Frazelle --- bcc-tools/Dockerfile | 38 ++++++++++++++++++++++++++++++++++++++ bcc-tools/entrypoint.sh | 6 ++++++ lkp-tests/Dockerfile | 10 +++++++++- 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 bcc-tools/Dockerfile create mode 100755 bcc-tools/entrypoint.sh diff --git a/bcc-tools/Dockerfile b/bcc-tools/Dockerfile new file mode 100644 index 0000000..0dc7ff1 --- /dev/null +++ b/bcc-tools/Dockerfile @@ -0,0 +1,38 @@ +# Usage: +# docker run --rm -it \ +# --privileged \ +# -v /lib/modules:/lib/modules:ro \ +# -v /usr/src:/usr/src:ro \ +# -v /etc/localtime:/etc/localtime:ro \ +# r.j3ss.co/bcc-tools +# +FROM debian:stretch +LABEL maintainer "Jessie Frazelle " + +ENV DEBIAN_FRONTEND noninteractive +RUN apt-get update && apt-get install -y \ + apt-transport-https \ + ca-certificates \ + dirmngr \ + gnupg \ + --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* + +# add the iovisor repository +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D4284CDD +RUN echo "deb [trusted=yes] https://repo.iovisor.org/apt/xenial xenial-nightly main" > /etc/apt/sources.list.d/iovisor.list + +RUN apt-get update && apt-get install -y \ + binutils \ + bcc \ + bcc-tools \ + libbcc-examples \ + python-bcc \ + --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* + +ENV PATH /usr/share/bcc/tools:$PATH + +COPY entrypoint.sh /usr/local/bin/entrypoint.sh + +ENTRYPOINT ["entrypoint.sh"] diff --git a/bcc-tools/entrypoint.sh b/bcc-tools/entrypoint.sh new file mode 100755 index 0000000..d46a678 --- /dev/null +++ b/bcc-tools/entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e +set -o pipefail + +mount -t debugfs none /sys/kernel/debug/ +exec "$@" diff --git a/lkp-tests/Dockerfile b/lkp-tests/Dockerfile index 7602edc..76236db 100644 --- a/lkp-tests/Dockerfile +++ b/lkp-tests/Dockerfile @@ -1,6 +1,7 @@ FROM debian:stretch LABEL maintainer "Jessie Frazelle " +ENV DEBIAN_FRONTEND noninteractive RUN dpkg --add-architecture i386 \ && apt-get update && apt-get install -y \ automake \ @@ -33,9 +34,11 @@ RUN dpkg --add-architecture i386 \ linux-libc-dev:i386 \ linux-perf \ make \ + nfs-common \ openssl \ patch \ perl \ + psmisc \ rsync \ ruby \ ruby-dev \ @@ -47,7 +50,12 @@ RUN dpkg --add-architecture i386 \ && rm -rf /var/lib/apt/lists/* \ && ln -snf /usr/bin/perf_4.9 /usr/bin/perf -RUN git clone --depth 1 https://github.com/fengguang/lkp-tests.git /usr/src/lkp-tests +ENV KERNEL_VERSION v4.13 +ENV LKP_GIT_WORK_TREE /usr/src/linux +RUN git clone -b "${KERNEL_VERSION}" https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux.git "${LKP_GIT_WORK_TREE}" + +ENV LKP_SRC /usr/src/lkp-tests +RUN git clone https://github.com/fengguang/lkp-tests.git "${LKP_SRC}" WORKDIR /usr/src/lkp-tests