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

Side by Side Diff: src/log.cc

Issue 2511093002: [counters] RuntimeStats: fix wrong bookkeeping when dynamically changing counters. (Closed)
Patch Set: merge with master Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/log.h" 5 #include "src/log.h"
6 6
7 #include <cstdarg> 7 #include <cstdarg>
8 #include <memory> 8 #include <memory>
9 #include <sstream> 9 #include <sstream>
10 10
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 } 1272 }
1273 1273
1274 void Logger::RuntimeCallTimerEvent() { 1274 void Logger::RuntimeCallTimerEvent() {
1275 RuntimeCallStats* stats = isolate_->counters()->runtime_call_stats(); 1275 RuntimeCallStats* stats = isolate_->counters()->runtime_call_stats();
1276 RuntimeCallTimer* timer = stats->current_timer(); 1276 RuntimeCallTimer* timer = stats->current_timer();
1277 if (timer == nullptr) return; 1277 if (timer == nullptr) return;
1278 RuntimeCallCounter* counter = timer->counter(); 1278 RuntimeCallCounter* counter = timer->counter();
1279 if (counter == nullptr) return; 1279 if (counter == nullptr) return;
1280 Log::MessageBuilder msg(log_); 1280 Log::MessageBuilder msg(log_);
1281 msg.Append("active-runtime-timer,"); 1281 msg.Append("active-runtime-timer,");
1282 msg.AppendDoubleQuotedString(counter->name); 1282 msg.AppendDoubleQuotedString(counter->name());
1283 msg.WriteToLogFile(); 1283 msg.WriteToLogFile();
1284 } 1284 }
1285 1285
1286 void Logger::TickEvent(v8::TickSample* sample, bool overflow) { 1286 void Logger::TickEvent(v8::TickSample* sample, bool overflow) {
1287 if (!log_->IsEnabled() || !FLAG_prof_cpp) return; 1287 if (!log_->IsEnabled() || !FLAG_prof_cpp) return;
1288 if (V8_UNLIKELY(FLAG_runtime_stats == 1288 if (V8_UNLIKELY(FLAG_runtime_stats ==
1289 v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE)) { 1289 v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE)) {
1290 RuntimeCallTimerEvent(); 1290 RuntimeCallTimerEvent();
1291 } 1291 }
1292 Log::MessageBuilder msg(log_); 1292 Log::MessageBuilder msg(log_);
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
1780 1780
1781 if (profiler_listener_.get() != nullptr) { 1781 if (profiler_listener_.get() != nullptr) {
1782 removeCodeEventListener(profiler_listener_.get()); 1782 removeCodeEventListener(profiler_listener_.get());
1783 } 1783 }
1784 1784
1785 return log_->Close(); 1785 return log_->Close();
1786 } 1786 }
1787 1787
1788 } // namespace internal 1788 } // namespace internal
1789 } // namespace v8 1789 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698