summaryrefslogtreecommitdiffstats
path: root/runtime/utils.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/utils.cc')
-rw-r--r--runtime/utils.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/utils.cc b/runtime/utils.cc
index ec7131d..650214f 100644
--- a/runtime/utils.cc
+++ b/runtime/utils.cc
@@ -262,8 +262,8 @@ uint64_t ThreadCpuNanoTime() {
void NanoSleep(uint64_t ns) {
timespec tm;
- tm.tv_sec = 0;
- tm.tv_nsec = ns;
+ tm.tv_sec = ns / MsToNs(1000);
+ tm.tv_nsec = ns - static_cast<uint64_t>(tm.tv_sec) * MsToNs(1000);
nanosleep(&tm, nullptr);
}
@@ -1298,7 +1298,7 @@ void DumpNativeStack(std::ostream& os, pid_t tid, const char* prefix,
if (!BacktraceMap::IsValid(it->map)) {
os << StringPrintf("%08" PRIxPTR " ???", it->pc);
} else {
- os << StringPrintf("%08" PRIxPTR " ", it->pc - it->map.start);
+ os << StringPrintf("%08" PRIxPTR " ", BacktraceMap::GetRelativePc(it->map, it->pc));
os << it->map.name;
os << " (";
if (!it->func_name.empty()) {