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

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

Issue 2373973002: TRACE_EVENT_x_WITH_TIMESTAMP should log current thread id (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \ 290 INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \
291 TRACE_EVENT_FLAG_COPY | scope, arg1_name, arg1_val) 291 TRACE_EVENT_FLAG_COPY | scope, arg1_name, arg1_val)
292 #define TRACE_EVENT_COPY_INSTANT2(category_group, name, scope, arg1_name, \ 292 #define TRACE_EVENT_COPY_INSTANT2(category_group, name, scope, arg1_name, \
293 arg1_val, arg2_name, arg2_val) \ 293 arg1_val, arg2_name, arg2_val) \
294 INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \ 294 INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \
295 TRACE_EVENT_FLAG_COPY | scope, arg1_name, arg1_val, \ 295 TRACE_EVENT_FLAG_COPY | scope, arg1_name, arg1_val, \
296 arg2_name, arg2_val) 296 arg2_name, arg2_val)
297 297
298 #define TRACE_EVENT_INSTANT_WITH_TIMESTAMP0(category_group, name, scope, \ 298 #define TRACE_EVENT_INSTANT_WITH_TIMESTAMP0(category_group, name, scope, \
299 timestamp) \ 299 timestamp) \
300 INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ 300 INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \
301 TRACE_EVENT_PHASE_INSTANT, category_group, name, 0, 0, timestamp, \ 301 TRACE_EVENT_PHASE_INSTANT, category_group, name, timestamp, \
302 TRACE_EVENT_FLAG_NONE | scope) 302 TRACE_EVENT_FLAG_NONE | scope)
303 303
304 // Syntactic sugars for the sampling tracing in the main thread. 304 // Syntactic sugars for the sampling tracing in the main thread.
305 #define TRACE_EVENT_SCOPED_SAMPLING_STATE(category, name) \ 305 #define TRACE_EVENT_SCOPED_SAMPLING_STATE(category, name) \
306 TRACE_EVENT_SCOPED_SAMPLING_STATE_FOR_BUCKET(0, category, name) 306 TRACE_EVENT_SCOPED_SAMPLING_STATE_FOR_BUCKET(0, category, name)
307 #define TRACE_EVENT_GET_SAMPLING_STATE() \ 307 #define TRACE_EVENT_GET_SAMPLING_STATE() \
308 TRACE_EVENT_GET_SAMPLING_STATE_FOR_BUCKET(0) 308 TRACE_EVENT_GET_SAMPLING_STATE_FOR_BUCKET(0)
309 #define TRACE_EVENT_SET_SAMPLING_STATE(category, name) \ 309 #define TRACE_EVENT_SET_SAMPLING_STATE(category, name) \
310 TRACE_EVENT_SET_SAMPLING_STATE_FOR_BUCKET(0, category, name) 310 TRACE_EVENT_SET_SAMPLING_STATE_FOR_BUCKET(0, category, name)
311 #define TRACE_EVENT_SET_NONCONST_SAMPLING_STATE(category_and_name) \ 311 #define TRACE_EVENT_SET_NONCONST_SAMPLING_STATE(category_and_name) \
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 #define TRACE_EVENT_COPY_END1(category_group, name, arg1_name, arg1_val) \ 389 #define TRACE_EVENT_COPY_END1(category_group, name, arg1_name, arg1_val) \
390 INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, \ 390 INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, \
391 TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val) 391 TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val)
392 #define TRACE_EVENT_COPY_END2(category_group, name, arg1_name, arg1_val, \ 392 #define TRACE_EVENT_COPY_END2(category_group, name, arg1_name, arg1_val, \
393 arg2_name, arg2_val) \ 393 arg2_name, arg2_val) \
394 INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, \ 394 INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, \
395 TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \ 395 TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \
396 arg2_name, arg2_val) 396 arg2_name, arg2_val)
397 397
398 #define TRACE_EVENT_MARK_WITH_TIMESTAMP0(category_group, name, timestamp) \ 398 #define TRACE_EVENT_MARK_WITH_TIMESTAMP0(category_group, name, timestamp) \
399 INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ 399 INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \
400 TRACE_EVENT_PHASE_MARK, category_group, name, 0, 0, timestamp, \ 400 TRACE_EVENT_PHASE_MARK, category_group, name, timestamp, \
401 TRACE_EVENT_FLAG_NONE) 401 TRACE_EVENT_FLAG_NONE)
402 402
403 #define TRACE_EVENT_MARK_WITH_TIMESTAMP1(category_group, name, timestamp, \ 403 #define TRACE_EVENT_MARK_WITH_TIMESTAMP1(category_group, name, timestamp, \
404 arg1_name, arg1_val) \ 404 arg1_name, arg1_val) \
405 INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ 405 INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \
406 TRACE_EVENT_PHASE_MARK, category_group, name, 0, 0, timestamp, \ 406 TRACE_EVENT_PHASE_MARK, category_group, name, timestamp, \
407 TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) 407 TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
408 408
409 #define TRACE_EVENT_COPY_MARK(category_group, name) \ 409 #define TRACE_EVENT_COPY_MARK(category_group, name) \
410 INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_MARK, category_group, name, \ 410 INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_MARK, category_group, name, \
411 TRACE_EVENT_FLAG_COPY) 411 TRACE_EVENT_FLAG_COPY)
412 412
413 #define TRACE_EVENT_COPY_MARK_WITH_TIMESTAMP(category_group, name, timestamp) \ 413 #define TRACE_EVENT_COPY_MARK_WITH_TIMESTAMP(category_group, name, timestamp) \
414 INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ 414 INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \
415 TRACE_EVENT_PHASE_MARK, category_group, name, 0, 0, timestamp, \ 415 TRACE_EVENT_PHASE_MARK, category_group, name, timestamp, \
416 TRACE_EVENT_FLAG_COPY) 416 TRACE_EVENT_FLAG_COPY)
417 417
418 // Similar to TRACE_EVENT_ENDx but with a custom |at| timestamp provided. 418 // Similar to TRACE_EVENT_ENDx but with a custom |at| timestamp provided.
419 // - |id| is used to match the _BEGIN event with the _END event. 419 // - |id| is used to match the _BEGIN event with the _END event.
420 // Events are considered to match if their category_group, name and id values 420 // Events are considered to match if their category_group, name and id values
421 // all match. |id| must either be a pointer or an integer value up to 64 bits. 421 // all match. |id| must either be a pointer or an integer value up to 64 bits.
422 // If it's a pointer, the bits will be xored with a hash of the process ID so 422 // If it's a pointer, the bits will be xored with a hash of the process ID so
423 // that the same pointer on two different processes will not collide. 423 // that the same pointer on two different processes will not collide.
424 #define TRACE_EVENT_END_WITH_ID_TID_AND_TIMESTAMP0(category_group, name, id, \ 424 #define TRACE_EVENT_END_WITH_ID_TID_AND_TIMESTAMP0(category_group, name, id, \
425 thread_id, timestamp) \ 425 thread_id, timestamp) \
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 1111
1112 // Enum reflecting the scope of an INSTANT event. Must fit within 1112 // Enum reflecting the scope of an INSTANT event. Must fit within
1113 // TRACE_EVENT_FLAG_SCOPE_MASK. 1113 // TRACE_EVENT_FLAG_SCOPE_MASK.
1114 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3)) 1114 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3))
1115 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3)) 1115 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3))
1116 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3)) 1116 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3))
1117 1117
1118 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g') 1118 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g')
1119 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p') 1119 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p')
1120 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t') 1120 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t')
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698