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

Unified Diff: src/profiler/profile-generator.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: Make spoiled samples still contribute to the stats. 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
« no previous file with comments | « no previous file | src/profiler/sampler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profiler/profile-generator.cc
diff --git a/src/profiler/profile-generator.cc b/src/profiler/profile-generator.cc
index 4c4205290fd0f677a4b8b876637fcc0f4fbffad0..bd79d934e07a11f86b5cef556206e151ff31584e 100644
--- a/src/profiler/profile-generator.cc
+++ b/src/profiler/profile-generator.cc
@@ -360,7 +360,7 @@ void CpuProfile::AddPath(base::TimeTicks timestamp,
bool update_stats) {
ProfileNode* top_frame_node =
top_down_.AddPathFromEnd(path, src_line, update_stats);
- if (record_samples_) {
+ if (record_samples_ && !timestamp.IsNull()) {
timestamps_.Add(timestamp);
samples_.Add(top_frame_node);
}
@@ -636,10 +636,9 @@ void ProfileGenerator::RecordTickSample(const TickSample& sample) {
}
}
- for (const Address* stack_pos = sample.stack,
- *stack_end = stack_pos + sample.frames_count;
- stack_pos != stack_end;
- ++stack_pos) {
+ for (const Address *stack_pos = sample.stack,
+ *stack_end = stack_pos + sample.frames_count;
+ stack_pos != stack_end; ++stack_pos) {
*entry = code_map_.FindEntry(*stack_pos);
// Skip unresolved frames (e.g. internal frame) and get source line of
« no previous file with comments | « no previous file | src/profiler/sampler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698