Index: base/trace_event/trace_event_impl.cc |
diff --git a/base/trace_event/trace_event_impl.cc b/base/trace_event/trace_event_impl.cc |
index 445cb6db97aad8cedd410c60ef3447ab731c86ce..c83181f6a85cbb8a91ec7a70a0c22b3f8c47f21b 100644 |
--- a/base/trace_event/trace_event_impl.cc |
+++ b/base/trace_event/trace_event_impl.cc |
@@ -1738,6 +1738,7 @@ void TraceLog::Flush(const TraceLog::OutputCallback& cb) { |
FinishFlush(generation); |
} |
+ |
void TraceLog::ConvertTraceEventsToTraceFormat( |
scoped_ptr<TraceBuffer> logged_events, |
const TraceLog::OutputCallback& flush_output_callback) { |
@@ -1745,9 +1746,10 @@ void TraceLog::ConvertTraceEventsToTraceFormat( |
if (flush_output_callback.is_null()) |
return; |
- // The callback need to be called at least once even if there is no events |
- // to let the caller know the completion of flush. |
+ // The callback needs to be called at least once even if there is no events to |
+ // let the caller know the completion of flush. |
bool has_more_events = true; |
+ |
do { |
scoped_refptr<RefCountedString> json_events_str_ptr = |
new RefCountedString(); |
@@ -1889,6 +1891,46 @@ TraceEventHandle TraceLog::AddTraceEventWithThreadIdAndTimestamp( |
unsigned long long id, |
int thread_id, |
const TimeTicks& timestamp, |
+ const TimeTicks& thread_time, |
+ int num_args, |
+ const char** arg_names, |
+ const unsigned char* arg_types, |
+ const unsigned long long* arg_values, |
+ const scoped_refptr<ConvertableToTraceFormat>* convertable_values, |
+ unsigned char flags) { |
+ return AddTraceEventInternal( |
+ phase, category_group_enabled, name, id, thread_id, timestamp, |
+ thread_time, num_args, arg_names, arg_types, arg_values, |
+ convertable_values, flags); |
+} |
+ |
+TraceEventHandle TraceLog::AddTraceEventWithThreadIdAndTimestamp( |
+ char phase, |
+ const unsigned char* category_group_enabled, |
+ const char* name, |
+ unsigned long long id, |
+ int thread_id, |
+ const TimeTicks& timestamp, |
+ int num_args, |
+ const char** arg_names, |
+ const unsigned char* arg_types, |
+ const unsigned long long* arg_values, |
+ const scoped_refptr<ConvertableToTraceFormat>* convertable_values, |
+ unsigned char flags) { |
+ return AddTraceEventWithThreadIdAndTimestamp( |
+ phase, category_group_enabled, name, id, thread_id, timestamp, |
+ ThreadNow(), num_args, arg_names, arg_types, arg_values, |
+ convertable_values, flags); |
+} |
+ |
+TraceEventHandle TraceLog::AddTraceEventInternal( |
+ char phase, |
+ const unsigned char* category_group_enabled, |
+ const char* name, |
+ unsigned long long id, |
+ int thread_id, |
+ const TimeTicks& timestamp, |
+ const TimeTicks& thread_time, |
int num_args, |
const char** arg_names, |
const unsigned char* arg_types, |
@@ -2037,7 +2079,7 @@ TraceEventHandle TraceLog::AddTraceEventWithThreadIdAndTimestamp( |
} |
if (thread_local_event_buffer) |
- thread_local_event_buffer->ReportOverhead(now, thread_now); |
+ thread_local_event_buffer->ReportOverhead(now, thread_time); |
return handle; |
} |