Skip to content

Commit

Permalink
profiling: Add WITH_TIMING_COUNTS build option
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
topolarity committed Apr 5, 2023
1 parent 391d11e commit 8d97522
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
8 changes: 8 additions & 0 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ WITH_ITTAPI := 0
# Enable Tracy support
WITH_TRACY := 0

# Enable Timing Counts support
WITH_TIMING_COUNTS := 0

# Prevent picking up $ARCH from the environment variables
ARCH:=

Expand Down Expand Up @@ -743,6 +746,11 @@ JCFLAGS += -DUSE_TRACY -DTRACY_ENABLE -DTRACY_FIBERS
LIBTRACYCLIENT:=-lTracyClient
endif

ifeq ($(WITH_TIMING_COUNTS), 1)
JCXXFLAGS += -DUSE_TIMING_COUNTS
JCFLAGS += -DUSE_TIMING_COUNTS
endif

# ===========================================================================

# Select the cpu architecture to target, or automatically detects the user's compiler
Expand Down
3 changes: 0 additions & 3 deletions src/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@
// OBJPROFILE counts objects by type
// #define OBJPROFILE

// Automatic Instrumenting Profiler
#define ENABLE_TIMINGS


// method dispatch profiling --------------------------------------------------

Expand Down
4 changes: 4 additions & 0 deletions src/timing.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ void jl_destroy_timing(void) JL_NOTSAFEPOINT;
#define HAVE_TIMING_SUPPORT
#endif

#if defined( USE_TRACY ) || defined( USE_TIMING_COUNTS )
#define ENABLE_TIMINGS
#endif

#if !defined( ENABLE_TIMINGS ) || !defined( HAVE_TIMING_SUPPORT )

#define JL_TIMING(subsystem, event)
Expand Down

0 comments on commit 8d97522

Please sign in to comment.