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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 // the way we estimate tracing memory overhead. All objects passed to the | 141 // the way we estimate tracing memory overhead. All objects passed to the |
142 // tracing framework should be allocated by malloc to calculate overhead | 142 // tracing framework should be allocated by malloc to calculate overhead |
143 // correctly, while many Blink objects use PartitionAlloc/Oilpan. Convertable | 143 // correctly, while many Blink objects use PartitionAlloc/Oilpan. Convertable |
144 // is an interface to avoid unnecessary conversion but if we allow to use | 144 // is an interface to avoid unnecessary conversion but if we allow to use |
145 // PartitionAlloc/Oilpan backed objects, overhead estimation could be wrong. | 145 // PartitionAlloc/Oilpan backed objects, overhead estimation could be wrong. |
146 // For structured objects, you can use TracedValue. | 146 // For structured objects, you can use TracedValue. |
147 // | 147 // |
148 // class MyData { | 148 // class MyData { |
149 // public: | 149 // public: |
150 // MyData() {} | 150 // MyData() {} |
151 // std::unique_ptr<TracedValue> toTracedValue() { | 151 // PassOwnPtr<TracedValue> toTracedValue() { |
152 // std::unique_ptr<TracedValue> tracedValue = TracedValue::create(); | 152 // OwnPtr<TracedValue> tracedValue = TracedValue::create(); |
153 // tracedValue->setInteger("foo", 1); | 153 // tracedValue->setInteger("foo", 1); |
154 // tracedValue->beginArray("bar"); | 154 // tracedValue->beginArray("bar"); |
155 // tracedValue->pushInteger(2); | 155 // tracedValue->pushInteger(2); |
156 // tracedValue->pushInteger(3); | 156 // tracedValue->pushInteger(3); |
157 // tracedValue->endArray(); | 157 // tracedValue->endArray(); |
158 // return tracedValue.release(); | 158 // return tracedValue.release(); |
159 // } | 159 // } |
160 // private: | 160 // private: |
161 // ~MyData() override {} | 161 // ~MyData() override {} |
162 // }; | 162 // }; |
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 | 1049 |
1050 // Enum reflecting the scope of an INSTANT event. Must fit within | 1050 // Enum reflecting the scope of an INSTANT event. Must fit within |
1051 // TRACE_EVENT_FLAG_SCOPE_MASK. | 1051 // TRACE_EVENT_FLAG_SCOPE_MASK. |
1052 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3)) | 1052 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3)) |
1053 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3)) | 1053 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3)) |
1054 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3)) | 1054 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3)) |
1055 | 1055 |
1056 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g') | 1056 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g') |
1057 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p') | 1057 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p') |
1058 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t') | 1058 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t') |
OLD | NEW |