Skip to content

Commit ccc98bc

Browse files
committed
Rebuilding libkqueue from source with debug symbols required for profiling
1 parent 1430da5 commit ccc98bc

2 files changed

Lines changed: 50 additions & 2 deletions

File tree

scripts/docker/build/ubuntu24/Dockerfile.prof

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,37 @@ RUN apt-get update && \
6161
apt-get clean && \
6262
rm -r /var/lib/apt/lists/*
6363

64+
#
65+
# Rebuild libkqueue from source with full debug info so callgrind can resolve
66+
# its internal symbols (kevent, kqueue_close, etc.) instead of showing ???.
67+
# The pre-built package from the NetworkRADIUS extras repo ships without debug
68+
# symbols, causing all libkqueue call sites to appear as unresolved addresses.
69+
#
70+
RUN apt-get update && \
71+
apt-get install -y $APT_OPTS --no-install-recommends cmake git && \
72+
apt-get clean && \
73+
rm -r /var/lib/apt/lists/* && \
74+
git clone --depth 1 https://github.com/mheily/libkqueue.git /tmp/libkqueue && \
75+
cd /tmp/libkqueue && \
76+
cmake -G "Unix Makefiles" \
77+
-DCMAKE_INSTALL_PREFIX=/usr \
78+
-DCMAKE_INSTALL_LIBDIR=lib \
79+
-DCMAKE_C_FLAGS="-g3 -O0 -fno-omit-frame-pointer" \
80+
-DCMAKE_BUILD_TYPE=Debug \
81+
. && \
82+
make && \
83+
cpack -G DEB && \
84+
dpkg -i *.deb && \
85+
cd / && rm -rf /tmp/libkqueue
86+
6487
#
6588
# Install FlameGraph scripts
6689
#
6790
RUN git clone --depth 1 https://github.com/brendangregg/FlameGraph /opt/flamegraph \
6891
&& chmod +x /opt/flamegraph/*.pl /opt/flamegraph/*.sh
6992

70-
ENV PATH="/opt/flamegraph:${PATH}"
93+
ENV PATH="/opt/flamegraph:${PATH}" \
94+
DEBUGINFOD_URLS="https://debuginfod.ubuntu.com"
7195

7296
#
7397
# Install Inferno for callgrind → folded conversion

scripts/docker/m4/profiling.deb.m4

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,37 @@ RUN apt-get update && \
5656
apt-get clean && \
5757
rm -r /var/lib/apt/lists/*
5858

59+
#
60+
# Rebuild libkqueue from source with full debug info so callgrind can resolve
61+
# its internal symbols (kevent, kqueue_close, etc.) instead of showing ???.
62+
# The pre-built package from the NetworkRADIUS extras repo ships without debug
63+
# symbols, causing all libkqueue call sites to appear as unresolved addresses.
64+
#
65+
RUN apt-get update && \
66+
apt-get install -y $APT_OPTS --no-install-recommends cmake git && \
67+
apt-get clean && \
68+
rm -r /var/lib/apt/lists/* && \
69+
git clone --depth 1 https://github.com/mheily/libkqueue.git /tmp/libkqueue && \
70+
cd /tmp/libkqueue && \
71+
cmake -G "Unix Makefiles" \
72+
-DCMAKE_INSTALL_PREFIX=/usr \
73+
-DCMAKE_INSTALL_LIBDIR=lib \
74+
-DCMAKE_C_FLAGS="-g3 -O0 -fno-omit-frame-pointer" \
75+
-DCMAKE_BUILD_TYPE=Debug \
76+
. && \
77+
make && \
78+
cpack -G DEB && \
79+
dpkg -i *.deb && \
80+
cd / && rm -rf /tmp/libkqueue
81+
5982
#
6083
# Install FlameGraph scripts
6184
#
6285
RUN git clone --depth 1 https://github.com/brendangregg/FlameGraph /opt/flamegraph \
6386
&& chmod +x /opt/flamegraph/*.pl /opt/flamegraph/*.sh
6487

65-
ENV PATH="/opt/flamegraph:${PATH}"
88+
ENV PATH="/opt/flamegraph:${PATH}" \
89+
DEBUGINFOD_URLS="https://debuginfod.ubuntu.com"
6690

6791
#
6892
# Install Inferno for callgrind → folded conversion

0 commit comments

Comments
 (0)