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

Unified Diff: src/profiler/sampler.cc

Issue 1709873002: Do not record CPU profile samples when stack collection is failed. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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
« src/profiler/profile-generator.cc ('K') | « src/profiler/profile-generator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profiler/sampler.cc
diff --git a/src/profiler/sampler.cc b/src/profiler/sampler.cc
index 45f1d4d3efcfd726409b16ec2aa80f0b673b0d92..60397b6fc1c12b281a7604174ce04effe4b4b578 100644
--- a/src/profiler/sampler.cc
+++ b/src/profiler/sampler.cc
@@ -701,6 +701,11 @@ DISABLE_ASAN void TickSample::Init(Isolate* isolate,
GetStackSample(isolate, regs, record_c_entry_frame,
reinterpret_cast<void**>(&stack[0]), kMaxFramesCount, &info);
frames_count = static_cast<unsigned>(info.frames_count);
+ if (!frames_count) {
+ // It is executing JS but failed to collect a stack trace.
+ // Mark the sample as spoiled.
+ pc = 0;
+ }
}
@@ -797,7 +802,7 @@ void Sampler::SampleStack(const v8::RegisterState& state) {
TickSample sample_obj;
if (sample == NULL) sample = &sample_obj;
sample->Init(isolate_, state, TickSample::kIncludeCEntryFrame, true);
- if (is_counting_samples_) {
+ if (is_counting_samples_ && sample->pc) {
if (sample->state == JS) ++js_sample_count_;
if (sample->state == EXTERNAL) ++external_sample_count_;
}
« src/profiler/profile-generator.cc ('K') | « src/profiler/profile-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698