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

Unified Diff: src/profiler/cpu-profiler.cc

Issue 2105943002: Expose TickSample and its APIs in v8-profiler.h (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Make internal::TickSample 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
Index: src/profiler/cpu-profiler.cc
diff --git a/src/profiler/cpu-profiler.cc b/src/profiler/cpu-profiler.cc
index 42b5fdf31dcfb9c396fe2d09bd79342ce8822188..a516f198b2922bdfc376decb09f685b48ddad2ba 100644
--- a/src/profiler/cpu-profiler.cc
+++ b/src/profiler/cpu-profiler.cc
@@ -12,8 +12,6 @@
#include "src/profiler/cpu-profiler-inl.h"
#include "src/vm-state-inl.h"
-#include "include/v8-profiler.h"
-
namespace v8 {
namespace internal {
@@ -49,7 +47,11 @@ void ProfilerEventsProcessor::AddDeoptStack(Isolate* isolate, Address from,
regs.sp = fp - fp_to_sp_delta;
regs.fp = fp;
regs.pc = from;
- record.sample.Init(isolate, regs, TickSample::kSkipCEntryFrame, false);
+ record.sample.Init(reinterpret_cast<v8::Isolate*>(isolate), regs,
+ TickSample::kSkipCEntryFrame, false);
+ record.sample.timestamp = record.sample.pc == nullptr
alph 2016/07/01 00:38:13 nit: You can create internal::TickSample::Init and
lpy 2016/07/01 01:00:10 Done.
+ ? base::TimeTicks()
+ : base::TimeTicks::HighResolutionNow();
ticks_from_vm_buffer_.Enqueue(record);
}
@@ -64,7 +66,11 @@ void ProfilerEventsProcessor::AddCurrentStack(Isolate* isolate,
regs.fp = frame->fp();
regs.pc = frame->pc();
}
- record.sample.Init(isolate, regs, TickSample::kSkipCEntryFrame, update_stats);
+ record.sample.Init(reinterpret_cast<v8::Isolate*>(isolate), regs,
+ TickSample::kSkipCEntryFrame, update_stats);
+ record.sample.timestamp = record.sample.pc == nullptr
+ ? base::TimeTicks()
+ : base::TimeTicks::HighResolutionNow();
ticks_from_vm_buffer_.Enqueue(record);
}

Powered by Google App Engine
This is Rietveld 408576698