mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
[CI] Measure what debug info costs a ccache entry
Throwaway diagnostic, not for merge. Adds COCKATRICE_DEBUG_INFO_LEVEL (cache option, empty by default, so local and release builds are unchanged) and runs the Arch debug leg and the Debian 13 release leg cold with -g0 and -g1 against a 6G bound, so the cache size of each configuration can be compared with the 1.2 GB the default flags produce. One Arch configuration costs 1.2 GB with the default flags and a cache bigger than that served 1058 of 1059 calls, so the per-leg bounds cannot hold a build and evict what the next one asks for. This measures whether dropping DWARF is what makes a whole configuration fit.
This commit is contained in:
parent
a1069edd8a
commit
2bf0e3f93a
3 changed files with 73 additions and 59 deletions
|
|
@ -238,6 +238,25 @@ include(Sanitizers)
|
|||
include(Coverage)
|
||||
include(CrashReporting)
|
||||
|
||||
# Debug info is what makes a cached object large. With full DWARF one build configuration
|
||||
# needs more room than a per-leg compiler-cache bound can spare, and ccache then evicts the
|
||||
# entries the next build is about to ask for: the cache fills to its limit and still serves
|
||||
# only a fraction of the calls. CI sets a lower level so that one whole configuration fits a
|
||||
# bound; level 1 keeps file and line, which is what a failing test or a sanitizer backtrace
|
||||
# needs. Empty (the default) leaves local, distro and release builds exactly as they were,
|
||||
# and the append below comes after CrashReporting, so its -g cannot raise the level again.
|
||||
set(COCKATRICE_DEBUG_INFO_LEVEL ""
|
||||
CACHE STRING "DWARF level for Debug and Release objects (empty keeps the built-in flags)"
|
||||
)
|
||||
if(COCKATRICE_DEBUG_INFO_LEVEL)
|
||||
if(MSVC)
|
||||
message(WARNING "COCKATRICE_DEBUG_INFO_LEVEL is ignored on MSVC")
|
||||
else()
|
||||
string(APPEND CMAKE_CXX_FLAGS_DEBUG " -g${COCKATRICE_DEBUG_INFO_LEVEL}")
|
||||
string(APPEND CMAKE_CXX_FLAGS_RELEASE " -g${COCKATRICE_DEBUG_INFO_LEVEL}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# GNU systems need to define the Mersenne exponent for the RNG to compile w/o warning
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
||||
add_definitions("-DSFMT_MEXP=19937")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue