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

Side by Side Diff: src/log.cc

Issue 2108393002: Split Ticker into two samplers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/profiler/cpu-profiler.h » ('j') | src/profiler/cpu-profiler.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/log.h" 5 #include "src/log.h"
6 6
7 #include <cstdarg> 7 #include <cstdarg>
8 #include <sstream> 8 #include <sstream>
9 9
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 } 644 }
645 645
646 void SampleStack(const v8::RegisterState& state) override { 646 void SampleStack(const v8::RegisterState& state) override {
647 v8::Isolate* v8_isolate = isolate(); 647 v8::Isolate* v8_isolate = isolate();
648 Isolate* isolate = reinterpret_cast<Isolate*>(v8_isolate); 648 Isolate* isolate = reinterpret_cast<Isolate*>(v8_isolate);
649 #if defined(USE_SIMULATOR) 649 #if defined(USE_SIMULATOR)
650 if (!SimulatorHelper::FillRegisters(isolate, 650 if (!SimulatorHelper::FillRegisters(isolate,
651 const_cast<v8::RegisterState*>(&state))) 651 const_cast<v8::RegisterState*>(&state)))
652 return; 652 return;
653 #endif 653 #endif
654 TickSample* sample = isolate->cpu_profiler()->StartTickSample(); 654 TickSample sample;
655 TickSample sample_obj; 655 sample.Init(isolate, state, TickSample::kIncludeCEntryFrame, true);
656 if (sample == NULL) sample = &sample_obj; 656 if (is_counting_samples_ && !sample.timestamp.IsNull()) {
alph 2016/06/30 01:21:01 Is it used in the profiler tests? If not, you can
lpy 2016/06/30 21:13:03 Done.
657 sample->Init(isolate, state, TickSample::kIncludeCEntryFrame, true); 657 if (sample.state == JS) ++js_sample_count_;
658 if (is_counting_samples_ && !sample->timestamp.IsNull()) { 658 if (sample.state == EXTERNAL) ++external_sample_count_;
659 if (sample->state == JS) ++js_sample_count_;
660 if (sample->state == EXTERNAL) ++external_sample_count_;
661 } 659 }
662 if (profiler_) profiler_->Insert(sample); 660 if (profiler_) profiler_->Insert(&sample);
663 if (sample != &sample_obj) {
664 isolate->cpu_profiler()->FinishTickSample();
665 }
666 } 661 }
667 662
668 private: 663 private:
669 Profiler* profiler_; 664 Profiler* profiler_;
670 SamplingThread* sampling_thread_; 665 SamplingThread* sampling_thread_;
671 }; 666 };
672 667
673 668
674 // 669 //
675 // Profiler implementation. 670 // Profiler implementation.
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1879 1874
1880 if (profiler_listener_.get() != nullptr) { 1875 if (profiler_listener_.get() != nullptr) {
1881 removeCodeEventListener(profiler_listener_.get()); 1876 removeCodeEventListener(profiler_listener_.get());
1882 } 1877 }
1883 1878
1884 return log_->Close(); 1879 return log_->Close();
1885 } 1880 }
1886 1881
1887 } // namespace internal 1882 } // namespace internal
1888 } // namespace v8 1883 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/profiler/cpu-profiler.h » ('j') | src/profiler/cpu-profiler.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698