summaryrefslogtreecommitdiff
path: root/runtime/trace_profile.cc
diff options
context:
space:
mode:
author Mythri Alle <mythria@google.com> 2025-01-13 12:00:33 +0000
committer Mythri Alle <mythria@google.com> 2025-01-24 01:05:24 -0800
commit1a9a8abf19e7641149fcaed3971bf0aa99f4dfb8 (patch)
tree74cc6c1c49a2fe36b29807ed2256b26073df9628 /runtime/trace_profile.cc
parent2576b59a2dad4ee542eb50fb451ff88a4b8902ad (diff)
Use nanoseconds for v2 method tracing
Update the precision of timestamps to be nanoseconds and use nanosecond precision in method trace format v2. For format v1 we use microsecond precision for backwards compatability. Bug: 259258187 Test: art/test.py -t 2246 Change-Id: I099e21f5d143c5444193e7886b5281b32f87d5d3
Diffstat (limited to 'runtime/trace_profile.cc')
-rw-r--r--runtime/trace_profile.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/trace_profile.cc b/runtime/trace_profile.cc
index d0d234c476..19e0a56bcc 100644
--- a/runtime/trace_profile.cc
+++ b/runtime/trace_profile.cc
@@ -140,7 +140,7 @@ void RecordMethodsOnThreadStack(Thread* thread, uintptr_t* method_trace_buffer)
visitor.WalkStack(true);
// Create method entry events for all methods currently on the thread's stack.
- uint64_t init_time = TimestampCounter::GetMicroTime(TimestampCounter::GetTimestamp());
+ uint64_t init_time = TimestampCounter::GetNanoTime(TimestampCounter::GetTimestamp());
// Set the lsb to 0 to indicate method entry.
init_time = init_time & ~1;
std::ostringstream os;
@@ -492,13 +492,13 @@ void TraceProfiler::DumpLongRunningMethodBuffer(uint32_t thread_id,
// start of the trace. Just ignore this entry.
} else if (entry & 0x1) {
// Method exit
- os << "<-" << TimestampCounter::GetMicroTime(entry & ~1) << "\n";
+ os << "<-" << TimestampCounter::GetNanoTime(entry & ~1) << "\n";
} else {
// Method entry
ArtMethod* method = reinterpret_cast<ArtMethod*>(entry);
ptr--;
CHECK(ptr >= end_trace_entries);
- os << "->" << method << " " << TimestampCounter::GetMicroTime(*ptr) << "\n";
+ os << "->" << method << " " << TimestampCounter::GetNanoTime(*ptr) << "\n";
methods.insert(method);
}
ptr--;