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

Unified Diff: src/log.cc

Issue 2050713002: [--prof] Adding support for RuntimeCallTimerScope based tick separation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: reverting flag changes Created 4 years, 6 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') | tools/tickprocessor.js » ('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 b81ba0867dfac75b30f2513017dd17a9b85fe2a9..a27340f29a30c59df2afe7035ea7159d9ffafee8 100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -11,6 +11,7 @@
#include "src/base/platform/platform.h"
#include "src/bootstrapper.h"
#include "src/code-stubs.h"
+#include "src/counters.h"
#include "src/deoptimizer.h"
#include "src/global-handles.h"
#include "src/interpreter/bytecodes.h"
@@ -1423,9 +1424,23 @@ void Logger::DebugEvent(const char* event_type, Vector<uint16_t> parameter) {
msg.WriteToLogFile();
}
+void Logger::RuntimeCallTimerEvent() {
+ RuntimeCallStats* stats = isolate_->counters()->runtime_call_stats();
+ RuntimeCallTimer* timer = stats->current_timer();
+ if (timer == nullptr) return;
+ RuntimeCallCounter* counter = timer->counter();
+ if (counter == nullptr) return;
+ Log::MessageBuilder msg(log_);
+ msg.Append("active-runtime-timer,");
+ msg.AppendDoubleQuotedString(counter->name);
+ msg.WriteToLogFile();
+}
void Logger::TickEvent(TickSample* sample, bool overflow) {
if (!log_->IsEnabled() || !FLAG_prof_cpp) return;
+ if (FLAG_runtime_call_stats) {
+ RuntimeCallTimerEvent();
+ }
Log::MessageBuilder msg(log_);
msg.Append("%s,", kLogEventsNames[TICK_EVENT]);
msg.AppendAddress(sample->pc);
« no previous file with comments | « src/log.h ('k') | tools/tickprocessor.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698