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

Unified Diff: base/trace_event/trace_event.h

Issue 1427063002: Tracing: Add metadata indicating whether we have a high-resolution clock available (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | content/browser/tracing/tracing_controller_impl.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 ab5847faf967761a47e75a65e15565175196a86d..17095236f0d3b15e1eb91abf270e7d47dc45d60e 100644
--- a/base/trace_event/trace_event.h
+++ b/base/trace_event/trace_event.h
@@ -765,6 +765,21 @@ static inline void AddMetadataEvent(
convertable_values, TRACE_EVENT_FLAG_NONE);
}
+template <class ARG1_TYPE>
+static void AddMetadataEvent(const char* event_name,
+ const char* arg_name,
+ const ARG1_TYPE& arg_val) {
+ const int num_args = 1;
+ const char* arg_names[1] = {arg_name};
+ unsigned char arg_types[1];
+ unsigned long long arg_values[1];
+ SetTraceValue(arg_val, &arg_types[0], &arg_values[0]);
+
+ base::trace_event::TraceLog::GetInstance()->AddMetadataEvent(
+ event_name, num_args, arg_names, arg_types, arg_values, nullptr,
+ TRACE_EVENT_FLAG_NONE);
+}
+
// Used by TRACE_EVENTx macros. Do not use directly.
class TRACE_EVENT_API_CLASS_EXPORT ScopedTracer {
public:
« no previous file with comments | « no previous file | content/browser/tracing/tracing_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698