@@ -6,13 +6,13 @@ FROM ${OS}:${TAG} as base
66# Install required packages
77ARG CLANG_VER=12
88ARG GCC_VER=11
9- RUN apt update
109RUN export DEBIAN_FRONTEND=noninteractive \
11- && apt install -y git htop sudo curl wget net-tools jq \
10+ && apt update && apt install -y git htop sudo curl wget net-tools jq locales \
1211 build-essential cmake ninja-build valgrind gdb rr doxygen \
1312 clang-${CLANG_VER} clang-tidy-${CLANG_VER} clang-format-${CLANG_VER} clang-tools-${CLANG_VER} \
1413 gcc-${GCC_VER} g++-${GCC_VER} \
15- python3 python3-pip
14+ python3 python3-pip \
15+ libbabeltrace-ctf-dev systemtap-sdt-dev libslang2-dev libelf-dev libunwind-dev libdw-dev libiberty-dev
1616
1717# Set selected clang version as default
1818RUN ln -s /usr/bin/clang-${CLANG_VER} /usr/bin/clang \
@@ -31,6 +31,15 @@ COPY scripts/setup.sh /tmp
3131RUN /tmp/setup.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "true" \
3232 && rm -f /tmp/setup.sh
3333# ################################################################################################
34+ FROM base as perf-builder
35+
36+ RUN export DEBIAN_FRONTEND=noninteractive \
37+ && apt install -y --no-install-recommends gcc-8 g++-8 flex bison
38+ RUN export CC=gcc-8 && export CXX=g++-8 \
39+ && git clone --branch linux-msft-wsl-5.10.y --depth=1 https://github.com/microsoft/WSL2-Linux-Kernel.git /tmp/wsl2-kernel \
40+ && cd /tmp/wsl2-kernel/tools/perf && make
41+
42+ # ################################################################################################
3443FROM base as codechecker-builder
3544
3645RUN export DEBIAN_FRONTEND=noninteractive \
@@ -46,15 +55,24 @@ RUN cd /codechecker \
4655
4756# ################################################################################################
4857FROM base
58+ # Setup perf
59+ COPY --from=perf-builder /tmp/wsl2-kernel/tools/perf/perf /usr/local/bin
4960
5061# Setup CodeChecker
5162COPY --from=codechecker-builder /codechecker/build/CodeChecker /opt/codechecker
5263COPY --from=codechecker-builder /codechecker/analyzer/requirements.txt /opt/codechecker
5364RUN pip3 install -r /opt/codechecker/requirements.txt \
5465 && ln -s /opt/codechecker/bin/CodeChecker /usr/bin/CodeChecker
5566
67+ # Setup flame-graph
68+ RUN git clone --depth=1 https://github.com/brendangregg/FlameGraph /opt/flame-graph
69+
5670# Setup cmake utils
5771COPY scripts/.CodeCheckerIgnore scripts/utils.cmake /opt/cmake-utils/
5872
73+ # Setup profiling script
74+ COPY scripts/cpu-profile.sh /opt
75+ RUN ln -s /opt/cpu-profile.sh /usr/bin/cpu-profile
76+
5977# Cleanup
6078RUN export DEBIAN_FRONTEND=noninteractive && apt autoremove -y
0 commit comments