Skip to content

Commit f3706fa

Browse files
author
Alex Rønne Petersen
committed
[profiler] Report GC roots outside of heapshots unless the nodefaults option is given.
1 parent 16cf089 commit f3706fa

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

mono/profiler/log-args.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ parse_arg (const char *arg, ProfilerConfig *config)
6969
//enables new style of default events, IE, nothing.
7070
} else {
7171
config->enable_mask = PROFLOG_EXCEPTION_EVENTS | PROFLOG_COUNTER_EVENTS;
72+
config->always_do_root_report = TRUE;
7273
compat_args_parsing = TRUE;
7374
}
7475
}

mono/profiler/log.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,8 @@ gc_event (MonoProfiler *profiler, MonoProfilerGCEvent ev, uint32_t generation)
12851285
if (mono_atomic_load_i32 (&log_profiler.heapshot_requested))
12861286
log_profiler.do_heap_walk = TRUE;
12871287

1288-
if (ENABLED (PROFLOG_GC_ROOT_EVENTS) && log_profiler.do_heap_walk)
1288+
if (ENABLED (PROFLOG_GC_ROOT_EVENTS) &&
1289+
(log_config.always_do_root_report || log_profiler.do_heap_walk))
12891290
mono_profiler_set_gc_roots_callback (log_profiler.handle, gc_roots);
12901291

12911292
/*

mono/profiler/log.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,9 @@ typedef struct {
512512
// Heapshot frequency in number of collections (for MONO_HEAPSHOT_X_GC). Can be changed at runtime.
513513
unsigned int hs_freq_gc;
514514

515+
// Should root reports be done even outside of heapshots?
516+
gboolean always_do_root_report;
517+
515518
// Whether to do a heapshot on shutdown.
516519
gboolean hs_on_shutdown;
517520

0 commit comments

Comments
 (0)