Chromium Code Reviews| 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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 477 TRACE_EVENT_FLAG_NONE, value1_name, \ | 477 TRACE_EVENT_FLAG_NONE, value1_name, \ |
| 478 static_cast<int>(value1_val), value2_name, \ | 478 static_cast<int>(value1_val), value2_name, \ |
| 479 static_cast<int>(value2_val)) | 479 static_cast<int>(value2_val)) |
| 480 #define TRACE_COPY_COUNTER2(category_group, name, value1_name, value1_val, \ | 480 #define TRACE_COPY_COUNTER2(category_group, name, value1_name, value1_val, \ |
| 481 value2_name, value2_val) \ | 481 value2_name, value2_val) \ |
| 482 INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \ | 482 INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \ |
| 483 TRACE_EVENT_FLAG_COPY, value1_name, \ | 483 TRACE_EVENT_FLAG_COPY, value1_name, \ |
| 484 static_cast<int>(value1_val), value2_name, \ | 484 static_cast<int>(value1_val), value2_name, \ |
| 485 static_cast<int>(value2_val)) | 485 static_cast<int>(value2_val)) |
| 486 | 486 |
| 487 // Similar to TRACE_COUNTERx, but with a custom |timestamp| provided. | |
| 488 #define TRACE_COUNTER_WITH_TIMESTAMP1(category_group, name, value, timestamp) \ | |
|
oystein (OOO til 10th of July)
2015/11/23 19:21:15
nit: the timestamp value should be before the opti
fdoray
2015/11/25 21:13:12
Done.
| |
| 489 INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \ | |
| 490 TRACE_EVENT_PHASE_COUNTER, category_group, name, timestamp, \ | |
| 491 TRACE_EVENT_FLAG_NONE, "value", static_cast<int>(value)) | |
| 492 | |
| 493 #define TRACE_COUNTER_WITH_TIMESTAMP2(category_group, name, value1_name, \ | |
| 494 value1_val, value2_name, value2_val, \ | |
| 495 timestamp) \ | |
| 496 INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \ | |
| 497 TRACE_EVENT_PHASE_COUNTER, category_group, name, timestamp, \ | |
| 498 TRACE_EVENT_FLAG_NONE, value1_name, static_cast<int>(value1_val), \ | |
| 499 value2_name, static_cast<int>(value2_val)) | |
| 500 | |
| 487 // Records the value of a counter called "name" immediately. Value | 501 // Records the value of a counter called "name" immediately. Value |
| 488 // must be representable as a 32 bit integer. | 502 // must be representable as a 32 bit integer. |
| 489 // - category and name strings must have application lifetime (statics or | 503 // - category and name strings must have application lifetime (statics or |
| 490 // literals). They may not include " chars. | 504 // literals). They may not include " chars. |
| 491 // - |id| is used to disambiguate counters with the same name. It must either | 505 // - |id| is used to disambiguate counters with the same name. It must either |
| 492 // be a pointer or an integer value up to 64 bits. If it's a pointer, the bits | 506 // be a pointer or an integer value up to 64 bits. If it's a pointer, the bits |
| 493 // will be xored with a hash of the process ID so that the same pointer on | 507 // will be xored with a hash of the process ID so that the same pointer on |
| 494 // two different processes will not collide. | 508 // two different processes will not collide. |
| 495 #define TRACE_COUNTER_ID1(category_group, name, id, value) \ | 509 #define TRACE_COUNTER_ID1(category_group, name, id, value) \ |
| 496 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, category_group, \ | 510 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, category_group, \ |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1045 | 1059 |
| 1046 // Enum reflecting the scope of an INSTANT event. Must fit within | 1060 // Enum reflecting the scope of an INSTANT event. Must fit within |
| 1047 // TRACE_EVENT_FLAG_SCOPE_MASK. | 1061 // TRACE_EVENT_FLAG_SCOPE_MASK. |
| 1048 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3)) | 1062 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3)) |
| 1049 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3)) | 1063 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3)) |
| 1050 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3)) | 1064 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3)) |
| 1051 | 1065 |
| 1052 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g') | 1066 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g') |
| 1053 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p') | 1067 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p') |
| 1054 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t') | 1068 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t') |
| OLD | NEW |