Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(686)

Unified Diff: src/log.cc

Issue 23690003: Revert "Add Chromium-style TimeDelta, Time and TimeTicks classes, and a new ElapsedTimer class." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/log.h ('k') | src/optimizing-compiler-thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « src/log.h ('k') | src/optimizing-compiler-thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698