hotspot/src/share/vm/services/dtraceAttacher.cpp
// Enable only the "fine grained" flags. Do *not* touch
// the overall "ExtendedDTraceProbes" flag.
void DTrace::enable_dprobes(int probes) {
{- -------------------------------------------
(1) (変数宣言など)
---------------------------------------- -}
bool changed = false;
{- -------------------------------------------
(1) probes 引数の値に応じて, 以下のコマンドラインオプションの値を true に変更する.
(なお, 元々 true だった場合は, probes 引数の値に関わらず, 変更処理は省略する)
* DTraceAllocProbes
* DTraceMethodProbes
* DTraceMonitorProbes
---------------------------------------- -}
if (!DTraceAllocProbes && (probes & DTRACE_ALLOC_PROBES)) {
set_bool_flag("DTraceAllocProbes", true);
changed = true;
}
if (!DTraceMethodProbes && (probes & DTRACE_METHOD_PROBES)) {
set_bool_flag("DTraceMethodProbes", true);
changed = true;
}
if (!DTraceMonitorProbes && (probes & DTRACE_MONITOR_PROBES)) {
set_bool_flag("DTraceMonitorProbes", true);
changed = true;
}
{- -------------------------------------------
(1) もしオプションの値を1つでも変更していたら,
VM_DeoptimizeTheWorld で全ての nmethod を deoptimize する.
---------------------------------------- -}
if (changed) {
// one or more flags changed, need to deoptimize
VM_DeoptimizeTheWorld op;
VMThread::execute(&op);
}
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.