Home | History | Annotate | Download | only in runtime

Lines Matching refs:Trace

17 #include "trace.h"
71 TraceClockSource Trace::default_clock_source_ = kDefaultTraceClockSource;
73 Trace* volatile Trace::the_trace_ = nullptr;
74 pthread_t Trace::sampling_pthread_ = 0U;
75 std::unique_ptr<std::vector<ArtMethod*>> Trace::temp_stack_trace_;
84 ArtMethod* Trace::DecodeTraceMethod(uint32_t tmid) {
89 uint32_t Trace::EncodeTraceMethod(ArtMethod* method) {
105 uint32_t Trace::EncodeTraceMethodAndAction(ArtMethod* method, TraceAction action) {
111 std::vector<ArtMethod*>* Trace::AllocStackTrace() {
116 void Trace::FreeStackTrace(std::vector<ArtMethod*>* stack_trace) {
121 void Trace::SetDefaultClockSource(TraceClockSource clock_source) {
141 bool Trace::UseThreadCpuClock() {
146 bool Trace::UseWallClock() {
151 void Trace::MeasureClockOverhead() {
161 uint32_t Trace::GetClockOverheadNanoSeconds() {
207 std::vector<ArtMethod*>* const stack_trace = Trace::AllocStackTrace();
220 Trace* the_trace = reinterpret_cast<Trace*>(arg);
231 void Trace::CompareAndUpdateStackTrace(Thread* thread,
235 // Update the thread's stack trace sample.
237 // Read timer clocks to use for all events in this trace.
242 // If there's no previous stack trace sample for this thread, log an entry event for all
243 // methods in the trace.
249 // If there's a previous stack trace for this thread, diff the traces and emit entry and exit
258 // Iterate top-down over the old trace until the point where they differ, emitting exit events.
263 // Iterate bottom-up over the new trace from the point where they differ, emitting entry events.
272 void* Trace::RunSamplingThread(void* arg) {
281 ScopedTrace trace("Profile sampling");
283 Trace* the_trace;
308 void Trace::Start(const char* trace_filename,
316 std::string msg = android::base::StringPrintf("Unable to open trace file '%s'", trace_filename);
325 void Trace::Start(int trace_fd,
343 void Trace::StartDDMS(size_t buffer_size,
355 void Trace::Start(std::unique_ptr<File>&& trace_file_in,
363 // Trace instance).
377 LOG(ERROR) << "Trace already in progress, ignoring this request";
404 // Create Trace object.
413 LOG(ERROR) << "Trace already in progress, ignoring this request";
416 the_trace_ = new Trace(trace_file.release(), buffer_size, flags, output_mode, trace_mode);
444 void Trace::StopTracing(bool finish_tracing, bool flush_file) {
447 Trace* the_trace = nullptr;
453 LOG(ERROR) << "Trace stop requested, but no trace currently running";
460 // Make sure that we join before we delete the trace since we don't want to have
469 stop_alloc_counting = (the_trace->flags_ & Trace::kTraceCountAllocs) != 0;
470 // Stop the trace sources adding more entries to the trace buffer and synchronise stores.
498 PLOG(WARNING) << "Could not flush trace file.";
504 PLOG(ERROR) << "Could not close trace file.";
515 void Trace::Abort() {
520 void Trace::Stop() {
525 void Trace::Shutdown() {
531 TracingMode Trace::GetMethodTracingMode() {
547 static constexpr size_t kMinBufSize = 18U; // Trace header is up to 18B.
549 Trace::Trace(File* trace_file,
568 // Set up the beginning of the trace.
578 static_assert(18 <= kMinBufSize, "Minimum buffer size not large enough for trace header");
588 Trace::~Trace() {
601 void Trace::DumpBuf(uint8_t* buf, size_t buf_size, TraceClockSource clock_source) {
614 void Trace::FinishTracing() {
666 // Write a special token to mark the end of trace records and the start of
667 // trace summary.
673 // Write the trace summary. The summary is identical to the file header when
676 // Flush the buffer, which may include some trace records before the summary.
688 LOG(INFO) << "Trace sent:\n" << header;
694 std::string detail(StringPrintf("Trace data write failed: %s", strerror(errno)));
702 void Trace::DexPcMoved(Thread* thread ATTRIBUTE_UNUSED,
711 void Trace::FieldRead(Thread* thread ATTRIBUTE_UNUSED,
722 void Trace::FieldWritten(Thread* thread ATTRIBUTE_UNUSED,
734 void Trace::MethodEntered(Thread* thread,
745 void Trace::MethodExited(Thread* thread,
757 void Trace::MethodUnwind(Thread* thread,
768 void Trace::ExceptionThrown(Thread* thread ATTRIBUTE_UNUSED,
774 void Trace::ExceptionHandled(Thread* thread ATTRIBUTE_UNUSED,
780 void Trace::Branch(Thread* /*thread*/, ArtMethod* method,
786 void Trace::WatchedFramePop(Thread* self ATTRIBUTE_UNUSED,
791 void Trace::ReadClocks(Thread* thread, uint32_t* thread_clock_diff, uint32_t* wall_clock_diff) {
807 bool Trace::RegisterMethod(ArtMethod* method) {
820 bool Trace::RegisterThread(Thread* thread) {
832 std::string Trace::GetMethodLine(ArtMethod* method) {
839 void Trace::WriteToBuf(const uint8_t* src, size_t src_size) {
866 void Trace::FlushBuf() {
875 void Trace::LogMethodTraceEvent(Thread* thread, ArtMethod* method,
984 void Trace::GetVisitedMethods(size_t buf_size,
997 void Trace::DumpMethodList(std::ostream& os, const std::set<ArtMethod*>& visited_methods) {
1010 void Trace::DumpThreadList(std::ostream& os) {
1020 void Trace::StoreExitingThreadInfo(Thread* thread) {
1031 Trace::TraceOutputMode Trace::GetOutputMode() {
1033 CHECK(the_trace_ != nullptr) << "Trace output mode requested, but no trace currently running";
1037 Trace::TraceMode Trace::GetMode() {
1039 CHECK(the_trace_ != nullptr) << "Trace mode requested, but no trace currently running";
1043 size_t Trace::GetBufferSize() {
1045 CHECK(the_trace_ != nullptr) << "Trace mode requested, but no trace currently running";
1049 bool Trace::IsTracingEnabled() {