Lines Matching refs:thread
323 static void GetSample(Thread* thread, void* arg) REQUIRES_SHARED(Locks::mutator_lock_) { in GetSample() argument
334 thread, in GetSample()
338 the_trace->CompareAndUpdateStackTrace(thread, stack_trace); in GetSample()
341 static void ClearThreadStackTraceAndClockBase(Thread* thread, void* arg ATTRIBUTE_UNUSED) { in ClearThreadStackTraceAndClockBase() argument
342 thread->SetTraceClockBase(0); in ClearThreadStackTraceAndClockBase()
343 std::vector<ArtMethod*>* stack_trace = thread->GetStackTraceSample(); in ClearThreadStackTraceAndClockBase()
344 thread->SetStackTraceSample(nullptr); in ClearThreadStackTraceAndClockBase()
348 void Trace::CompareAndUpdateStackTrace(Thread* thread, in CompareAndUpdateStackTrace() argument
351 std::vector<ArtMethod*>* old_stack_trace = thread->GetStackTraceSample(); in CompareAndUpdateStackTrace()
353 thread->SetStackTraceSample(stack_trace); in CompareAndUpdateStackTrace()
357 ReadClocks(thread, &thread_clock_diff, ×tamp_counter); in CompareAndUpdateStackTrace()
362 LogMethodTraceEvent(thread, *rit, kTraceMethodEnter, thread_clock_diff, timestamp_counter); in CompareAndUpdateStackTrace()
376 LogMethodTraceEvent(thread, *old_it, kTraceMethodExit, thread_clock_diff, timestamp_counter); in CompareAndUpdateStackTrace()
380 LogMethodTraceEvent(thread, *rit, kTraceMethodEnter, thread_clock_diff, timestamp_counter); in CompareAndUpdateStackTrace()
570 void Trace::UpdateThreadsList(Thread* thread) { in UpdateThreadsList() argument
574 thread->GetThreadName(name); in UpdateThreadsList()
590 threads_list_.Overwrite(thread->GetTid(), name); in UpdateThreadsList()
644 for (Thread* thread : Runtime::Current()->GetThreadList()->GetList()) { in StopTracing()
645 if (thread->GetMethodTraceBuffer() != nullptr) { in StopTracing()
646 the_trace_->FlushStreamingBuffer(thread); in StopTracing()
647 thread->ResetMethodTraceBuffer(); in StopTracing()
651 the_trace->UpdateThreadsList(thread); in StopTracing()
901 void Trace::DexPcMoved(Thread* thread ATTRIBUTE_UNUSED, in DexPcMoved()
910 void Trace::FieldRead(Thread* thread ATTRIBUTE_UNUSED, in FieldRead()
921 void Trace::FieldWritten(Thread* thread ATTRIBUTE_UNUSED, in FieldWritten()
933 void Trace::MethodEntered(Thread* thread, ArtMethod* method) { in MethodEntered() argument
936 ReadClocks(thread, &thread_clock_diff, ×tamp_counter); in MethodEntered()
937 LogMethodTraceEvent(thread, method, kTraceMethodEnter, thread_clock_diff, timestamp_counter); in MethodEntered()
940 void Trace::MethodExited(Thread* thread, in MethodExited() argument
946 ReadClocks(thread, &thread_clock_diff, ×tamp_counter); in MethodExited()
947 LogMethodTraceEvent(thread, method, kTraceMethodExit, thread_clock_diff, timestamp_counter); in MethodExited()
950 void Trace::MethodUnwind(Thread* thread, in MethodUnwind() argument
955 ReadClocks(thread, &thread_clock_diff, ×tamp_counter); in MethodUnwind()
956 LogMethodTraceEvent(thread, method, kTraceUnroll, thread_clock_diff, timestamp_counter); in MethodUnwind()
959 void Trace::ExceptionThrown(Thread* thread ATTRIBUTE_UNUSED, in ExceptionThrown()
965 void Trace::ExceptionHandled(Thread* thread ATTRIBUTE_UNUSED, in ExceptionHandled()
982 void Trace::ReadClocks(Thread* thread, uint32_t* thread_clock_diff, uint64_t* timestamp_counter) { in ReadClocks() argument
984 uint64_t clock_base = thread->GetTraceClockBase(); in ReadClocks()
987 uint64_t time = thread->GetCpuMicroTime(); in ReadClocks()
988 thread->SetTraceClockBase(time); in ReadClocks()
990 *thread_clock_diff = thread->GetCpuMicroTime() - clock_base; in ReadClocks()
1008 void Trace::RecordStreamingMethodEvent(Thread* thread, in RecordStreamingMethodEvent() argument
1013 uintptr_t* method_trace_buffer = thread->GetMethodTraceBuffer(); in RecordStreamingMethodEvent()
1014 size_t* current_offset = thread->GetMethodTraceIndexPtr(); in RecordStreamingMethodEvent()
1018 thread->SetMethodTraceBuffer(method_trace_buffer); in RecordStreamingMethodEvent()
1023 thread->GetThreadName(thread_name); in RecordStreamingMethodEvent()
1034 DCHECK(!kIsTargetBuild || thread->GetTid() < (1 << 16)); in RecordStreamingMethodEvent()
1035 Append2LE(header + 3, static_cast<uint16_t>(thread->GetTid())); in RecordStreamingMethodEvent()
1052 FlushStreamingBuffer(thread); in RecordStreamingMethodEvent()
1101 void Trace::FlushStreamingBuffer(Thread* thread) { in FlushStreamingBuffer() argument
1106 uintptr_t* method_trace_buffer = thread->GetMethodTraceBuffer(); in FlushStreamingBuffer()
1112 size_t num_entries = *(thread->GetMethodTraceIndexPtr()); in FlushStreamingBuffer()
1159 buffer.get() + current_index, thread, method_index, action, thread_time, wall_time); in FlushStreamingBuffer()
1169 void Trace::RecordMethodEvent(Thread* thread, in RecordMethodEvent() argument
1207 ptr, thread, EncodeTraceMethod(method), action, thread_clock_diff, wall_clock_diff); in RecordMethodEvent()
1210 void Trace::LogMethodTraceEvent(Thread* thread, in LogMethodTraceEvent() argument
1224 RecordStreamingMethodEvent(thread, method, action, thread_clock_diff, timestamp_counter); in LogMethodTraceEvent()
1226 RecordMethodEvent(thread, method, action, thread_clock_diff, timestamp_counter); in LogMethodTraceEvent()
1231 Thread* thread, in EncodeEventEntry() argument
1238 Append2LE(ptr, thread->GetTid()); in EncodeEventEntry()
1286 void Trace::StoreExitingThreadInfo(Thread* thread) { in StoreExitingThreadInfo() argument
1287 MutexLock mu(thread, *Locks::trace_lock_); in StoreExitingThreadInfo()
1289 the_trace_->UpdateThreadsList(thread); in StoreExitingThreadInfo()