Skip to content

Commit

Permalink
Do not show 'GC_active' for compiler threads
Browse files Browse the repository at this point in the history
  • Loading branch information
apangin committed Jan 9, 2022
1 parent 4ba7524 commit ce91abe
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ enum StackRecovery {
POP_FRAME = 0x4,
SCAN_STACK = 0x8,
LAST_JAVA_PC = 0x10,
GC_TRACES = 0x20, // not used anymore
GC_TRACES = 0x20,
JAVA_STATE = 0x40,
MAX_RECOVERY = 0x7f
};
Expand Down Expand Up @@ -451,6 +451,11 @@ int Profiler::getJavaTraceAsync(void* ucontext, ASGCT_CallFrame* frames, int max
pc = saved_pc;
}
}
} else if (trace.num_frames == ticks_GC_active && !(_safe_mode & GC_TRACES)) {
if (vm_thread->lastJavaSP() == 0) {
// Do not add 'GC_active' for threads with no Java frames, e.g. Compiler threads
return 0;
}
}

if (trace.num_frames > 0) {
Expand Down Expand Up @@ -980,7 +985,7 @@ Error Profiler::start(Arguments& args, bool reset) {

_safe_mode = args._safe_mode;
if (VM::hotspot_version() < 8) {
_safe_mode |= LAST_JAVA_PC;
_safe_mode |= GC_TRACES | LAST_JAVA_PC;
}

_add_thread_frame = args._threads && args._output != OUTPUT_JFR;
Expand Down

0 comments on commit ce91abe

Please sign in to comment.