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

Unified Diff: webkit/glue/webkitplatformsupport_impl.cc

Issue 11366109: Adding raw tracing to trace framework. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changing AddTraceEvent API to always accept a tid and timestamp. Created 8 years 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
« base/debug/trace_event.h ('K') | « base/debug/trace_event_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webkitplatformsupport_impl.cc
diff --git a/webkit/glue/webkitplatformsupport_impl.cc b/webkit/glue/webkitplatformsupport_impl.cc
index 0b22bd1c1a82904f9b2c7b7f5b59dca87b9a74f1..bb5ccdfc3cbe1149cddc5d94d069ec69dd327a2c 100644
--- a/webkit/glue/webkitplatformsupport_impl.cc
+++ b/webkit/glue/webkitplatformsupport_impl.cc
@@ -382,7 +382,11 @@ int WebKitPlatformSupportImpl::addTraceEvent(
int threshold_begin_id,
long long threshold,
unsigned char flags) {
+ int thread_id = static_cast<int>(base::PlatformThread::CurrentId());
+ base::TimeTicks now = base::TimeTicks::NowFromSystemTraceTime() -
+ base::debug::TraceLog::GetInstance()->GetTimeOffset();
TRACE_EVENT_API_ADD_TRACE_EVENT(phase, category_enabled, name, id,
+ thread_id, now.ToInternalValue(),
num_args, arg_names, arg_types,
arg_values, flags);
return -1;
@@ -398,7 +402,11 @@ void WebKitPlatformSupportImpl::addTraceEvent(
const unsigned char* arg_types,
const unsigned long long* arg_values,
unsigned char flags) {
+ int thread_id = static_cast<int>(base::PlatformThread::CurrentId());
+ base::TimeTicks now = base::TimeTicks::NowFromSystemTraceTime() -
+ base::debug::TraceLog::GetInstance()->GetTimeOffset();
TRACE_EVENT_API_ADD_TRACE_EVENT(phase, category_enabled, name, id,
+ thread_id, now.ToInternalValue(),
num_args, arg_names, arg_types,
arg_values, flags);
}
« base/debug/trace_event.h ('K') | « base/debug/trace_event_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698