Skip to content

Commit a98dfab

Browse files
committed
profiler
1 parent 2219a8e commit a98dfab

File tree

9 files changed

+312
-127
lines changed

9 files changed

+312
-127
lines changed

src/hotspot/share/logging/logTag.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ class outputStream;
167167
LOG_TAG(preempt) \
168168
LOG_TAG(preorder) /* Trace all classes loaded in order referenced (not loaded) */ \
169169
LOG_TAG(preview) /* Trace loading of preview feature types */ \
170+
LOG_TAG(profile) \
170171
LOG_TAG(profiling) \
171172
LOG_TAG(promotion) \
172173
LOG_TAG(protectiondomain) /* "Trace protection domain verification" */ \

src/hotspot/share/runtime/frame.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,22 @@ bool frame::is_safepoint_blob_frame() const {
262262
return (_cb != nullptr && _cb->is_safepoint_stub());
263263
}
264264

265+
bool frame::is_exception_blob_frame() const {
266+
return (_cb != nullptr && _cb->is_exception_stub());
267+
}
268+
269+
bool frame::is_deoptimization_blob_frame() const {
270+
return (_cb != nullptr && _cb->is_deoptimization_stub());
271+
}
272+
273+
bool frame::is_uncommon_trap_blob_frame() const {
274+
return (_cb != nullptr && _cb->is_uncommon_trap_stub());
275+
}
276+
277+
//_cb->is_adapter_blob()
278+
//_cb->is_vtable_blob()
279+
//_cb->is_method_handles_adapter_blob()
280+
265281
// testers
266282

267283
bool frame::is_first_java_frame() const {

src/hotspot/share/runtime/frame.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ class frame {
192192
bool is_runtime_frame() const;
193193
bool is_compiled_frame() const;
194194
bool is_safepoint_blob_frame() const;
195+
bool is_exception_blob_frame() const;
196+
bool is_deoptimization_blob_frame() const;
197+
bool is_uncommon_trap_blob_frame() const;
195198
bool is_deoptimized_frame() const;
196199
bool is_upcall_stub_frame() const;
197200
bool is_heap_frame() const { return _on_heap; }

src/hotspot/share/runtime/thread.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ Thread::Thread(MemTag mem_tag) {
142142
_profile_vm_ops = false;
143143
_profile_rt_calls = false;
144144
_profile_upcalls = false;
145+
_profile_execution = false;
145146

146147
_all_bc_counter_value = 0;
147148
_clinit_bc_counter_value = 0;

src/hotspot/share/runtime/thread.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ class Thread: public ThreadShadow {
636636
bool _profile_vm_ops;
637637
bool _profile_rt_calls;
638638
bool _profile_upcalls;
639+
bool _profile_execution;
639640

640641
jlong _all_bc_counter_value;
641642
jlong _clinit_bc_counter_value;
@@ -657,6 +658,9 @@ class Thread: public ThreadShadow {
657658
bool profile_upcalls() const { return _profile_upcalls; }
658659
void set_profile_upcalls(bool v) { _profile_upcalls = v; }
659660

661+
bool profile_execution() const { return _profile_execution; }
662+
void set_profile_execution(bool v) { _profile_execution = v; }
663+
660664
PerfTraceTime* current_rt_call_timer() const { return _current_rt_call_timer; }
661665
void set_current_rt_call_timer(PerfTraceTime* c) { _current_rt_call_timer = c; }
662666
bool has_current_rt_call_timer() const { return _current_rt_call_timer != nullptr; }

src/hotspot/share/runtime/threads.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,13 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
802802
}
803803
}
804804

805+
if (log_is_enabled(Info, thermostat) || log_is_enabled(Info, profile)) {
806+
main_thread->set_profile_execution(true);
807+
}
808+
809+
// Start the VMThermostat thread
810+
VMThermostat::initialize();
811+
805812
// Launch -Xrun agents if EagerXrunInit is not set.
806813
if (!EagerXrunInit) {
807814
JvmtiAgentList::load_xrun_agents();
@@ -990,9 +997,6 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
990997
}
991998
}
992999

993-
// Start the VMThermostat thread
994-
VMThermostat::initialize();
995-
9961000
return JNI_OK;
9971001
}
9981002

src/hotspot/share/runtime/vframeArray.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ void vframeArray::fill_in(JavaThread* thread,
579579
// in frame_amd64.cpp and the values of the phantom high half registers
580580
// in amd64.ad.
581581
// if (VMReg::Name(i) < SharedInfo::stack0 && is_even(i)) {
582-
intptr_t* src = (intptr_t*) reg_map->location(VMRegImpl::as_VMReg(i), _caller.sp());
582+
intptr_t* src = (intptr_t*) reg_map->location(VMRegImpl::as_VMReg(i), _caller_mode.sp());
583583
_callee_registers[i] = src != nullptr ? *src : NULL_WORD;
584584
// } else {
585585
// jint* src = (jint*) reg_map->location(VMReg::Name(i));

0 commit comments

Comments
 (0)