Index: src/log.cc |
diff --git a/src/log.cc b/src/log.cc |
index 59d494a1493d559bd5854139aacc9808a16bc9a7..ff67d10868afa578561d4097d7d8f7fec0b7e08d 100644 |
--- a/src/log.cc |
+++ b/src/log.cc |
@@ -716,7 +716,8 @@ Logger::Logger(Isolate* isolate) |
ll_logger_(NULL), |
jit_logger_(NULL), |
listeners_(5), |
- is_initialized_(false) { |
+ is_initialized_(false), |
+ epoch_(0) { |
} |
@@ -867,7 +868,7 @@ void Logger::CodeDeoptEvent(Code* code) { |
if (!log_->IsEnabled()) return; |
ASSERT(FLAG_log_internal_timer_events); |
Log::MessageBuilder msg(log_); |
- int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds()); |
+ int since_epoch = static_cast<int>(OS::Ticks() - epoch_); |
msg.Append("code-deopt,%ld,%d\n", since_epoch, code->CodeSize()); |
msg.WriteToLogFile(); |
} |
@@ -877,7 +878,7 @@ void Logger::TimerEvent(StartEnd se, const char* name) { |
if (!log_->IsEnabled()) return; |
ASSERT(FLAG_log_internal_timer_events); |
Log::MessageBuilder msg(log_); |
- int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds()); |
+ int since_epoch = static_cast<int>(OS::Ticks() - epoch_); |
const char* format = (se == START) ? "timer-event-start,\"%s\",%ld\n" |
: "timer-event-end,\"%s\",%ld\n"; |
msg.Append(format, name, since_epoch); |
@@ -1500,7 +1501,7 @@ void Logger::TickEvent(TickSample* sample, bool overflow) { |
Log::MessageBuilder msg(log_); |
msg.Append("%s,", kLogEventsNames[TICK_EVENT]); |
msg.AppendAddress(sample->pc); |
- msg.Append(",%ld", static_cast<int>(timer_.Elapsed().InMicroseconds())); |
+ msg.Append(",%ld", static_cast<int>(OS::Ticks() - epoch_)); |
if (sample->has_external_callback) { |
msg.Append(",1,"); |
msg.AppendAddress(sample->external_callback); |
@@ -1895,7 +1896,7 @@ bool Logger::SetUp(Isolate* isolate) { |
} |
} |
- if (FLAG_log_internal_timer_events || FLAG_prof) timer_.Start(); |
+ if (FLAG_log_internal_timer_events || FLAG_prof) epoch_ = OS::Ticks(); |
return true; |
} |