diff options
-rw-r--r-- | runtime/monitor.cc | 10 | ||||
-rw-r--r-- | runtime/monitor.h | 7 | ||||
-rw-r--r-- | runtime/monitor_android.cc | 11 | ||||
-rw-r--r-- | runtime/monitor_linux.cc | 2 |
4 files changed, 17 insertions, 13 deletions
diff --git a/runtime/monitor.cc b/runtime/monitor.cc index bb33047895..18a6fc4d34 100644 --- a/runtime/monitor.cc +++ b/runtime/monitor.cc @@ -437,17 +437,11 @@ void Monitor::Lock(Thread* self) { << " in " << ArtMethod::PrettyMethod(m) << " for " << PrettyDuration(MsToNs(wait_ms)); } - const char* owners_filename; - int32_t owners_line_number; - TranslateLocation(owners_method, - owners_dex_pc, - &owners_filename, - &owners_line_number); LogContentionEvent(self, wait_ms, sample_percent, - owners_filename, - owners_line_number); + owners_method, + owners_dex_pc); } } } diff --git a/runtime/monitor.h b/runtime/monitor.h index e80d31cdd5..6dc706f8b8 100644 --- a/runtime/monitor.h +++ b/runtime/monitor.h @@ -181,8 +181,11 @@ class Monitor { REQUIRES_SHARED(Locks::mutator_lock_) NO_THREAD_SAFETY_ANALYSIS; // For m->Install(self) - void LogContentionEvent(Thread* self, uint32_t wait_ms, uint32_t sample_percent, - const char* owner_filename, int32_t owner_line_number) + void LogContentionEvent(Thread* self, + uint32_t wait_ms, + uint32_t sample_percent, + ArtMethod* owner_method, + uint32_t owner_dex_pc) REQUIRES_SHARED(Locks::mutator_lock_); static void FailedUnlock(mirror::Object* obj, diff --git a/runtime/monitor_android.cc b/runtime/monitor_android.cc index 1dd60f8d78..a5978523e9 100644 --- a/runtime/monitor_android.cc +++ b/runtime/monitor_android.cc @@ -49,8 +49,15 @@ static char* EventLogWriteString(char* dst, const char* value, size_t len) { return dst + len; } -void Monitor::LogContentionEvent(Thread* self, uint32_t wait_ms, uint32_t sample_percent, - const char* owner_filename, int32_t owner_line_number) { +void Monitor::LogContentionEvent(Thread* self, + uint32_t wait_ms, + uint32_t sample_percent, + ArtMethod* owner_method, + uint32_t owner_dex_pc) { + const char* owner_filename; + int32_t owner_line_number; + TranslateLocation(owner_method, owner_dex_pc, &owner_filename, &owner_line_number); + // Emit the event list length, 1 byte. char eventBuffer[174]; char* cp = eventBuffer; diff --git a/runtime/monitor_linux.cc b/runtime/monitor_linux.cc index 1c77ac0eb3..667866149b 100644 --- a/runtime/monitor_linux.cc +++ b/runtime/monitor_linux.cc @@ -18,7 +18,7 @@ namespace art { -void Monitor::LogContentionEvent(Thread*, uint32_t, uint32_t, const char*, int32_t) { +void Monitor::LogContentionEvent(Thread*, uint32_t, uint32_t, ArtMethod*, uint32_t) { } } // namespace art |