Skip to content

Commit e37d1f8

Browse files
committed
going back to using -O1 instead of -O0 when building profiling image
1 parent dbdda21 commit e37d1f8

1 file changed

Lines changed: 10 additions & 17 deletions

File tree

src/tests/multi-server/scripts/docker/build/Dockerfile.multi-server-prof

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,20 @@ RUN autoreconf
1616

1717
# CFLAGS used for profiling build:
1818
# -g3 Maximum debug info for callgrind symbol resolution
19-
# -O0 No optimisation: preserves the exact call structure of the source.
20-
# Disables dead-code elimination, tail-call optimisation, and all
21-
# other transforms that remove or reorder calls.
22-
# -fno-omit-frame-pointer Keep frame pointers so callgrind can walk the call stack
23-
# -fno-inline Disable inlining (including CC_HINT(flatten)) so call edges appear in the graph
24-
# -Dalways_inline= Strip __attribute__((always_inline)) which -fno-inline does not suppress
25-
# -fno-plt Eliminate PLT trampolines on cross-library calls (e.g. worker.c ->
26-
# interpret.c). Without this, the linker inserts a PLT stub with no
27-
# DWARF debug info, which appears as an unresolved "???" node in the
28-
# callgrind call graph. With -fno-plt, the compiler generates a direct
29-
# GOT-based indirect call that callgrind resolves correctly.
30-
# -fno-builtin Prevent replacement of standard library calls (memcpy, strlen, etc.)
31-
# with inline intrinsics, which would erase them from the call graph.
32-
# -fno-optimize-sibling-calls Prevent tail-call elimination converting call+ret into a jump,
33-
# which removes the call edge from the call graph. Already implied
34-
# by -O0 but stated explicitly as a safeguard.
19+
# -O1 Basic optimisation for realistic hotspot costs; inlining/vectorisation/
20+
# unrolling disabled below so the call graph matches the source.
21+
# -fno-omit-frame-pointer Keep frame pointers for callgrind stack walking
22+
# -fno-inline Preserve call edges (suppresses CC_HINT(flatten) too)
23+
# -Dalways_inline= Strip always_inline, which -fno-inline does not suppress
24+
# -fno-plt Resolve cross-library calls via GOT rather than PLT stubs;
25+
# PLT stubs have no DWARF info and show as ??? in callgrind.
26+
# -fno-builtin Keep stdlib calls (memcpy, strlen, etc.) visible in the graph
27+
# -fno-optimize-sibling-calls Suppress tail-call elimination (-O1 can still apply it)
3528
RUN ./configure \
3629
--enable-developer \
3730
--disable-verify-ptr \
3831
--with-raddbdir=/etc/freeradius \
39-
CFLAGS="-g3 -O0 -fno-omit-frame-pointer -fno-inline -Dalways_inline= -fno-plt -fno-builtin -fno-optimize-sibling-calls" \
32+
CFLAGS="-g3 -O1 -fno-omit-frame-pointer -fno-inline -Dalways_inline= -fno-plt -fno-builtin -fno-optimize-sibling-calls" \
4033
LDFLAGS="-fno-omit-frame-pointer"
4134

4235
RUN make

0 commit comments

Comments
 (0)