]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Docker: Support trace-cmd
authorSimon Glass <sjg@chromium.org>
Sun, 15 Jan 2023 21:15:59 +0000 (14:15 -0700)
committerTom Rini <trini@konsulko.com>
Sat, 11 Feb 2023 17:22:35 +0000 (12:22 -0500)
Build trace-cmd as part of the docker image, so that trace tests can be
used. Unfortunately the version provided by distributions is a little old
and has bugs. It also does not support specifying the time base for the
trace, which is required to convert microseconds to nanaseconds.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/docker/Dockerfile

index 3d5a9a074472eb2886deea51d0b66848023523b9..aa19d924cc801fe3c8dfeda896d890ed48f98490 100644 (file)
@@ -213,6 +213,22 @@ RUN git clone https://github.com/stefanberger/swtpm /tmp/swtpm && \
        make install && \
        rm -rf /tmp/swtpm
 
+# Build trace-cmd
+RUN mkdir /tmp/trace && \
+    git clone https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git /tmp/trace/libtraceevent && \
+    cd /tmp/trace/libtraceevent && \
+    make -j$(nproc) && \
+    sudo make install && \
+    git clone https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git /tmp/trace/libtracefs && \
+    cd /tmp/trace/libtracefs && \
+    make -j$(nproc) && \
+    sudo make install && \
+    git clone https://github.com/rostedt/trace-cmd.git /tmp/trace/trace-cmd && \
+    cd /tmp/trace/trace-cmd && \
+    make -j$(nproc) && \
+    sudo make install && \
+    rm -rf /tmp/trace
+
 # Create our user/group
 RUN echo uboot ALL=NOPASSWD: ALL > /etc/sudoers.d/uboot
 RUN useradd -m -U uboot