Skip to content

Commit d27a224

Browse files
committed
WIP: minor updates
1 parent 93a757c commit d27a224

4 files changed

Lines changed: 46 additions & 14 deletions

File tree

scripts/docker/build/ubuntu24/Dockerfile.cb

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,34 @@ RUN apt-get update && \
3232
rm -r /var/lib/apt/lists/*
3333

3434

35+
#
36+
# Install profiling tools
37+
#
38+
RUN apt-get update && \
39+
apt-get install $APT_OPTS \
40+
libgoogle-perftools-dev \
41+
google-perftools \
42+
valgrind \
43+
heaptrack \
44+
psmisc \
45+
kcachegrind \
46+
kio \
47+
libkf5iconthemes5 \
48+
libkf5parts5 \
49+
libkf5textwidgets5 \
50+
libqt5gui5 \
51+
libqt5widgets5 && \
52+
apt-get clean && \
53+
rm -r /var/lib/apt/lists/*
54+
55+
#
56+
# Install FlameGraph scripts
57+
#
58+
RUN git clone --depth 1 https://github.com/brendangregg/FlameGraph /opt/flamegraph \
59+
&& chmod +x /opt/flamegraph/*.pl /opt/flamegraph/*.sh
60+
61+
ENV PATH="/opt/flamegraph:${PATH}"
62+
3563
#
3664
# Set up NetworkRADIUS extras repository
3765
#
@@ -81,12 +109,15 @@ RUN git clone --depth 1 --no-single-branch ${source}
81109

82110
#
83111
# Install build dependencies for all branches from v4 onwards
112+
# Debian sid fails if debian/control doesn't exist due to an issue
113+
# in one of the included make files, so we create a blank file.
84114
#
85115
WORKDIR freeradius-server
86116
RUN for i in $(git for-each-ref --format='%(refname:short)' refs/remotes/origin 2>/dev/null | sed -e 's#origin/##' | egrep "^(v[4-9]*\.[0-9x]*\.x|master|${branch})$" | sort -u); \
87117
do \
88118
git checkout $i; \
89119
if [ -e ./debian/control.in ] ; then \
120+
touch -t 202001010000 debian/control; \
90121
debian/rules debian/control ; \
91122
fi ; \
92123
mk-build-deps -irt"apt-get -o Debug::pkgProblemResolver=yes $APT_OPTS" debian/control ; \

scripts/docker/crossbuild.mk

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ endif
4141
CB_IPREFIX:=freeradius40x-build
4242
CB_CPREFIX:=fr40x-crossbuild-
4343

44-
PROFILING_PROFILE ?= valgrind-callgrind
44+
PROFILE ?= valgrind-callgrind
4545

4646
#
4747
# This Makefile is included in-line, and not via the "boilermake"
@@ -94,21 +94,21 @@ crossbuild.help: crossbuild.info
9494
@echo " crossbuild.IMAGE.wipe - remove Docker image"
9595
@echo ""
9696
@echo "Profiling targets:"
97-
@echo " crossbuild.IMAGE.profregen - regenerate Dockerfile.prof using default profile ($(PROFILING_PROFILE))"
98-
@echo " crossbuild.IMAGE.profregen PROFILING_PROFILE=<name> - regenerate using a specific profile"
99-
@echo " crossbuild.IMAGE.profbuild - build profiling image using default profile ($(PROFILING_PROFILE))"
100-
@echo " crossbuild.IMAGE.profbuild PROFILING_PROFILE=<name> - build using a specific profile"
97+
@echo " crossbuild.IMAGE.profregen - regenerate Dockerfile.prof using default profile ($(PROFILE))"
98+
@echo " crossbuild.IMAGE.profregen PROFILE=<name> - regenerate using a specific profile"
99+
@echo " crossbuild.IMAGE.profbuild - build profiling image using default profile ($(PROFILE))"
100+
@echo " crossbuild.IMAGE.profbuild PROFILE=<name> - build using a specific profile"
101101
@echo ""
102102
@echo "Available profiling profiles (scripts/docker/profiling/profiles/):"
103103
@echo " valgrind-callgrind - callgrind call graph and instruction profiling"
104104
@echo " valgrind-massif - FUTURE: massif heap memory profiling"
105105
@echo " gperftools-cpu - FUTURE: gperftools CPU profiling"
106106
@echo ""
107-
@echo "Profiling image profregen/profbuild examples:"
107+
@echo "Profiling examples:"
108108
@echo " make crossbuild.ubuntu24.profregen"
109-
@echo " make crossbuild.ubuntu24.profregen PROFILING_PROFILE=valgrind-callgrind"
109+
@echo " make crossbuild.ubuntu24.profregen PROFILE=valgrind-callgrind"
110110
@echo " make crossbuild.ubuntu24.profbuild"
111-
@echo " make crossbuild.ubuntu24.profbuild PROFILING_PROFILE=gperftools-cpu"
111+
@echo " make crossbuild.ubuntu24.profbuild PROFILE=gperftools-cpu"
112112
@echo ""
113113
@echo "Use 'make NOCACHE=1 ...' to disregard the Docker cache on build"
114114

@@ -169,9 +169,9 @@ crossbuild.${1}.profbuild: $(DD)/stamp-image.${1}-profbuild
169169
$(DD)/stamp-image.${1}-profbuild: $(DT)/${1}/Dockerfile.prof
170170
${Q}echo "BUILD ${1} ($(CB_IPREFIX)/${1}-prof) > $(DD)/build.${1}-profbuild"
171171
${Q}docker build $(DOCKER_BUILD_OPTS) . \
172-
-f $(DT)/${1}/Dockerfile.prof \
173-
-t $(CB_IPREFIX)/${1}-prof \
174-
>$(DD)/build.${1}-profbuild 2>&1
172+
-f $(DT)/${1}/Dockerfile.prof \
173+
-t $(CB_IPREFIX)/${1}-prof \
174+
>$(DD)/build.${1}-profbuild 2>&1
175175
${Q}touch $(DD)/stamp-image.${1}-profbuild
176176

177177
#
@@ -295,7 +295,7 @@ $(DT)/${1}/Dockerfile.prof: $(DOCKER_TMPL) $(CB_DIR)/m4/profiling.deb.m4 $(CB_DI
295295
-D D_NAME=${1} \
296296
-D D_TYPE=profiling \
297297
-D CB_IMAGE=$(CB_IPREFIX)/${1} \
298-
-D PROFILING_PROFILE_NAME=$(PROFILING_PROFILE) \
298+
-D PROFILE_NAME=$(PROFILE) \
299299
$$< > $$@
300300

301301
#

scripts/docker/m4/profiling.deb.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ARG from=CB_IMAGE
22
FROM ${from}
33

44
# Copy profiling profile scripts into the container
5-
COPY scripts/docker/profiling/profiles/PROFILING_PROFILE_NAME /profiling
5+
COPY scripts/docker/profiling/profiles/PROFILE_NAME /profiling
66

77
RUN /profiling/configure-cmd
88
RUN make

scripts/docker/m4/profiling.rpm.m4

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ ARG from=CB_IMAGE
22
FROM ${from}
33

44
# Copy profiling profile scripts into the container
5-
COPY /scripts/docker/profiling/profiles/PROFILING_PROFILE_NAME /profiling
5+
COPY scripts/docker/profiling/profiles/PROFILE_NAME /profiling
66

77
RUN /profiling/configure-cmd
88
RUN make
9+
RUN make install
910

1011
WORKDIR /
1112
COPY scripts/docker/etc/docker-entrypoint.sh.PKG_TYPE docker-entrypoint.sh

0 commit comments

Comments
 (0)