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

Unified Diff: src/profiler/tick-sample.cc

Issue 2461003002: [profiler] Emit runtime call stats into sampling profile (Closed)
Patch Set: Created 4 years, 2 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
Index: src/profiler/tick-sample.cc
diff --git a/src/profiler/tick-sample.cc b/src/profiler/tick-sample.cc
index ecb2bf46f787c8d4aa58b6969a928ee4e7757d2f..e1c84c46bf45b5cc7dc261f86e786f1f228239af 100644
--- a/src/profiler/tick-sample.cc
+++ b/src/profiler/tick-sample.cc
@@ -5,6 +5,7 @@
#include "src/profiler/tick-sample.h"
#include "include/v8-profiler.h"
+#include "src/counters.h"
#include "src/frames-inl.h"
#include "src/msan.h"
#include "src/simulator.h"
@@ -237,7 +238,15 @@ bool TickSample::GetStackSample(Isolate* v8_isolate, RegisterState* regs,
it.top_frame_type() == internal::StackFrame::BUILTIN_EXIT)) {
frames[i++] = isolate->c_function();
}
+ i::RuntimeCallTimer* timer =
+ isolate->counters()->runtime_call_stats()->current_timer();
for (; !it.done() && i < frames_limit; it.Advance()) {
+ while (timer && reinterpret_cast<i::Address>(timer) < it.frame()->fp() &&
+ i < frames_limit) {
+ frames[i++] = reinterpret_cast<i::Address>(timer->counter());
+ timer = timer->parent();
+ }
+ if (i == frames_limit) break;
if (!it.frame()->is_interpreted()) {
frames[i++] = it.frame()->pc();
continue;

Powered by Google App Engine
This is Rietveld 408576698