Skip to content

Commit 8d97522

Browse files
committed
profiling: Add WITH_TIMING_COUNTS build option
This replaces the `ENABLE_TIMINGS` #define in `options.h` Since we now support multiple back-ends for timing events, each back-end is expected to be enabled with a `WITH_*` Makefile flag, and then the JL_TIMING API is automatically enabled if any back-end is available. Turning on multiple back-ends at the same time is also supported.
1 parent 391d11e commit 8d97522

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

Make.inc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ WITH_ITTAPI := 0
9595
# Enable Tracy support
9696
WITH_TRACY := 0
9797

98+
# Enable Timing Counts support
99+
WITH_TIMING_COUNTS := 0
100+
98101
# Prevent picking up $ARCH from the environment variables
99102
ARCH:=
100103

@@ -743,6 +746,11 @@ JCFLAGS += -DUSE_TRACY -DTRACY_ENABLE -DTRACY_FIBERS
743746
LIBTRACYCLIENT:=-lTracyClient
744747
endif
745748

749+
ifeq ($(WITH_TIMING_COUNTS), 1)
750+
JCXXFLAGS += -DUSE_TIMING_COUNTS
751+
JCFLAGS += -DUSE_TIMING_COUNTS
752+
endif
753+
746754
# ===========================================================================
747755

748756
# Select the cpu architecture to target, or automatically detects the user's compiler

src/options.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@
7878
// OBJPROFILE counts objects by type
7979
// #define OBJPROFILE
8080

81-
// Automatic Instrumenting Profiler
82-
#define ENABLE_TIMINGS
83-
8481

8582
// method dispatch profiling --------------------------------------------------
8683

src/timing.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ void jl_destroy_timing(void) JL_NOTSAFEPOINT;
2020
#define HAVE_TIMING_SUPPORT
2121
#endif
2222

23+
#if defined( USE_TRACY ) || defined( USE_TIMING_COUNTS )
24+
#define ENABLE_TIMINGS
25+
#endif
26+
2327
#if !defined( ENABLE_TIMINGS ) || !defined( HAVE_TIMING_SUPPORT )
2428

2529
#define JL_TIMING(subsystem, event)

0 commit comments

Comments
 (0)