Index: webrtc/base/trace_event.h |
diff --git a/webrtc/base/trace_event.h b/webrtc/base/trace_event.h |
index 3916af4fb61bf713139f60f617c02793b24ade3e..54d2f2cc80be8691ae8c0e6a94cdd1e9bd97f62f 100644 |
--- a/webrtc/base/trace_event.h |
+++ b/webrtc/base/trace_event.h |
@@ -1,7 +1,12 @@ |
-// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
-// Use of this source code is governed by a BSD-style license that can be |
-// found in the LICENSE file under third_party_mods/chromium or at: |
-// http://src.chromium.org/svn/trunk/src/LICENSE |
+/* |
+ * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
+ * |
+ * Use of this source code is governed by a BSD-style license |
+ * that can be found in the LICENSE file in the root of the source |
+ * tree. An additional intellectual property rights grant can be found |
+ * in the file PATENTS. All contributing project authors may |
+ * be found in the AUTHORS file in the root of the source tree. |
+ */ |
#ifndef WEBRTC_BASE_TRACE_EVENT_H_ |
#define WEBRTC_BASE_TRACE_EVENT_H_ |
@@ -157,7 +162,7 @@ |
webrtc::trace_event_internal::TraceID::ForceMangle(id) |
// Records a pair of begin and end events called "name" for the current |
-// scope, with 0, 1 or 2 associated arguments. If the category is not |
+// scope, with 0, 1, 2, or 3 associated arguments. If the category is not |
// enabled, then this does nothing. |
// - category and name strings must have application lifetime (statics or |
// literals). They may not include " chars. |
@@ -168,6 +173,10 @@ |
#define TRACE_EVENT2(category, name, arg1_name, arg1_val, arg2_name, arg2_val) \ |
INTERNAL_TRACE_EVENT_ADD_SCOPED(category, name, arg1_name, arg1_val, \ |
arg2_name, arg2_val) |
+#define TRACE_EVENT3(category, name, arg1_name, arg1_val, arg2_name, arg2_val, \ |
+ arg3_name, arg3_val) \ |
+ INTERNAL_TRACE_EVENT_ADD_SCOPED(category, name, arg1_name, arg1_val, \ |
+ arg2_name, arg2_val, arg3_name, arg3_val) |
// Same as TRACE_EVENT except that they are not included in official builds. |
#ifdef OFFICIAL_BUILD |
@@ -866,6 +875,29 @@ static inline void AddTraceEvent(char phase, |
flags); |
} |
+template <class ARG1_TYPE, class ARG2_TYPE, class ARG3_TYPE> |
+static inline void AddTraceEvent(char phase, |
+ const unsigned char* category_enabled, |
+ const char* name, |
+ unsigned long long id, |
+ unsigned char flags, |
+ const char* arg1_name, |
+ const ARG1_TYPE& arg1_val, |
+ const char* arg2_name, |
+ const ARG2_TYPE& arg2_val, |
+ const char* arg3_name, |
+ const ARG3_TYPE& arg3_val) { |
+ const int num_args = 3; |
+ const char* arg_names[3] = {arg1_name, arg2_name, arg3_name}; |
+ unsigned char arg_types[3]; |
+ unsigned long long arg_values[3]; |
+ SetTraceValue(arg1_val, &arg_types[0], &arg_values[0]); |
+ SetTraceValue(arg2_val, &arg_types[1], &arg_values[1]); |
+ SetTraceValue(arg3_val, &arg_types[2], &arg_values[2]); |
+ TRACE_EVENT_API_ADD_TRACE_EVENT(phase, category_enabled, name, id, num_args, |
+ arg_names, arg_types, arg_values, flags); |
+} |
+ |
// Used by TRACE_EVENTx macro. Do not use directly. |
class TraceEndOnScopeClose { |
public: |