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

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

Issue 2341333003: Use chromium trace_event implementation in blink (Closed)
Patch Set: Rebase Created 4 years, 3 months 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
OLDNEW
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 #ifndef BASE_TRACE_EVENT_TRACE_EVENT_H_ 5 #ifndef BASE_TRACE_EVENT_TRACE_EVENT_H_
6 #define BASE_TRACE_EVENT_TRACE_EVENT_H_ 6 #define BASE_TRACE_EVENT_TRACE_EVENT_H_
7 7
8 // This header file defines implementation details of how the trace macros in 8 // This header file defines implementation details of how the trace macros in
9 // trace_event_common.h collect and store trace events. Anything not 9 // trace_event_common.h collect and store trace events. Anything not
10 // implementation-specific should go in trace_event_common.h instead of here. 10 // implementation-specific should go in trace_event_common.h instead of here.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 // thread from others. 57 // thread from others.
58 #define TRACE_EVENT_SET_SAMPLING_STATE_FOR_BUCKET( \ 58 #define TRACE_EVENT_SET_SAMPLING_STATE_FOR_BUCKET( \
59 bucket_number, category, name) \ 59 bucket_number, category, name) \
60 trace_event_internal:: \ 60 trace_event_internal:: \
61 TraceEventSamplingStateScope<bucket_number>::Set(category "\0" name) 61 TraceEventSamplingStateScope<bucket_number>::Set(category "\0" name)
62 62
63 // Returns a current sampling state of the given bucket. 63 // Returns a current sampling state of the given bucket.
64 #define TRACE_EVENT_GET_SAMPLING_STATE_FOR_BUCKET(bucket_number) \ 64 #define TRACE_EVENT_GET_SAMPLING_STATE_FOR_BUCKET(bucket_number) \
65 trace_event_internal::TraceEventSamplingStateScope<bucket_number>::Current() 65 trace_event_internal::TraceEventSamplingStateScope<bucket_number>::Current()
66 66
67 // Sets a current sampling state of the given bucket.
68 // |categoryAndName| doesn't need to be a constant string.
oystein (OOO til 10th of July) 2016/09/20 18:11:17 nit: category_and_name
Xianzhu 2016/09/20 18:15:47 Done.
69 // The format of the string is "category\0name".
70 #define TRACE_EVENT_SET_NONCONST_SAMPLING_STATE_FOR_BUCKET( \
71 bucket_number, category_and_name) \
72 trace_event_internal:: \
73 TraceEventSamplingStateScope<bucket_number>::Set(category_and_name)
74
67 // Creates a scope of a sampling state of the given bucket. 75 // Creates a scope of a sampling state of the given bucket.
68 // 76 //
69 // { // The sampling state is set within this scope. 77 // { // The sampling state is set within this scope.
70 // TRACE_EVENT_SAMPLING_STATE_SCOPE_FOR_BUCKET(0, "category", "name"); 78 // TRACE_EVENT_SAMPLING_STATE_SCOPE_FOR_BUCKET(0, "category", "name");
71 // ...; 79 // ...;
72 // } 80 // }
73 #define TRACE_EVENT_SCOPED_SAMPLING_STATE_FOR_BUCKET( \ 81 #define TRACE_EVENT_SCOPED_SAMPLING_STATE_FOR_BUCKET( \
74 bucket_number, category, name) \ 82 bucket_number, category, name) \
75 trace_event_internal::TraceEventSamplingStateScope<bucket_number> \ 83 trace_event_internal::TraceEventSamplingStateScope<bucket_number> \
76 traceEventSamplingScope(category "\0" name); 84 traceEventSamplingScope(category "\0" name);
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after
1157 const char* name_; 1165 const char* name_;
1158 IDType id_; 1166 IDType id_;
1159 1167
1160 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); 1168 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject);
1161 }; 1169 };
1162 1170
1163 } // namespace trace_event 1171 } // namespace trace_event
1164 } // namespace base 1172 } // namespace base
1165 1173
1166 #endif // BASE_TRACE_EVENT_TRACE_EVENT_H_ 1174 #endif // BASE_TRACE_EVENT_TRACE_EVENT_H_
OLDNEW
« no previous file with comments | « base/trace_event/common/trace_event_common.h ('k') | third_party/WebKit/Source/core/CoreInitializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698