• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
2 //
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
5 // met:
6 //
7 //    * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 //    * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the
12 // distribution.
13 //    * Neither the name of Google Inc. nor the name Chromium Embedded
14 // Framework nor the names of its contributors may be used to endorse
15 // or promote products derived from this software without specific prior
16 // written permission.
17 //
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 #ifndef CEF_INCLUDE_INTERNAL_CEF_TRACE_EVENT_INTERNAL_H_
31 #define CEF_INCLUDE_INTERNAL_CEF_TRACE_EVENT_INTERNAL_H_
32 #pragma once
33 
34 #include "include/internal/cef_export.h"
35 #include "include/internal/cef_types.h"
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 // See include/base/cef_trace_event.h for macros and intended usage.
42 
43 // Functions for tracing counters and functions; called from macros.
44 // - |category| string must have application lifetime (static or literal). They
45 //   may not include "(quotes) chars.
46 // - |argX_name|, |argX_val|, |valueX_name|, |valeX_val| are optional parameters
47 //   and represent pairs of name and values of arguments
48 // - |copy| is used to avoid memory scoping issues with the |name| and
49 //   |arg_name| parameters by copying them
50 // - |id| is used to disambiguate counters with the same name, or match async
51 //   trace events
52 
53 CEF_EXPORT void cef_trace_event_instant(const char* category,
54                                         const char* name,
55                                         const char* arg1_name,
56                                         uint64 arg1_val,
57                                         const char* arg2_name,
58                                         uint64 arg2_val,
59                                         int copy);
60 CEF_EXPORT void cef_trace_event_begin(const char* category,
61                                       const char* name,
62                                       const char* arg1_name,
63                                       uint64 arg1_val,
64                                       const char* arg2_name,
65                                       uint64 arg2_val,
66                                       int copy);
67 CEF_EXPORT void cef_trace_event_end(const char* category,
68                                     const char* name,
69                                     const char* arg1_name,
70                                     uint64 arg1_val,
71                                     const char* arg2_name,
72                                     uint64 arg2_val,
73                                     int copy);
74 CEF_EXPORT void cef_trace_counter(const char* category,
75                                   const char* name,
76                                   const char* value1_name,
77                                   uint64 value1_val,
78                                   const char* value2_name,
79                                   uint64 value2_val,
80                                   int copy);
81 CEF_EXPORT void cef_trace_counter_id(const char* category,
82                                      const char* name,
83                                      uint64 id,
84                                      const char* value1_name,
85                                      uint64 value1_val,
86                                      const char* value2_name,
87                                      uint64 value2_val,
88                                      int copy);
89 CEF_EXPORT void cef_trace_event_async_begin(const char* category,
90                                             const char* name,
91                                             uint64 id,
92                                             const char* arg1_name,
93                                             uint64 arg1_val,
94                                             const char* arg2_name,
95                                             uint64 arg2_val,
96                                             int copy);
97 CEF_EXPORT void cef_trace_event_async_step_into(const char* category,
98                                                 const char* name,
99                                                 uint64 id,
100                                                 uint64 step,
101                                                 const char* arg1_name,
102                                                 uint64 arg1_val,
103                                                 int copy);
104 CEF_EXPORT void cef_trace_event_async_step_past(const char* category,
105                                                 const char* name,
106                                                 uint64 id,
107                                                 uint64 step,
108                                                 const char* arg1_name,
109                                                 uint64 arg1_val,
110                                                 int copy);
111 CEF_EXPORT void cef_trace_event_async_end(const char* category,
112                                           const char* name,
113                                           uint64 id,
114                                           const char* arg1_name,
115                                           uint64 arg1_val,
116                                           const char* arg2_name,
117                                           uint64 arg2_val,
118                                           int copy);
119 
120 #ifdef __cplusplus
121 }
122 #endif  // __cplusplus
123 
124 #endif  // CEF_INCLUDE_INTERNAL_CEF_TRACE_EVENT_INTERNAL_H_
125