Fix code for bugprone-argument-comment clang-tidy warning
After clang-r498229, we got the below error:
art/runtime/instrumentation.cc:723:29: error: argument name 'force_deopt' in comment
does not match parameter name 'deopt_all_frames' [bugprone-argument-comment,-warnings-as-errors]
InstrumentAllThreadStacks(/* force_deopt= */ true);
^
Bug: 285008446
Test: build with WITH_TIDY=1
Change-Id: Iddc9e4574cc6402d102bdcf6b5941fe7f6630bd2
diff --git a/openjdkjvmti/deopt_manager.cc b/openjdkjvmti/deopt_manager.cc
index 978843c..025bed5 100644
--- a/openjdkjvmti/deopt_manager.cc
+++ b/openjdkjvmti/deopt_manager.cc
@@ -510,9 +510,8 @@
// Prepare the stack so methods can be deoptimized as and when required.
// This by itself doesn't cause any methods to deoptimize but enables
// deoptimization on demand.
- art::Runtime::Current()->GetInstrumentation()->InstrumentThreadStack(
- target,
- /* deopt_all_frames= */ false);
+ art::Runtime::Current()->GetInstrumentation()->InstrumentThreadStack(target,
+ /* force_deopt= */ false);
}
extern DeoptManager* gDeoptManager;
diff --git a/openjdkjvmti/ti_heap.cc b/openjdkjvmti/ti_heap.cc
index 4be7922..662f464 100644
--- a/openjdkjvmti/ti_heap.cc
+++ b/openjdkjvmti/ti_heap.cc
@@ -1780,7 +1780,7 @@
// already have.
// TODO We technically only need to do this if the frames are not already being interpreted.
// The cost for doing an extra stack walk is unlikely to be worth it though.
- instr->InstrumentThreadStack(t, /* deopt_all_frames= */ true);
+ instr->InstrumentThreadStack(t, /* force_deopt= */ true);
}
}
}
diff --git a/runtime/instrumentation.h b/runtime/instrumentation.h
index 7676080..fde3f1a 100644
--- a/runtime/instrumentation.h
+++ b/runtime/instrumentation.h
@@ -557,9 +557,9 @@
// example, after updating local variables)
// - to call method entry / exit hooks for tracing. For this we instrument
// the stack frame to run entry / exit hooks but we don't need to deoptimize.
- // deopt_all_frames indicates whether the frames need to deoptimize or not.
- void InstrumentThreadStack(Thread* thread, bool deopt_all_frames) REQUIRES(Locks::mutator_lock_);
- void InstrumentAllThreadStacks(bool deopt_all_frames) REQUIRES(Locks::mutator_lock_)
+ // force_deopt indicates whether the frames need to deoptimize or not.
+ void InstrumentThreadStack(Thread* thread, bool force_deopt) REQUIRES(Locks::mutator_lock_);
+ void InstrumentAllThreadStacks(bool force_deopt) REQUIRES(Locks::mutator_lock_)
REQUIRES(!Locks::thread_list_lock_);
// Force all currently running frames to be deoptimized back to interpreter. This should only be
diff --git a/test/2011-stack-walk-concurrent-instrument/stack_walk_concurrent.cc b/test/2011-stack-walk-concurrent-instrument/stack_walk_concurrent.cc
index 78bb772..ae1d830 100644
--- a/test/2011-stack-walk-concurrent-instrument/stack_walk_concurrent.cc
+++ b/test/2011-stack-walk-concurrent-instrument/stack_walk_concurrent.cc
@@ -88,7 +88,7 @@
CHECK(other != nullptr);
ScopedSuspendAll ssa(__FUNCTION__);
Runtime::Current()->GetInstrumentation()->InstrumentThreadStack(other,
- /* deopt_all_frames= */ false);
+ /* force_deopt= */ false);
bool resumed = art::Runtime::Current()->GetThreadList()->Resume(other, SuspendReason::kInternal);
CHECK(resumed);
instrumented = true;