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

Unified Diff: src/cpu-profiler.cc

Issue 23690003: Revert "Add Chromium-style TimeDelta, Time and TimeTicks classes, and a new ElapsedTimer class." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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/cpu-profiler.h ('k') | src/deoptimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cpu-profiler.cc
diff --git a/src/cpu-profiler.cc b/src/cpu-profiler.cc
index 0802687a1c9ea22cd4888df0ce3f9ca49bebb7bc..f8698b31005ce1953c9dd2bb2340e7f5354652e1 100644
--- a/src/cpu-profiler.cc
+++ b/src/cpu-profiler.cc
@@ -46,12 +46,12 @@ static const int kProfilerStackSize = 64 * KB;
ProfilerEventsProcessor::ProfilerEventsProcessor(
ProfileGenerator* generator,
Sampler* sampler,
- TimeDelta period)
+ int period_in_useconds)
: Thread(Thread::Options("v8:ProfEvntProc", kProfilerStackSize)),
generator_(generator),
sampler_(sampler),
running_(true),
- period_(period),
+ period_in_useconds_(period_in_useconds),
last_code_event_id_(0), last_processed_code_event_id_(0) {
}
@@ -124,10 +124,9 @@ bool ProfilerEventsProcessor::ProcessTicks() {
void ProfilerEventsProcessor::ProcessEventsAndDoSample() {
- ElapsedTimer timer;
- timer.Start();
+ int64_t stop_time = OS::Ticks() + period_in_useconds_;
// Keep processing existing events until we need to do next sample.
- while (!timer.HasExpired(period_)) {
+ while (OS::Ticks() < stop_time) {
if (ProcessTicks()) {
// All ticks of the current dequeue_order are processed,
// proceed to the next code event.
@@ -435,8 +434,7 @@ void CpuProfiler::StartProcessorIfNotStarted() {
generator_ = new ProfileGenerator(profiles_);
Sampler* sampler = logger->sampler();
processor_ = new ProfilerEventsProcessor(
- generator_, sampler,
- TimeDelta::FromMicroseconds(FLAG_cpu_profiler_sampling_interval));
+ generator_, sampler, FLAG_cpu_profiler_sampling_interval);
is_profiling_ = true;
// Enumerate stuff we already have in the heap.
ASSERT(isolate_->heap()->HasBeenSetUp());
« no previous file with comments | « src/cpu-profiler.h ('k') | src/deoptimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698