Lines Matching full:trace
17 #include "trace.h"
90 method_trace_(Trace::AllocStackTrace()) {}
101 // Returns a stack trace where the topmost frame corresponds with the first element of the vector.
119 ProfilerClockSource Trace::default_clock_source_ = kProfilerClockSourceDual;
121 ProfilerClockSource Trace::default_clock_source_ = kProfilerClockSourceWall;
124 Trace* volatile Trace::the_trace_ = NULL;
125 pthread_t Trace::sampling_pthread_ = 0U;
126 UniquePtr<std::vector<mirror::ArtMethod*> > Trace::temp_stack_trace_;
143 std::vector<mirror::ArtMethod*>* Trace::AllocStackTrace() {
151 void Trace::FreeStackTrace(std::vector<mirror::ArtMethod*>* stack_trace) {
156 void Trace::SetDefaultClockSource(ProfilerClockSource clock_source) {
176 bool Trace::UseThreadCpuClock() {
181 bool Trace::UseWallClock() {
186 static void MeasureClockOverhead(Trace* trace) {
187 if (trace->UseThreadCpuClock()) {
190 if (trace->UseWallClock()) {
196 static uint32_t GetClockOverheadNanoSeconds(Trace* trace) {
201 MeasureClockOverhead(trace);
202 MeasureClockOverhead(trace);
203 MeasureClockOverhead(trace);
204 MeasureClockOverhead(trace);
205 MeasureClockOverhead(trace);
206 MeasureClockOverhead(trace);
207 MeasureClockOverhead(trace);
208 MeasureClockOverhead(trace);
245 Trace* the_trace = reinterpret_cast<Trace*>(arg);
256 void Trace::CompareAndUpdateStackTrace(Thread* thread,
260 // Update the thread's stack trace sample.
262 // Read timer clocks to use for all events in this trace.
267 // If there's no previous stack trace sample for this thread, log an entry event for all
268 // methods in the trace.
275 // If there's a previous stack trace for this thread, diff the traces and emit entry and exit
284 // Iterate top-down over the old trace until the point where they differ, emitting exit events.
290 // Iterate bottom-up over the new trace from the point where they differ, emitting entry events.
299 void* Trace::RunSamplingThread(void* arg) {
309 Trace* the_trace;
331 void Trace::Start(const char* trace_filename, int trace_fd, int buffer_size, int flags,
337 LOG(ERROR) << "Trace already in progress, ignoring this request";
344 // Open trace file if not going directly to ddms.
354 PLOG(ERROR) << "Unable to open trace file '" << trace_filename << "'";
357 ThrowRuntimeException("Unable to open trace file '%s'", trace_filename);
362 // Create Trace object.
366 LOG(ERROR) << "Trace already in progress, ignoring this request";
368 the_trace_ = new Trace(trace_file.release(), buffer_size, flags, sampling_enabled);
392 void Trace::Stop() {
395 Trace* the_trace = NULL;
400 LOG(ERROR) << "Trace stop requested, but no trace currently running";
429 void Trace::Shutdown() {
435 TracingMode Trace::GetMethodTracingMode() {
446 Trace::Trace(File* trace_file, int buffer_size, int flags, bool sampling_enabled)
450 // Set up the beginning of the trace.
480 void Trace::FinishTracing() {
534 LOG(INFO) << "Trace sent:\n" << header;
540 std::string detail(StringPrintf("Trace data write failed: %s", strerror(errno)));
547 void Trace::DexPcMoved(Thread* thread, mirror::Object* this_object,
553 void Trace::MethodEntered(Thread* thread, mirror::Object* this_object,
562 void Trace::MethodExited(Thread* thread, mirror::Object* this_object,
573 void Trace::MethodUnwind(Thread* thread, const mirror::ArtMethod* method, uint32_t dex_pc) {
581 void Trace::ExceptionCaught(Thread* thread, const ThrowLocation& throw_location,
588 void Trace::ReadClocks(Thread* thread, uint32_t* thread_clock_diff, uint32_t* wall_clock_diff) {
604 void Trace::LogMethodTraceEvent(Thread* thread, const mirror::ArtMethod* method,
651 void Trace::GetVisitedMethods(size_t buf_size,
664 void Trace::DumpMethodList(std::ostream& os, const std::set<mirror::ArtMethod*>& visited_methods) {
681 void Trace::DumpThreadList(std::ostream& os) {