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

Side by Side Diff: base/debug/trace_event.h

Issue 8470001: TraceEvent fixes for thread name changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix mac - can't pass NULL to PlatformName::SetName Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | base/debug/trace_event.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // Trace events are for tracking application performance. 5 // Trace events are for tracking application performance.
6 // 6 //
7 // Events are issued against categories. Whereas LOG's 7 // Events are issued against categories. Whereas LOG's
8 // categories are statically defined, TRACE categories are created 8 // categories are statically defined, TRACE categories are created
9 // implicitly with a string. For example: 9 // implicitly with a string. For example:
10 // TRACE_EVENT_INSTANT0("MY_SUBSYSTEM", "SomeImportantEvent") 10 // TRACE_EVENT_INSTANT0("MY_SUBSYSTEM", "SomeImportantEvent")
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 #pragma once 96 #pragma once
97 97
98 #include "build/build_config.h" 98 #include "build/build_config.h"
99 99
100 #include <string> 100 #include <string>
101 #include <vector> 101 #include <vector>
102 102
103 #include "base/callback.h" 103 #include "base/callback.h"
104 #include "base/hash_tables.h" 104 #include "base/hash_tables.h"
105 #include "base/memory/ref_counted_memory.h" 105 #include "base/memory/ref_counted_memory.h"
106 #include "base/memory/singleton.h"
107 #include "base/string_util.h" 106 #include "base/string_util.h"
107 #include "base/synchronization/lock.h"
108 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" 108 #include "base/third_party/dynamic_annotations/dynamic_annotations.h"
109 #include "base/timer.h" 109 #include "base/timer.h"
110 110
111 // By default, const char* argument values are assumed to have long-lived scope 111 // By default, const char* argument values are assumed to have long-lived scope
112 // and will not be copied. Use this macro to force a const char* to be copied. 112 // and will not be copied. Use this macro to force a const char* to be copied.
113 #define TRACE_STR_COPY(str) base::debug::TraceValue::StringWithCopy(str) 113 #define TRACE_STR_COPY(str) base::debug::TraceValue::StringWithCopy(str)
114 114
115 // Older style trace macros with explicit id and extra data 115 // Older style trace macros with explicit id and extra data
116 // Only these macros result in publishing data to ETW as currently implemented. 116 // Only these macros result in publishing data to ETW as currently implemented.
117 #define TRACE_EVENT_BEGIN_ETW(name, id, extra) \ 117 #define TRACE_EVENT_BEGIN_ETW(name, id, extra) \
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 base::debug::TraceLog::GetInstance()->AddTraceEvent( \ 318 base::debug::TraceLog::GetInstance()->AddTraceEvent( \
319 base::debug::TRACE_EVENT_PHASE_BEGIN, \ 319 base::debug::TRACE_EVENT_PHASE_BEGIN, \
320 INTERNAL_TRACE_EVENT_UID(catstatic), \ 320 INTERNAL_TRACE_EVENT_UID(catstatic), \
321 name, arg1_name, arg1_val, arg2_name, arg2_val, -1, 0, \ 321 name, arg1_name, arg1_val, arg2_name, arg2_val, -1, 0, \
322 base::debug::TraceLog::EVENT_FLAG_NONE); \ 322 base::debug::TraceLog::EVENT_FLAG_NONE); \
323 INTERNAL_TRACE_EVENT_UID(profileScope).Initialize( \ 323 INTERNAL_TRACE_EVENT_UID(profileScope).Initialize( \
324 INTERNAL_TRACE_EVENT_UID(catstatic), name, \ 324 INTERNAL_TRACE_EVENT_UID(catstatic), name, \
325 INTERNAL_TRACE_EVENT_UID(begin_event_id), threshold); \ 325 INTERNAL_TRACE_EVENT_UID(begin_event_id), threshold); \
326 } 326 }
327 327
328 template <typename Type>
329 struct StaticMemorySingletonTraits;
330
328 namespace base { 331 namespace base {
329 332
330 class RefCountedString; 333 class RefCountedString;
331 334
332 namespace debug { 335 namespace debug {
333 336
334 // Categories allow enabling/disabling of streams of trace events 337 // Categories allow enabling/disabling of streams of trace events
335 struct TraceCategory { 338 struct TraceCategory {
336 const char* name; 339 const char* name;
337 volatile bool enabled; 340 volatile bool enabled;
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 Data* p_data_; 771 Data* p_data_;
769 Data data_; 772 Data data_;
770 }; 773 };
771 774
772 } // namespace internal 775 } // namespace internal
773 776
774 } // namespace debug 777 } // namespace debug
775 } // namespace base 778 } // namespace base
776 779
777 #endif // BASE_DEBUG_TRACE_EVENT_H_ 780 #endif // BASE_DEBUG_TRACE_EVENT_H_
OLDNEW
« no previous file with comments | « no previous file | base/debug/trace_event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698