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

Unified Diff: src/sampler.cc

Issue 638633002: Tick processor: Print C++ entry points (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased Created 6 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
« no previous file with comments | « src/sampler.h ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/sampler.cc
diff --git a/src/sampler.cc b/src/sampler.cc
index 95b7f4bc330033d441dc0bb7ae01ea4940653f01..763b06516795e65477702f85e53b8227e3892417 100644
--- a/src/sampler.cc
+++ b/src/sampler.cc
@@ -570,7 +570,8 @@ SamplerThread* SamplerThread::instance_ = NULL;
// StackTracer implementation
//
DISABLE_ASAN void TickSample::Init(Isolate* isolate,
- const v8::RegisterState& regs) {
+ const v8::RegisterState& regs,
+ RecordCEntryFrame record_c_entry_frame) {
timestamp = base::TimeTicks::HighResolutionNow();
pc = reinterpret_cast<Address>(regs.pc);
state = isolate->current_vm_state();
@@ -601,13 +602,14 @@ DISABLE_ASAN void TickSample::Init(Isolate* isolate,
top_frame_type = it.top_frame_type();
SampleInfo info;
- GetStackSample(isolate, regs, reinterpret_cast<void**>(&stack[0]),
- kMaxFramesCount, &info);
+ GetStackSample(isolate, regs, record_c_entry_frame,
+ reinterpret_cast<void**>(&stack[0]), kMaxFramesCount, &info);
frames_count = static_cast<unsigned>(info.frames_count);
}
void TickSample::GetStackSample(Isolate* isolate, const v8::RegisterState& regs,
+ RecordCEntryFrame record_c_entry_frame,
void** frames, size_t frames_limit,
v8::SampleInfo* sample_info) {
sample_info->frames_count = 0;
@@ -620,6 +622,10 @@ void TickSample::GetStackSample(Isolate* isolate, const v8::RegisterState& regs,
SafeStackFrameIterator it(isolate, reinterpret_cast<Address>(regs.fp),
reinterpret_cast<Address>(regs.sp), js_entry_sp);
size_t i = 0;
+ if (record_c_entry_frame == kIncludeCEntryFrame && !it.done() &&
+ it.top_frame_type() == StackFrame::EXIT) {
+ frames[i++] = isolate->c_function();
+ }
while (!it.done() && i < frames_limit) {
frames[i++] = it.frame()->pc();
it.Advance();
@@ -696,7 +702,7 @@ void Sampler::SampleStack(const v8::RegisterState& state) {
TickSample* sample = isolate_->cpu_profiler()->StartTickSample();
TickSample sample_obj;
if (sample == NULL) sample = &sample_obj;
- sample->Init(isolate_, state);
+ sample->Init(isolate_, state, TickSample::kIncludeCEntryFrame);
if (is_counting_samples_) {
if (sample->state == JS || sample->state == EXTERNAL) {
++js_and_external_sample_count_;
« no previous file with comments | « src/sampler.h ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698