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); |
} |