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

Unified Diff: src/sampler.cc

Issue 18418004: Improve test-cpu-profiler.cc tests stability (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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') | test/cctest/test-cpu-profiler.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 e86cb68900604a5f05e86bc902be5e648c5ff719..222b3182e81219609e88229c55c7a5a462c9d877 100644
--- a/src/sampler.cc
+++ b/src/sampler.cc
@@ -658,7 +658,8 @@ Sampler::Sampler(Isolate* isolate, int interval)
interval_(interval),
profiling_(false),
active_(false),
- samples_taken_(0) {
+ is_counting_samples_(false),
+ js_and_external_sample_count_(0) {
data_ = new PlatformData;
}
@@ -688,7 +689,11 @@ void Sampler::SampleStack(const RegisterState& state) {
TickSample sample_obj;
if (sample == NULL) sample = &sample_obj;
sample->Init(isolate_, state);
- if (++samples_taken_ < 0) samples_taken_ = 0;
+ if (is_counting_samples_) {
+ if (sample->state == JS || sample->state == EXTERNAL) {
+ ++js_and_external_sample_count_;
+ }
+ }
Tick(sample);
}
« no previous file with comments | « src/sampler.h ('k') | test/cctest/test-cpu-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698