Revision: 20866
Author: [email protected]
Date: Sat Apr 19 14:33:18 2014 UTC
Log: Switch CPU profile start/stop markers to monotonic time.
LOG=N
BUG=363976
[email protected], [email protected]
Review URL: https://codereview.chromium.org/243033002
http://code.google.com/p/v8/source/detail?r=20866
Modified:
/branches/bleeding_edge/include/v8-profiler.h
/branches/bleeding_edge/src/api.cc
/branches/bleeding_edge/src/profile-generator.cc
/branches/bleeding_edge/src/profile-generator.h
=======================================
--- /branches/bleeding_edge/include/v8-profiler.h Fri Mar 28 09:24:49 2014
UTC
+++ /branches/bleeding_edge/include/v8-profiler.h Sat Apr 19 14:33:18 2014
UTC
@@ -118,14 +118,15 @@
const CpuProfileNode* GetSample(int index) const;
/**
- * Returns time when the profile recording started (in microseconds
- * since the Epoch).
+ * Returns time when the profile recording was started (in microseconds)
+ * since some unspecified starting point.
*/
int64_t GetStartTime() const;
/**
- * Returns time when the profile recording was stopped (in microseconds
- * since the Epoch).
+ * Returns time when the profile recording was stopped (in microseconds)
+ * since some unspecified starting point. The point is however equal to
the
+ * starting point used by GetStartTime.
*/
int64_t GetEndTime() const;
=======================================
--- /branches/bleeding_edge/src/api.cc Thu Apr 17 13:27:02 2014 UTC
+++ /branches/bleeding_edge/src/api.cc Sat Apr 19 14:33:18 2014 UTC
@@ -7084,13 +7084,13 @@
int64_t CpuProfile::GetStartTime() const {
const i::CpuProfile* profile = reinterpret_cast<const
i::CpuProfile*>(this);
- return (profile->start_time() - i::Time::UnixEpoch()).InMicroseconds();
+ return (profile->start_time() - i::TimeTicks()).InMicroseconds();
}
int64_t CpuProfile::GetEndTime() const {
const i::CpuProfile* profile = reinterpret_cast<const
i::CpuProfile*>(this);
- return (profile->end_time() - i::Time::UnixEpoch()).InMicroseconds();
+ return (profile->end_time() - i::TimeTicks()).InMicroseconds();
}
=======================================
--- /branches/bleeding_edge/src/profile-generator.cc Wed Dec 18 09:12:31
2013 UTC
+++ /branches/bleeding_edge/src/profile-generator.cc Sat Apr 19 14:33:18
2014 UTC
@@ -355,8 +355,7 @@
CpuProfile::CpuProfile(const char* title, bool record_samples)
: title_(title),
record_samples_(record_samples),
- start_time_(Time::NowFromSystemTime()) {
- timer_.Start();
+ start_time_(TimeTicks::HighResolutionNow()) {
}
@@ -367,7 +366,7 @@
void CpuProfile::CalculateTotalTicksAndSamplingRate() {
- end_time_ = start_time_ + timer_.Elapsed();
+ end_time_ = TimeTicks::HighResolutionNow();
}
=======================================
--- /branches/bleeding_edge/src/profile-generator.h Wed Dec 18 08:59:09
2013 UTC
+++ /branches/bleeding_edge/src/profile-generator.h Sat Apr 19 14:33:18
2014 UTC
@@ -208,8 +208,8 @@
int samples_count() const { return samples_.length(); }
ProfileNode* sample(int index) const { return samples_.at(index); }
- Time start_time() const { return start_time_; }
- Time end_time() const { return end_time_; }
+ TimeTicks start_time() const { return start_time_; }
+ TimeTicks end_time() const { return end_time_; }
void UpdateTicksScale();
@@ -218,9 +218,8 @@
private:
const char* title_;
bool record_samples_;
- Time start_time_;
- Time end_time_;
- ElapsedTimer timer_;
+ TimeTicks start_time_;
+ TimeTicks end_time_;
List<ProfileNode*> samples_;
ProfileTree top_down_;
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.