Skip to content

Commit a091c87

Browse files
committed
fixup! fix: exclude paused sections from instrumentation measurement
1 parent 3212716 commit a091c87

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

core/include/measurement.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ inline void measurement_set_metadata() {
5656
instrument_hooks_write_environment(g_hooks, getpid());
5757
}
5858

59+
#ifdef CODSPEED_ANALYSIS
60+
// inline (C++17) so every translation unit shares one definition; a static
61+
// would give each TU its own copy and silently desync the toggle parity.
62+
inline bool measurement_collecting = true;
63+
#endif
64+
5965
ALWAYS_INLINE void measurement_start() {
6066
instrument_hooks_start_benchmark_inline(g_hooks);
6167
}
@@ -89,8 +95,6 @@ ALWAYS_INLINE void measurement_add_benchmark_timestamps(uint64_t start,
8995
}
9096

9197
#ifdef CODSPEED_ANALYSIS
92-
static bool measurement_collecting = true;
93-
9498
ALWAYS_INLINE void measurement_pause_timing() {
9599
if (measurement_collecting) {
96100
callgrind_toggle_collect();

0 commit comments

Comments
 (0)