OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 5 |
6 #ifndef BASE_DEBUG_TRACE_EVENT_IMPL_H_ | 6 #ifndef BASE_DEBUG_TRACE_EVENT_IMPL_H_ |
7 #define BASE_DEBUG_TRACE_EVENT_IMPL_H_ | 7 #define BASE_DEBUG_TRACE_EVENT_IMPL_H_ |
8 | 8 |
9 #include <stack> | 9 #include <stack> |
10 #include <string> | 10 #include <string> |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
183 char phase_; | 183 char phase_; |
184 unsigned char flags_; | 184 unsigned char flags_; |
185 unsigned char arg_types_[kTraceMaxNumArgs]; | 185 unsigned char arg_types_[kTraceMaxNumArgs]; |
186 | 186 |
187 DISALLOW_COPY_AND_ASSIGN(TraceEvent); | 187 DISALLOW_COPY_AND_ASSIGN(TraceEvent); |
188 }; | 188 }; |
189 | 189 |
190 // TraceBufferChunk is the basic unit of TraceBuffer. | 190 // TraceBufferChunk is the basic unit of TraceBuffer. |
191 class BASE_EXPORT TraceBufferChunk { | 191 class BASE_EXPORT TraceBufferChunk { |
192 public: | 192 public: |
193 TraceBufferChunk(uint32 seq) | 193 explicit TraceBufferChunk(uint32 seq) |
danakj
2014/10/07 17:13:54
There's a bunch of changes not related to consting
Lei Zhang
2014/10/17 21:19:38
I updated the CL description.
| |
194 : next_free_(0), | 194 : next_free_(0), |
195 seq_(seq) { | 195 seq_(seq) { |
196 } | 196 } |
197 | 197 |
198 void Reset(uint32 new_seq); | 198 void Reset(uint32 new_seq); |
199 TraceEvent* AddTraceEvent(size_t* event_index); | 199 TraceEvent* AddTraceEvent(size_t* event_index); |
200 bool IsFull() const { return next_free_ == kTraceBufferChunkSize; } | 200 bool IsFull() const { return next_free_ == kTraceBufferChunkSize; } |
201 | 201 |
202 uint32 seq() const { return seq_; } | 202 uint32 seq() const { return seq_; } |
203 size_t capacity() const { return kTraceBufferChunkSize; } | 203 size_t capacity() const { return kTraceBufferChunkSize; } |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
285 bool append_comma_; | 285 bool append_comma_; |
286 }; | 286 }; |
287 | 287 |
288 class BASE_EXPORT CategoryFilter { | 288 class BASE_EXPORT CategoryFilter { |
289 public: | 289 public: |
290 typedef std::vector<std::string> StringList; | 290 typedef std::vector<std::string> StringList; |
291 | 291 |
292 // The default category filter, used when none is provided. | 292 // The default category filter, used when none is provided. |
293 // Allows all categories through, except if they end in the suffix 'Debug' or | 293 // Allows all categories through, except if they end in the suffix 'Debug' or |
294 // 'Test'. | 294 // 'Test'. |
295 static const char* kDefaultCategoryFilterString; | 295 static const char kDefaultCategoryFilterString[]; |
296 | 296 |
297 // |filter_string| is a comma-delimited list of category wildcards. | 297 // |filter_string| is a comma-delimited list of category wildcards. |
298 // A category can have an optional '-' prefix to make it an excluded category. | 298 // A category can have an optional '-' prefix to make it an excluded category. |
299 // All the same rules apply above, so for example, having both included and | 299 // All the same rules apply above, so for example, having both included and |
300 // excluded categories in the same list would not be supported. | 300 // excluded categories in the same list would not be supported. |
301 // | 301 // |
302 // Example: CategoryFilter"test_MyTest*"); | 302 // Example: CategoryFilter"test_MyTest*"); |
303 // Example: CategoryFilter("test_MyTest*,test_OtherStuff"); | 303 // Example: CategoryFilter("test_MyTest*,test_OtherStuff"); |
304 // Example: CategoryFilter("-excluded_category1,-excluded_category2"); | 304 // Example: CategoryFilter("-excluded_category1,-excluded_category2"); |
305 // Example: CategoryFilter("-*,webkit"); would disable everything but webkit. | 305 // Example: CategoryFilter("-*,webkit"); would disable everything but webkit. |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
384 RECORD_CONTINUOUSLY, | 384 RECORD_CONTINUOUSLY, |
385 | 385 |
386 // Echo to console. Events are discarded. | 386 // Echo to console. Events are discarded. |
387 ECHO_TO_CONSOLE, | 387 ECHO_TO_CONSOLE, |
388 | 388 |
389 // Record until the trace buffer is full, but with a huge buffer size. | 389 // Record until the trace buffer is full, but with a huge buffer size. |
390 RECORD_AS_MUCH_AS_POSSIBLE | 390 RECORD_AS_MUCH_AS_POSSIBLE |
391 }; | 391 }; |
392 | 392 |
393 struct BASE_EXPORT TraceOptions { | 393 struct BASE_EXPORT TraceOptions { |
394 | |
395 TraceOptions() | 394 TraceOptions() |
396 : record_mode(RECORD_UNTIL_FULL), | 395 : record_mode(RECORD_UNTIL_FULL), |
397 enable_sampling(false), | 396 enable_sampling(false), |
398 enable_systrace(false) {} | 397 enable_systrace(false) {} |
399 | 398 |
400 TraceOptions(TraceRecordMode record_mode) | 399 explicit TraceOptions(TraceRecordMode record_mode) |
401 : record_mode(record_mode), | 400 : record_mode(record_mode), |
402 enable_sampling(false), | 401 enable_sampling(false), |
403 enable_systrace(false) {} | 402 enable_systrace(false) {} |
404 | 403 |
405 // |options_string| is a comma-delimited list of trace options. | 404 // |options_string| is a comma-delimited list of trace options. |
406 // Possible options are: "record-until-full", "record-continuously", | 405 // Possible options are: "record-until-full", "record-continuously", |
407 // "trace-to-console", "enable-sampling" and "enable-systrace". | 406 // "trace-to-console", "enable-sampling" and "enable-systrace". |
408 // The first 3 options are trace recoding modes and hence | 407 // The first 3 options are trace recoding modes and hence |
409 // mutually exclusive. If more than one trace recording modes appear in the | 408 // mutually exclusive. If more than one trace recording modes appear in the |
410 // options_string, the last one takes precedence. If none of the trace | 409 // options_string, the last one takes precedence. If none of the trace |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
812 scoped_refptr<MessageLoopProxy> flush_message_loop_proxy_; | 811 scoped_refptr<MessageLoopProxy> flush_message_loop_proxy_; |
813 subtle::AtomicWord generation_; | 812 subtle::AtomicWord generation_; |
814 | 813 |
815 DISALLOW_COPY_AND_ASSIGN(TraceLog); | 814 DISALLOW_COPY_AND_ASSIGN(TraceLog); |
816 }; | 815 }; |
817 | 816 |
818 } // namespace debug | 817 } // namespace debug |
819 } // namespace base | 818 } // namespace base |
820 | 819 |
821 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ | 820 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ |
OLD | NEW |