Home | History | Annotate | Download | only in runtime

Lines Matching refs:Trace

17 #include "trace.h"
65 method_trace_(Trace::AllocStackTrace()) {}
76 // Returns a stack trace where the topmost frame corresponds with the first element of the vector.
95 TraceClockSource Trace::default_clock_source_ = kDefaultTraceClockSource;
97 Trace* volatile Trace::the_trace_ = nullptr;
98 pthread_t Trace::sampling_pthread_ = 0U;
99 std::unique_ptr<std::vector<ArtMethod*>> Trace::temp_stack_trace_;
108 ArtMethod* Trace::DecodeTraceMethod(uint32_t tmid) {
113 uint32_t Trace::EncodeTraceMethod(ArtMethod* method) {
129 uint32_t Trace::EncodeTraceMethodAndAction(ArtMethod* method, TraceAction action) {
135 std::vector<ArtMethod*>* Trace::AllocStackTrace() {
140 void Trace::FreeStackTrace(std::vector<ArtMethod*>* stack_trace) {
145 void Trace::SetDefaultClockSource(TraceClockSource clock_source) {
165 bool Trace::UseThreadCpuClock() {
170 bool Trace::UseWallClock() {
175 void Trace::MeasureClockOverhead() {
185 uint32_t Trace::GetClockOverheadNanoSeconds() {
234 Trace* the_trace = reinterpret_cast<Trace*>(arg);
245 void Trace::CompareAndUpdateStackTrace(Thread* thread,
249 // Update the thread's stack trace sample.
251 // Read timer clocks to use for all events in this trace.
256 // If there's no previous stack trace sample for this thread, log an entry event for all
257 // methods in the trace.
263 // If there's a previous stack trace for this thread, diff the traces and emit entry and exit
272 // Iterate top-down over the old trace until the point where they differ, emitting exit events.
277 // Iterate bottom-up over the new trace from the point where they differ, emitting entry events.
286 void* Trace::RunSamplingThread(void* arg) {
295 ScopedTrace trace("Profile sampling");
297 Trace* the_trace;
322 void Trace::Start(const char* trace_filename, int trace_fd, size_t buffer_size, int flags,
328 LOG(ERROR) << "Trace already in progress, ignoring this request";
341 // Open trace file if not going directly to ddms.
351 PLOG(ERROR) << "Unable to open trace file '" << trace_filename << "'";
353 ThrowRuntimeException("Unable to open trace file '%s'", trace_filename);
363 // Create Trace object.
372 LOG(ERROR) << "Trace already in progress, ignoring this request";
375 the_trace_ = new Trace(trace_file.release(), trace_filename, buffer_size, flags, output_mode,
399 void Trace::StopTracing(bool finish_tracing, bool flush_file) {
402 Trace* the_trace = nullptr;
408 LOG(ERROR) << "Trace stop requested, but no trace currently running";
415 // Make sure that we join before we delete the trace since we don't want to have
424 stop_alloc_counting = (the_trace->flags_ & Trace::kTraceCountAllocs) != 0;
447 PLOG(WARNING) << "Could not flush trace file.";
453 PLOG(ERROR) << "Could not close trace file.";
464 void Trace::Abort() {
469 void Trace::Stop() {
474 void Trace::Shutdown() {
480 void Trace::Pause() {
483 Trace* the_trace = nullptr;
490 LOG(ERROR) << "Trace pause requested, but no trace currently running";
516 stop_alloc_counting = (the_trace->flags_ & Trace::kTraceCountAllocs) != 0;
537 void Trace::Resume() {
539 Trace* the_trace;
543 LOG(ERROR) << "No trace to resume (or sampling mode), ignoring this request";
580 TracingMode Trace::GetMethodTracingMode() {
596 static constexpr size_t kMinBufSize = 18U; // Trace header is up to 18B.
598 Trace::Trace(File* trace_file, const char* trace_name, size_t buffer_size, int flags,
612 // Set up the beginning of the trace.
622 static_assert(18 <= kMinBufSize, "Minimum buffer size not large enough for trace header");
634 Trace::~Trace() {
647 void Trace::DumpBuf(uint8_t* buf, size_t buf_size, TraceClockSource clock_source) {
660 void Trace::FinishTracing() {
711 // Write a special token to mark the end of trace records and the start of
712 // trace summary.
718 // Write the trace summary. The summary is identical to the file header when
721 // Flush the buffer, which may include some trace records before the summary.
733 LOG(INFO) << "Trace sent:\n" << header;
739 std::string detail(StringPrintf("Trace data write failed: %s", strerror(errno)));
747 void Trace::DexPcMoved(Thread* thread ATTRIBUTE_UNUSED,
756 void Trace::FieldRead(Thread* thread ATTRIBUTE_UNUSED,
767 void Trace::FieldWritten(Thread* thread ATTRIBUTE_UNUSED,
779 void Trace::MethodEntered(Thread* thread,
790 void Trace::MethodExited(Thread* thread,
802 void Trace::MethodUnwind(Thread* thread,
813 void Trace::ExceptionThrown(Thread* thread ATTRIBUTE_UNUSED,
819 void Trace::ExceptionHandled(Thread* thread ATTRIBUTE_UNUSED,
825 void Trace::Branch(Thread* /*thread*/, ArtMethod* method,
831 void Trace::InvokeVirtualOrInterface(Thread*,
840 void Trace::WatchedFramePop(Thread* self ATTRIBUTE_UNUSED,
845 void Trace::ReadClocks(Thread* thread, uint32_t* thread_clock_diff, uint32_t* wall_clock_diff) {
861 bool Trace::RegisterMethod(ArtMethod* method) {
875 bool Trace::RegisterThread(Thread* thread) {
887 std::string Trace::GetMethodLine(ArtMethod* method) {
894 void Trace::WriteToBuf(const uint8_t* src, size_t src_size) {
920 void Trace::FlushBuf() {
928 void Trace::LogMethodTraceEvent(Thread* thread, ArtMethod* method,
1018 void Trace::GetVisitedMethods(size_t buf_size,
1031 void Trace::DumpMethodList(std::ostream& os, const std::set<ArtMethod*>& visited_methods) {
1044 void Trace::DumpThreadList(std::ostream& os) {
1054 void Trace::StoreExitingThreadInfo(Thread* thread) {
1065 Trace::TraceOutputMode Trace::GetOutputMode() {
1067 CHECK(the_trace_ != nullptr) << "Trace output mode requested, but no trace currently running";
1071 Trace::TraceMode Trace::GetMode() {
1073 CHECK(the_trace_ != nullptr) << "Trace mode requested, but no trace currently running";
1077 size_t Trace::GetBufferSize() {
1079 CHECK(the_trace_ != nullptr) << "Trace mode requested, but no trace currently running";
1083 bool Trace::IsTracingEnabled() {