Skip to content

Commit 0e8adb7

Browse files
committed
Move heap plot config to timing.c, remove old heap plot code
1 parent 7a3cbd0 commit 0e8adb7

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

src/gc.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3095,10 +3095,6 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection)
30953095
{
30963096
combine_thread_gc_counts(&gc_num);
30973097

3098-
#ifdef USE_TRACY
3099-
TracyCPlot("Heap size", live_bytes + gc_num.allocd);
3100-
#endif
3101-
31023098
jl_gc_markqueue_t *mq = &ptls->mark_queue;
31033099

31043100
uint64_t gc_start_time = jl_hrtime();
@@ -3488,10 +3484,6 @@ JL_DLLEXPORT void jl_gc_collect(jl_gc_collection_t collection)
34883484
SetLastError(last_error);
34893485
#endif
34903486
errno = last_errno;
3491-
3492-
#ifdef USE_TRACY
3493-
TracyCPlot("Heap size", jl_gc_live_bytes());
3494-
#endif
34953487
}
34963488

34973489
void gc_mark_queue_all_roots(jl_ptls_t ptls, jl_gc_markqueue_t *mq)
@@ -3595,9 +3587,6 @@ void jl_gc_init(void)
35953587
if (jl_options.heap_size_hint)
35963588
jl_gc_set_max_memory(jl_options.heap_size_hint);
35973589

3598-
#ifdef USE_TRACY
3599-
TracyCPlotConfig("Heap size", TracyPlotFormatMemory, /* rectilinear */ 0, /* fill */ 1, /* color */ 0);
3600-
#endif
36013590
t_start = jl_hrtime();
36023591
}
36033592

src/timing.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ void jl_init_timing(void)
105105
TracyCPlotConfig(jl_timing_counters[i++].tracy_counter.name, TracyPlotFormatNumber, /* rectilinear */ 1, /* fill */ 1, /* color */ 0);
106106
JL_TIMING_COUNTERS
107107
#undef X
108+
// We reference these by enum indexing and then asking for the name, since that allows the compiler
109+
// to catch name mismatches.
110+
TracyCPlotConfig(jl_timing_counters[JL_TIMING_COUNTER_HeapSize].tracy_counter.name, TracyPlotFormatMemory, /* rectilinear */ 0, /* fill */ 1, /* color */ 0);
108111
#endif
109112
}
110113

0 commit comments

Comments
 (0)