From 2bccc2cf38624593e1adafefccec7314aa573b0f Mon Sep 17 00:00:00 2001 From: charliea Date: Thu, 5 Nov 2015 05:48:56 -0800 Subject: Kills TraceTicks, which was functionally the same as TimeTicks This was not true until last week's submission of http://crrev.com/1374753004. BUG=541692 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel NO_PRESUBMIT=true Review URL: https://codereview.chromium.org/1424703003 Cr-Commit-Position: refs/heads/master@{#358047} --- base/time/time.cc | 5 --- base/time/time.h | 66 ++++---------------------------- base/time/time_mac.cc | 5 --- base/time/time_posix.cc | 5 --- base/time/time_unittest.cc | 6 --- base/time/time_win.cc | 14 ------- base/time/time_win_unittest.cc | 2 - base/trace_event/trace_event.h | 31 ++++++--------- base/trace_event/trace_event_android.cc | 2 +- base/trace_event/trace_event_impl.cc | 4 +- base/trace_event/trace_event_impl.h | 8 ++-- base/trace_event/trace_event_unittest.cc | 16 ++++---- base/trace_event/trace_log.cc | 22 +++++------ base/trace_event/trace_log.h | 18 ++++----- 14 files changed, 54 insertions(+), 150 deletions(-) (limited to 'base') diff --git a/base/time/time.cc b/base/time/time.cc index 10ffcc6..53851fb 100644 --- a/base/time/time.cc +++ b/base/time/time.cc @@ -326,11 +326,6 @@ std::ostream& operator<<(std::ostream& os, ThreadTicks thread_ticks) { return os << as_time_delta.InMicroseconds() << " bogo-thread-microseconds"; } -std::ostream& operator<<(std::ostream& os, TraceTicks trace_ticks) { - const TimeDelta as_time_delta = trace_ticks - TraceTicks(); - return os << as_time_delta.InMicroseconds() << " bogo-trace-microseconds"; -} - // Time::Exploded ------------------------------------------------------------- inline bool is_in_range(int value, int lo, int hi) { diff --git a/base/time/time.h b/base/time/time.h index 4944085..6c06fbc 100644 --- a/base/time/time.h +++ b/base/time/time.h @@ -13,13 +13,13 @@ // TimeDelta represents a duration of time, internally represented in // microseconds. // -// TimeTicks, ThreadTicks, and TraceTicks represent an abstract time that is -// most of the time incrementing, for use in measuring time durations. -// Internally, they are represented in microseconds. They can not be converted -// to a human-readable time, but are guaranteed not to decrease (unlike the Time -// class). Note that TimeTicks may "stand still" (e.g., if the computer is -// suspended), and ThreadTicks will "stand still" whenever the thread has been -// de-scheduled by the operating system. +// TimeTicks and ThreadTicks represent an abstract time that is most of the time +// incrementing, for use in measuring time durations. Internally, they are +// represented in microseconds. They can not be converted to a human-readable +// time, but are guaranteed not to decrease (unlike the Time class). Note that +// TimeTicks may "stand still" (e.g., if the computer is suspended), and +// ThreadTicks will "stand still" whenever the thread has been de-scheduled by +// the operating system. // // All time classes are copyable, assignable, and occupy 64-bits per // instance. Thus, they can be efficiently passed by-value (as opposed to @@ -45,12 +45,6 @@ // // ThreadTicks: Benchmarking how long the current thread has been doing actual // work. -// -// TraceTicks: This is only meant to be used by the event tracing -// infrastructure, and by outside code modules in special -// circumstances. Please be sure to consult a -// base/trace_event/OWNER before committing any new code that -// uses this. #ifndef BASE_TIME_TIME_H_ #define BASE_TIME_TIME_H_ @@ -784,52 +778,6 @@ class BASE_EXPORT ThreadTicks : public time_internal::TimeBase { // For logging use only. BASE_EXPORT std::ostream& operator<<(std::ostream& os, ThreadTicks time_ticks); -// TraceTicks ---------------------------------------------------------------- - -// Represents high-resolution system trace clock time. -class BASE_EXPORT TraceTicks : public time_internal::TimeBase { - public: - // We define this even without OS_CHROMEOS for seccomp sandbox testing. -#if defined(OS_LINUX) - // Force definition of the system trace clock; it is a chromeos-only api - // at the moment and surfacing it in the right place requires mucking - // with glibc et al. - static const clockid_t kClockSystemTrace = 11; -#endif - - TraceTicks() : TimeBase(0) { - } - - // Returns the current system trace time or, if not available on this - // platform, a high-resolution time value; or a low-resolution time value if - // neither are avalable. On systems where a global trace clock is defined, - // timestamping TraceEvents's with this value guarantees synchronization - // between events collected inside chrome and events collected outside - // (e.g. kernel, X server). - // - // On some platforms, the clock source used for tracing can vary depending on - // hardware and/or kernel support. Do not make any assumptions without - // consulting the documentation for this functionality in the time_win.cc, - // time_posix.cc, etc. files. - // - // NOTE: This is only meant to be used by the event tracing infrastructure, - // and by outside code modules in special circumstances. Please be sure to - // consult a base/trace_event/OWNER before committing any new code that uses - // this. - static TraceTicks Now(); - - private: - friend class time_internal::TimeBase; - - // Please use Now() to create a new object. This is for internal use - // and testing. - explicit TraceTicks(int64 us) : TimeBase(us) { - } -}; - -// For logging use only. -BASE_EXPORT std::ostream& operator<<(std::ostream& os, TraceTicks time_ticks); - } // namespace base #endif // BASE_TIME_TIME_H_ diff --git a/base/time/time_mac.cc b/base/time/time_mac.cc index 8983ab2..578e039 100644 --- a/base/time/time_mac.cc +++ b/base/time/time_mac.cc @@ -231,9 +231,4 @@ ThreadTicks ThreadTicks::Now() { return ThreadTicks(ComputeThreadTicks()); } -// static -TraceTicks TraceTicks::Now() { - return TraceTicks(ComputeCurrentTicks()); -} - } // namespace base diff --git a/base/time/time_posix.cc b/base/time/time_posix.cc index 2c3aaca..d2bb555 100644 --- a/base/time/time_posix.cc +++ b/base/time/time_posix.cc @@ -329,11 +329,6 @@ ThreadTicks ThreadTicks::Now() { #endif } -// static -TraceTicks TraceTicks::Now() { - return TraceTicks(ClockNow(CLOCK_MONOTONIC)); -} - #endif // !OS_MACOSX // static diff --git a/base/time/time_unittest.cc b/base/time/time_unittest.cc index c8b403b..868a546 100644 --- a/base/time/time_unittest.cc +++ b/base/time/time_unittest.cc @@ -665,12 +665,6 @@ TEST(ThreadTicks, MAYBE_ThreadNow) { } } -TEST(TraceTicks, NowFromSystemTraceTime) { - // Re-use HighRes test for now since clock properties are identical. - using NowFunction = TimeTicks (*)(void); - HighResClockTest(reinterpret_cast(&TraceTicks::Now)); -} - TEST(TimeTicks, SnappedToNextTickBasic) { base::TimeTicks phase = base::TimeTicks::FromInternalValue(4000); base::TimeDelta interval = base::TimeDelta::FromMicroseconds(1000); diff --git a/base/time/time_win.cc b/base/time/time_win.cc index bc05804..9584127 100644 --- a/base/time/time_win.cc +++ b/base/time/time_win.cc @@ -48,7 +48,6 @@ using base::ThreadTicks; using base::Time; using base::TimeDelta; using base::TimeTicks; -using base::TraceTicks; namespace { @@ -459,14 +458,6 @@ void InitializeNowFunctionPointer() { // // Otherwise, Now uses the high-resolution QPC clock. As of 21 August 2015, // ~72% of users fall within this category. - // - // TraceTicks::Now() always uses the same clock as TimeTicks::Now(), even - // when the QPC exists but is expensive or unreliable. This is because we'd - // eventually like to merge TraceTicks and TimeTicks and have one type of - // timestamp that is reliable, monotonic, and comparable. Also, while we could - // use the high-resolution timer for TraceTicks even when it's unreliable or - // slow, it's easier to make tracing tools accommodate a coarse timer than - // one that's unreliable or slow. NowFunction now_function; base::CPU cpu; if (ticks_per_sec.QuadPart <= 0 || @@ -613,11 +604,6 @@ double ThreadTicks::TSCTicksPerSecond() { } // static -TraceTicks TraceTicks::Now() { - return TraceTicks() + g_now_function(); -} - -// static TimeTicks TimeTicks::FromQPCValue(LONGLONG qpc_value) { return TimeTicks() + QPCValueToTimeDelta(qpc_value); } diff --git a/base/time/time_win_unittest.cc b/base/time/time_win_unittest.cc index 6f8a9b7..38798d5 100644 --- a/base/time/time_win_unittest.cc +++ b/base/time/time_win_unittest.cc @@ -192,8 +192,6 @@ TEST(TimeTicks, TimerPerformance) { std::vector cases; cases.push_back({reinterpret_cast(&Time::Now), "Time::Now"}); cases.push_back({&TimeTicks::Now, "TimeTicks::Now"}); - cases.push_back( - {reinterpret_cast(&TraceTicks::Now), "TraceTicks::Now"}); if (ThreadTicks::IsSupported()) { ThreadTicks::WaitUntilInitialized(); diff --git a/base/trace_event/trace_event.h b/base/trace_event/trace_event.h index 37320ea..95ea215 100644 --- a/base/trace_event/trace_event.h +++ b/base/trace_event/trace_event.h @@ -154,7 +154,7 @@ // unsigned long long id, // unsigned long long context_id, // int thread_id, -// const TraceTicks& timestamp, +// const TimeTicks& timestamp, // int num_args, // const char** arg_names, // const unsigned char* arg_types, @@ -313,7 +313,7 @@ TRACE_EVENT_API_CLASS_EXPORT extern \ trace_event_internal::AddTraceEventWithThreadIdAndTimestamp( \ phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), \ name, trace_event_trace_id.data(), trace_event_internal::kNoId, \ - thread_id, base::TraceTicks::FromInternalValue(timestamp), \ + thread_id, base::TimeTicks::FromInternalValue(timestamp), \ trace_event_flags | TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP, \ trace_event_internal::kNoId, ##__VA_ARGS__); \ } \ @@ -517,13 +517,6 @@ static inline void SetTraceValue(const base::ThreadTicks arg, *value = arg.ToInternalValue(); } -static inline void SetTraceValue(const base::TraceTicks arg, - unsigned char* type, - unsigned long long* value) { - *type = TRACE_VALUE_TYPE_INT; - *value = arg.ToInternalValue(); -} - // These AddTraceEvent and AddTraceEventWithThreadIdAndTimestamp template // functions are defined here instead of in the macro, because the arg_values // could be temporary objects, such as std::string. In order to store @@ -538,7 +531,7 @@ AddTraceEventWithThreadIdAndTimestamp( unsigned long long id, unsigned long long context_id, int thread_id, - const base::TraceTicks& timestamp, + const base::TimeTicks& timestamp, unsigned int flags, unsigned long long bind_id, const char* arg1_name, @@ -560,7 +553,7 @@ AddTraceEventWithThreadIdAndTimestamp( unsigned long long id, unsigned long long context_id, int thread_id, - const base::TraceTicks& timestamp, + const base::TimeTicks& timestamp, unsigned int flags, unsigned long long bind_id, const char* arg1_name, @@ -595,7 +588,7 @@ AddTraceEventWithThreadIdAndTimestamp( unsigned long long id, unsigned long long context_id, int thread_id, - const base::TraceTicks& timestamp, + const base::TimeTicks& timestamp, unsigned int flags, unsigned long long bind_id, const char* arg1_name, @@ -629,7 +622,7 @@ AddTraceEventWithThreadIdAndTimestamp( unsigned long long id, unsigned long long context_id, int thread_id, - const base::TraceTicks& timestamp, + const base::TimeTicks& timestamp, unsigned int flags, unsigned long long bind_id, const char* arg1_name, @@ -658,7 +651,7 @@ AddTraceEventWithThreadIdAndTimestamp( unsigned long long id, unsigned long long context_id, int thread_id, - const base::TraceTicks& timestamp, + const base::TimeTicks& timestamp, unsigned int flags, unsigned long long bind_id) { return TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( @@ -674,7 +667,7 @@ static inline base::trace_event::TraceEventHandle AddTraceEvent( unsigned int flags, unsigned long long bind_id) { const int thread_id = static_cast(base::PlatformThread::CurrentId()); - const base::TraceTicks now = base::TraceTicks::Now(); + const base::TimeTicks now = base::TimeTicks::Now(); return AddTraceEventWithThreadIdAndTimestamp(phase, category_group_enabled, name, id, kNoId, thread_id, now, flags, bind_id); @@ -689,7 +682,7 @@ AddTraceEventWithThreadIdAndTimestamp( unsigned long long id, unsigned long long context_id, int thread_id, - const base::TraceTicks& timestamp, + const base::TimeTicks& timestamp, unsigned int flags, unsigned long long bind_id, const char* arg1_name, @@ -714,7 +707,7 @@ static inline base::trace_event::TraceEventHandle AddTraceEvent( const char* arg1_name, const ARG1_TYPE& arg1_val) { int thread_id = static_cast(base::PlatformThread::CurrentId()); - base::TraceTicks now = base::TraceTicks::Now(); + base::TimeTicks now = base::TimeTicks::Now(); return AddTraceEventWithThreadIdAndTimestamp(phase, category_group_enabled, name, id, kNoId, thread_id, now, flags, bind_id, @@ -730,7 +723,7 @@ AddTraceEventWithThreadIdAndTimestamp( unsigned long long id, unsigned long long context_id, int thread_id, - const base::TraceTicks& timestamp, + const base::TimeTicks& timestamp, unsigned int flags, unsigned long long bind_id, const char* arg1_name, @@ -761,7 +754,7 @@ static inline base::trace_event::TraceEventHandle AddTraceEvent( const char* arg2_name, const ARG2_TYPE& arg2_val) { int thread_id = static_cast(base::PlatformThread::CurrentId()); - base::TraceTicks now = base::TraceTicks::Now(); + base::TimeTicks now = base::TimeTicks::Now(); return AddTraceEventWithThreadIdAndTimestamp(phase, category_group_enabled, name, id, kNoId, thread_id, now, flags, bind_id, diff --git a/base/trace_event/trace_event_android.cc b/base/trace_event/trace_event_android.cc index c97b902..4e578a5 100644 --- a/base/trace_event/trace_event_android.cc +++ b/base/trace_event/trace_event_android.cc @@ -201,7 +201,7 @@ void TraceLog::AddClockSyncMetadataEvent() { // debugfs that takes the written data and pushes it onto the trace // buffer. So, to establish clock sync, we write our monotonic clock into that // trace buffer. - double now_in_seconds = (TraceTicks::Now() - TraceTicks()).InSecondsF(); + double now_in_seconds = (TimeTicks::Now() - TimeTicks()).InSecondsF(); std::string marker = StringPrintf( "trace_event_clock_sync: parent_ts=%f\n", now_in_seconds); WriteToATrace(atrace_fd, marker.c_str(), marker.size()); diff --git a/base/trace_event/trace_event_impl.cc b/base/trace_event/trace_event_impl.cc index 778ecbf..7e63f72 100644 --- a/base/trace_event/trace_event_impl.cc +++ b/base/trace_event/trace_event_impl.cc @@ -79,7 +79,7 @@ void TraceEvent::CopyFrom(const TraceEvent& other) { void TraceEvent::Initialize( int thread_id, - TraceTicks timestamp, + TimeTicks timestamp, ThreadTicks thread_timestamp, char phase, const unsigned char* category_group_enabled, @@ -177,7 +177,7 @@ void TraceEvent::Reset() { convertable_values_[i] = NULL; } -void TraceEvent::UpdateDuration(const TraceTicks& now, +void TraceEvent::UpdateDuration(const TimeTicks& now, const ThreadTicks& thread_now) { DCHECK_EQ(duration_.ToInternalValue(), -1); duration_ = now - timestamp_; diff --git a/base/trace_event/trace_event_impl.h b/base/trace_event/trace_event_impl.h index cb8b144..84ef52f 100644 --- a/base/trace_event/trace_event_impl.h +++ b/base/trace_event/trace_event_impl.h @@ -95,7 +95,7 @@ class BASE_EXPORT TraceEvent { void Initialize( int thread_id, - TraceTicks timestamp, + TimeTicks timestamp, ThreadTicks thread_timestamp, char phase, const unsigned char* category_group_enabled, @@ -112,7 +112,7 @@ class BASE_EXPORT TraceEvent { void Reset(); - void UpdateDuration(const TraceTicks& now, const ThreadTicks& thread_now); + void UpdateDuration(const TimeTicks& now, const ThreadTicks& thread_now); void EstimateTraceMemoryOverhead(TraceEventMemoryOverhead* overhead); @@ -126,7 +126,7 @@ class BASE_EXPORT TraceEvent { TraceValue value, std::string* out); - TraceTicks timestamp() const { return timestamp_; } + TimeTicks timestamp() const { return timestamp_; } ThreadTicks thread_timestamp() const { return thread_timestamp_; } char phase() const { return phase_; } int thread_id() const { return thread_id_; } @@ -154,7 +154,7 @@ class BASE_EXPORT TraceEvent { private: // Note: these are ordered by size (largest first) for optimal packing. - TraceTicks timestamp_; + TimeTicks timestamp_; ThreadTicks thread_timestamp_; TimeDelta duration_; TimeDelta thread_duration_; diff --git a/base/trace_event/trace_event_unittest.cc b/base/trace_event/trace_event_unittest.cc index 9f694a5..084c250 100644 --- a/base/trace_event/trace_event_unittest.cc +++ b/base/trace_event/trace_event_unittest.cc @@ -2362,10 +2362,10 @@ class TraceEventCallbackTest : public TraceEventTestFixture { std::vector collected_events_categories_; std::vector collected_events_names_; std::vector collected_events_phases_; - std::vector collected_events_timestamps_; + std::vector collected_events_timestamps_; static TraceEventCallbackTest* s_instance; - static void Callback(TraceTicks timestamp, + static void Callback(TimeTicks timestamp, char phase, const unsigned char* category_group_enabled, const char* name, @@ -2551,9 +2551,9 @@ TEST_F(TraceEventTestFixture, TraceBufferVectorReportFull) { TraceBuffer::CreateTraceBufferVectorOfSize(100)); do { TRACE_EVENT_BEGIN_WITH_ID_TID_AND_TIMESTAMP0( - "all", "with_timestamp", 0, 0, TraceTicks::Now().ToInternalValue()); + "all", "with_timestamp", 0, 0, TimeTicks::Now().ToInternalValue()); TRACE_EVENT_END_WITH_ID_TID_AND_TIMESTAMP0( - "all", "with_timestamp", 0, 0, TraceTicks::Now().ToInternalValue()); + "all", "with_timestamp", 0, 0, TimeTicks::Now().ToInternalValue()); } while (!trace_log->BufferIsFull()); EndTraceAndFlush(); @@ -2926,7 +2926,7 @@ TEST_F(TraceEventTestFixture, EchoToConsoleTraceEventRecursion) { TEST_F(TraceEventTestFixture, TimeOffset) { BeginTrace(); // Let TraceLog timer start from 0. - TimeDelta time_offset = TraceTicks::Now() - TraceTicks(); + TimeDelta time_offset = TimeTicks::Now() - TimeTicks(); TraceLog::GetInstance()->SetTimeOffset(time_offset); { @@ -2934,15 +2934,15 @@ TEST_F(TraceEventTestFixture, TimeOffset) { TRACE_EVENT0("all", "duration2"); } TRACE_EVENT_BEGIN_WITH_ID_TID_AND_TIMESTAMP0( - "all", "with_timestamp", 0, 0, TraceTicks::Now().ToInternalValue()); + "all", "with_timestamp", 0, 0, TimeTicks::Now().ToInternalValue()); TRACE_EVENT_END_WITH_ID_TID_AND_TIMESTAMP0( - "all", "with_timestamp", 0, 0, TraceTicks::Now().ToInternalValue()); + "all", "with_timestamp", 0, 0, TimeTicks::Now().ToInternalValue()); EndTraceAndFlush(); DropTracedMetadataRecords(); double end_time = static_cast( - (TraceTicks::Now() - time_offset).ToInternalValue()); + (TimeTicks::Now() - time_offset).ToInternalValue()); double last_timestamp = 0; for (size_t i = 0; i < trace_parsed_.GetSize(); ++i) { const DictionaryValue* item; diff --git a/base/trace_event/trace_log.cc b/base/trace_event/trace_log.cc index c9cb1b3..7714776 100644 --- a/base/trace_event/trace_log.cc +++ b/base/trace_event/trace_log.cc @@ -137,7 +137,7 @@ void InitializeMetadataEvent(TraceEvent* trace_event, ::trace_event_internal::SetTraceValue(value, &arg_type, &arg_value); trace_event->Initialize( thread_id, - TraceTicks(), + TimeTicks(), ThreadTicks(), TRACE_EVENT_PHASE_METADATA, &g_category_group_enabled[g_category_metadata], @@ -1080,7 +1080,7 @@ TraceEventHandle TraceLog::AddTraceEvent( const scoped_refptr* convertable_values, unsigned int flags) { int thread_id = static_cast(base::PlatformThread::CurrentId()); - base::TraceTicks now = base::TraceTicks::Now(); + base::TimeTicks now = base::TimeTicks::Now(); return AddTraceEventWithThreadIdAndTimestamp( phase, category_group_enabled, @@ -1111,7 +1111,7 @@ TraceEventHandle TraceLog::AddTraceEventWithContextId( const scoped_refptr* convertable_values, unsigned int flags) { int thread_id = static_cast(base::PlatformThread::CurrentId()); - base::TraceTicks now = base::TraceTicks::Now(); + base::TimeTicks now = base::TimeTicks::Now(); return AddTraceEventWithThreadIdAndTimestamp( phase, category_group_enabled, @@ -1141,7 +1141,7 @@ TraceEventHandle TraceLog::AddTraceEventWithProcessId( const unsigned long long* arg_values, const scoped_refptr* convertable_values, unsigned int flags) { - base::TraceTicks now = base::TraceTicks::Now(); + base::TimeTicks now = base::TimeTicks::Now(); return AddTraceEventWithThreadIdAndTimestamp( phase, category_group_enabled, @@ -1168,7 +1168,7 @@ TraceEventHandle TraceLog::AddTraceEventWithThreadIdAndTimestamp( unsigned long long id, unsigned long long context_id, int thread_id, - const TraceTicks& timestamp, + const TimeTicks& timestamp, int num_args, const char** arg_names, const unsigned char* arg_types, @@ -1200,7 +1200,7 @@ TraceEventHandle TraceLog::AddTraceEventWithThreadIdAndTimestamp( unsigned long long context_id, unsigned long long bind_id, int thread_id, - const TraceTicks& timestamp, + const TimeTicks& timestamp, int num_args, const char** arg_names, const unsigned char* arg_types, @@ -1229,7 +1229,7 @@ TraceEventHandle TraceLog::AddTraceEventWithThreadIdAndTimestamp( id = MangleEventId(id); } - TraceTicks offset_event_timestamp = OffsetTimestamp(timestamp); + TimeTicks offset_event_timestamp = OffsetTimestamp(timestamp); ThreadTicks thread_now = ThreadNow(); // |thread_local_event_buffer_| can be null if the current thread doesn't have @@ -1378,7 +1378,7 @@ void TraceLog::AddMetadataEvent( scoped_ptr trace_event(new TraceEvent); trace_event->Initialize( 0, // thread_id - TraceTicks(), ThreadTicks(), TRACE_EVENT_PHASE_METADATA, + TimeTicks(), ThreadTicks(), TRACE_EVENT_PHASE_METADATA, &g_category_group_enabled[g_category_metadata], name, trace_event_internal::kNoId, // id trace_event_internal::kNoId, // context_id @@ -1391,7 +1391,7 @@ void TraceLog::AddMetadataEvent( // May be called when a COMPELETE event ends and the unfinished event has been // recycled (phase == TRACE_EVENT_PHASE_END and trace_event == NULL). std::string TraceLog::EventToConsoleMessage(unsigned char phase, - const TraceTicks& timestamp, + const TimeTicks& timestamp, TraceEvent* trace_event) { AutoLock thread_info_lock(thread_info_lock_); @@ -1453,7 +1453,7 @@ void TraceLog::UpdateTraceEventDuration( AutoThreadLocalBoolean thread_is_in_trace_event(&thread_is_in_trace_event_); ThreadTicks thread_now = ThreadNow(); - TraceTicks now = OffsetNow(); + TimeTicks now = OffsetNow(); #if defined(OS_WIN) // Generate an ETW event that marks the end of a complete event. @@ -1755,7 +1755,7 @@ ScopedTraceBinaryEfficient::ScopedTraceBinaryEfficient( trace_event_internal::kNoId, // id trace_event_internal::kNoId, // context_id static_cast(base::PlatformThread::CurrentId()), // thread_id - base::TraceTicks::Now(), + base::TimeTicks::Now(), trace_event_internal::kZeroNumArgs, nullptr, nullptr, diff --git a/base/trace_event/trace_log.h b/base/trace_event/trace_log.h index a68a380..eb52733 100644 --- a/base/trace_event/trace_log.h +++ b/base/trace_event/trace_log.h @@ -133,7 +133,7 @@ class BASE_EXPORT TraceLog : public MemoryDumpProvider { // For TRACE_EVENT_PHASE_COMPLETE events, the client will still receive pairs // of TRACE_EVENT_PHASE_BEGIN and TRACE_EVENT_PHASE_END events to keep the // interface simple. - typedef void (*EventCallback)(TraceTicks timestamp, + typedef void (*EventCallback)(TimeTicks timestamp, char phase, const unsigned char* category_group_enabled, const char* name, @@ -221,7 +221,7 @@ class BASE_EXPORT TraceLog : public MemoryDumpProvider { unsigned long long id, unsigned long long context_id, int thread_id, - const TraceTicks& timestamp, + const TimeTicks& timestamp, int num_args, const char** arg_names, const unsigned char* arg_types, @@ -236,7 +236,7 @@ class BASE_EXPORT TraceLog : public MemoryDumpProvider { unsigned long long context_id, unsigned long long bind_id, int thread_id, - const TraceTicks& timestamp, + const TimeTicks& timestamp, int num_args, const char** arg_names, const unsigned char* arg_types, @@ -301,7 +301,7 @@ class BASE_EXPORT TraceLog : public MemoryDumpProvider { // sort index, ascending, then by their name, and then tid. void SetThreadSortIndex(PlatformThreadId thread_id, int sort_index); - // Allow setting an offset between the current TraceTicks time and the time + // Allow setting an offset between the current TimeTicks time and the time // that should be reported. void SetTimeOffset(TimeDelta offset); @@ -374,7 +374,7 @@ class BASE_EXPORT TraceLog : public MemoryDumpProvider { TraceBuffer* CreateTraceBuffer(); std::string EventToConsoleMessage(unsigned char phase, - const TraceTicks& timestamp, + const TimeTicks& timestamp, TraceEvent* trace_event); TraceEvent* AddEventToThreadSharedChunkWhileLocked(TraceEventHandle* handle, @@ -408,8 +408,8 @@ class BASE_EXPORT TraceLog : public MemoryDumpProvider { } void UseNextTraceBuffer(); - TraceTicks OffsetNow() const { return OffsetTimestamp(TraceTicks::Now()); } - TraceTicks OffsetTimestamp(const TraceTicks& timestamp) const { + TimeTicks OffsetNow() const { return OffsetTimestamp(TimeTicks::Now()); } + TimeTicks OffsetTimestamp(const TimeTicks& timestamp) const { return timestamp - time_offset_; } @@ -444,10 +444,10 @@ class BASE_EXPORT TraceLog : public MemoryDumpProvider { base::hash_map thread_names_; // The following two maps are used only when ECHO_TO_CONSOLE. - base::hash_map> thread_event_start_times_; + base::hash_map> thread_event_start_times_; base::hash_map thread_colors_; - TraceTicks buffer_limit_reached_timestamp_; + TimeTicks buffer_limit_reached_timestamp_; // XORed with TraceID to make it unlikely to collide with other processes. unsigned long long process_id_hash_; -- cgit v1.1