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

Side by Side Diff: webrtc/base/event_tracer.h

Issue 1457383002: Implement standalone event tracing in AppRTCDemo. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: fix some bugs after testing on device woo Created 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 // This file defines the interface for event tracing in WebRTC. 11 // This file defines the interface for event tracing in WebRTC.
12 // 12 //
13 // Event log handlers are set through SetupEventTracer(). User of this API will 13 // Event log handlers are set through SetupEventTracer(). User of this API will
14 // provide two function pointers to handle event tracing calls. 14 // provide two function pointers to handle event tracing calls.
15 // 15 //
16 // * GetCategoryEnabledPtr 16 // * GetCategoryEnabledPtr
17 // Event tracing system calls this function to determine if a particular 17 // Event tracing system calls this function to determine if a particular
18 // event category is enabled. 18 // event category is enabled.
19 // 19 //
20 // * AddTraceEventPtr 20 // * AddTraceEventPtr
21 // Adds a tracing event. It is the user's responsibility to log the data 21 // Adds a tracing event. It is the user's responsibility to log the data
22 // provided. 22 // provided.
23 // 23 //
24 // Parameters for the above two functions are described in trace_event.h. 24 // Parameters for the above two functions are described in trace_event.h.
25 25
26 #ifndef WEBRTC_BASE_EVENT_TRACER_H_ 26 #ifndef WEBRTC_BASE_EVENT_TRACER_H_
27 #define WEBRTC_BASE_EVENT_TRACER_H_ 27 #define WEBRTC_BASE_EVENT_TRACER_H_
28 28
29 #include <stdio.h>
30
29 namespace webrtc { 31 namespace webrtc {
30 32
31 typedef const unsigned char* (*GetCategoryEnabledPtr)(const char* name); 33 typedef const unsigned char* (*GetCategoryEnabledPtr)(const char* name);
32 typedef void (*AddTraceEventPtr)(char phase, 34 typedef void (*AddTraceEventPtr)(char phase,
33 const unsigned char* category_enabled, 35 const unsigned char* category_enabled,
34 const char* name, 36 const char* name,
35 unsigned long long id, 37 unsigned long long id,
36 int num_args, 38 int num_args,
37 const char** arg_names, 39 const char** arg_names,
38 const unsigned char* arg_types, 40 const unsigned char* arg_types,
(...skipping 18 matching lines...) Expand all
57 static void AddTraceEvent( 59 static void AddTraceEvent(
58 char phase, 60 char phase,
59 const unsigned char* category_enabled, 61 const unsigned char* category_enabled,
60 const char* name, 62 const char* name,
61 unsigned long long id, 63 unsigned long long id,
62 int num_args, 64 int num_args,
63 const char** arg_names, 65 const char** arg_names,
64 const unsigned char* arg_types, 66 const unsigned char* arg_types,
65 const unsigned long long* arg_values, 67 const unsigned long long* arg_values,
66 unsigned char flags); 68 unsigned char flags);
69
70 // Set up internal event tracer.
71 static void SetupInternalTracer();
tommi 2015/11/24 16:27:09 would it make sense to move these out of the class
72 static bool StartInternalCapture(const char* filename);
73 static void StartInternalCaptureToFile(FILE* file);
74 static void StopInternalCapture();
75 // Make sure we run this, this will tear down the internal tracing.
76 static void ShutdownInternalTracer();
67 }; 77 };
68 78
69 } // namespace webrtc 79 } // namespace webrtc
70 80
71 #endif // WEBRTC_BASE_EVENT_TRACER_H_ 81 #endif // WEBRTC_BASE_EVENT_TRACER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698