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

Unified Diff: base/trace_event/trace_event.h

Issue 1121463005: Fixit: Split base::TimeTicks --> TimeTicks + ThreadTicks + TraceTicks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More Windows compile fixes. Created 5 years, 7 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 | « base/time/time_win_unittest.cc ('k') | base/trace_event/trace_event_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/trace_event.h
diff --git a/base/trace_event/trace_event.h b/base/trace_event/trace_event.h
index 9511f80153950d2124ec82ac1306b8c96ce90319..5032c80b120317bf2ce044a0a0f07ceb2b9268bd 100644
--- a/base/trace_event/trace_event.h
+++ b/base/trace_event/trace_event.h
@@ -926,7 +926,7 @@
// const char* name,
// unsigned long long id,
// int thread_id,
-// const TimeTicks& timestamp,
+// const TraceTicks& timestamp,
// int num_args,
// const char** arg_names,
// const unsigned char* arg_types,
@@ -1055,7 +1055,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(), \
- thread_id, base::TimeTicks::FromInternalValue(timestamp), \
+ thread_id, base::TraceTicks::FromInternalValue(timestamp), \
trace_event_flags | TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP, \
##__VA_ARGS__); \
} \
@@ -1295,8 +1295,8 @@ static inline void SetTraceValue(const std::string& arg,
*value = type_value.as_uint;
}
-// base::Time and base::TimeTicks version of SetTraceValue to make it easier to
-// trace these types.
+// base::Time, base::TimeTicks, etc. versions of SetTraceValue to make it easier
+// to trace these types.
static inline void SetTraceValue(const base::Time arg,
unsigned char* type,
unsigned long long* value) {
@@ -1311,6 +1311,20 @@ static inline void SetTraceValue(const base::TimeTicks arg,
*value = arg.ToInternalValue();
}
+static inline void SetTraceValue(const base::ThreadTicks arg,
+ unsigned char* type,
+ unsigned long long* value) {
+ *type = TRACE_VALUE_TYPE_INT;
+ *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
@@ -1324,7 +1338,7 @@ AddTraceEventWithThreadIdAndTimestamp(
const char* name,
unsigned long long id,
int thread_id,
- const base::TimeTicks& timestamp,
+ const base::TraceTicks& timestamp,
unsigned char flags,
const char* arg1_name,
const scoped_refptr<base::trace_event::ConvertableToTraceFormat>&
@@ -1344,7 +1358,7 @@ AddTraceEventWithThreadIdAndTimestamp(
const char* name,
unsigned long long id,
int thread_id,
- const base::TimeTicks& timestamp,
+ const base::TraceTicks& timestamp,
unsigned char flags,
const char* arg1_name,
const ARG1_TYPE& arg1_val,
@@ -1376,7 +1390,7 @@ AddTraceEventWithThreadIdAndTimestamp(
const char* name,
unsigned long long id,
int thread_id,
- const base::TimeTicks& timestamp,
+ const base::TraceTicks& timestamp,
unsigned char flags,
const char* arg1_name,
const scoped_refptr<base::trace_event::ConvertableToTraceFormat>& arg1_val,
@@ -1407,7 +1421,7 @@ AddTraceEventWithThreadIdAndTimestamp(
const char* name,
unsigned long long id,
int thread_id,
- const base::TimeTicks& timestamp,
+ const base::TraceTicks& timestamp,
unsigned char flags,
const char* arg1_name,
const scoped_refptr<base::trace_event::ConvertableToTraceFormat>& arg1_val,
@@ -1433,7 +1447,7 @@ AddTraceEventWithThreadIdAndTimestamp(
const char* name,
unsigned long long id,
int thread_id,
- const base::TimeTicks& timestamp,
+ const base::TraceTicks& timestamp,
unsigned char flags) {
return TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP(
phase, category_group_enabled, name, id, thread_id, timestamp,
@@ -1447,7 +1461,7 @@ static inline base::trace_event::TraceEventHandle AddTraceEvent(
unsigned long long id,
unsigned char flags) {
int thread_id = static_cast<int>(base::PlatformThread::CurrentId());
- base::TimeTicks now = base::TimeTicks::NowFromSystemTraceTime();
+ base::TraceTicks now = base::TraceTicks::Now();
return AddTraceEventWithThreadIdAndTimestamp(phase, category_group_enabled,
name, id, thread_id, now, flags);
}
@@ -1460,7 +1474,7 @@ AddTraceEventWithThreadIdAndTimestamp(
const char* name,
unsigned long long id,
int thread_id,
- const base::TimeTicks& timestamp,
+ const base::TraceTicks& timestamp,
unsigned char flags,
const char* arg1_name,
const ARG1_TYPE& arg1_val) {
@@ -1483,7 +1497,7 @@ static inline base::trace_event::TraceEventHandle AddTraceEvent(
const char* arg1_name,
const ARG1_TYPE& arg1_val) {
int thread_id = static_cast<int>(base::PlatformThread::CurrentId());
- base::TimeTicks now = base::TimeTicks::NowFromSystemTraceTime();
+ base::TraceTicks now = base::TraceTicks::Now();
return AddTraceEventWithThreadIdAndTimestamp(phase, category_group_enabled,
name, id, thread_id, now, flags,
arg1_name, arg1_val);
@@ -1497,7 +1511,7 @@ AddTraceEventWithThreadIdAndTimestamp(
const char* name,
unsigned long long id,
int thread_id,
- const base::TimeTicks& timestamp,
+ const base::TraceTicks& timestamp,
unsigned char flags,
const char* arg1_name,
const ARG1_TYPE& arg1_val,
@@ -1526,7 +1540,7 @@ static inline base::trace_event::TraceEventHandle AddTraceEvent(
const char* arg2_name,
const ARG2_TYPE& arg2_val) {
int thread_id = static_cast<int>(base::PlatformThread::CurrentId());
- base::TimeTicks now = base::TimeTicks::NowFromSystemTraceTime();
+ base::TraceTicks now = base::TraceTicks::Now();
return AddTraceEventWithThreadIdAndTimestamp(phase, category_group_enabled,
name, id, thread_id, now, flags,
arg1_name, arg1_val,
« no previous file with comments | « base/time/time_win_unittest.cc ('k') | base/trace_event/trace_event_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698