OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This header file defines the set of trace_event macros without specifying | 5 // This header file defines the set of trace_event macros without specifying |
6 // how the events actually get collected and stored. If you need to expose trace | 6 // how the events actually get collected and stored. If you need to expose trace |
7 // events to some other universe, you can copy-and-paste this file as well as | 7 // events to some other universe, you can copy-and-paste this file as well as |
8 // trace_event.h, modifying the macros contained there as necessary for the | 8 // trace_event.h, modifying the macros contained there as necessary for the |
9 // target platform. The end result is that multiple libraries can funnel events | 9 // target platform. The end result is that multiple libraries can funnel events |
10 // through to a shared trace event collector. | 10 // through to a shared trace event collector. |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 // MyData() {} | 149 // MyData() {} |
150 // void AppendAsTraceFormat(std::string* out) const override { | 150 // void AppendAsTraceFormat(std::string* out) const override { |
151 // out->append("{\"foo\":1}"); | 151 // out->append("{\"foo\":1}"); |
152 // } | 152 // } |
153 // private: | 153 // private: |
154 // ~MyData() override {} | 154 // ~MyData() override {} |
155 // DISALLOW_COPY_AND_ASSIGN(MyData); | 155 // DISALLOW_COPY_AND_ASSIGN(MyData); |
156 // }; | 156 // }; |
157 // | 157 // |
158 // TRACE_EVENT1("foo", "bar", "data", | 158 // TRACE_EVENT1("foo", "bar", "data", |
159 // scoped_ptr<ConvertableToTraceFormat>(new MyData())); | 159 // std::unique_ptr<ConvertableToTraceFormat>(new MyData())); |
160 // | 160 // |
161 // The trace framework will take ownership if the passed pointer and it will | 161 // The trace framework will take ownership if the passed pointer and it will |
162 // be free'd when the trace buffer is flushed. | 162 // be free'd when the trace buffer is flushed. |
163 // | 163 // |
164 // Note, we only do the conversion when the buffer is flushed, so the provided | 164 // Note, we only do the conversion when the buffer is flushed, so the provided |
165 // data object should not be modified after it's passed to the trace framework. | 165 // data object should not be modified after it's passed to the trace framework. |
166 // | 166 // |
167 // | 167 // |
168 // Thread Safety: | 168 // Thread Safety: |
169 // A thread safe singleton and mutex are used for thread safety. Category | 169 // A thread safe singleton and mutex are used for thread safety. Category |
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1088 | 1088 |
1089 // Enum reflecting the scope of an INSTANT event. Must fit within | 1089 // Enum reflecting the scope of an INSTANT event. Must fit within |
1090 // TRACE_EVENT_FLAG_SCOPE_MASK. | 1090 // TRACE_EVENT_FLAG_SCOPE_MASK. |
1091 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3)) | 1091 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3)) |
1092 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3)) | 1092 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3)) |
1093 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3)) | 1093 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3)) |
1094 | 1094 |
1095 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g') | 1095 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g') |
1096 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p') | 1096 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p') |
1097 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t') | 1097 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t') |
OLD | NEW |