| 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 // This header is designed to give you trace_event macros without specifying | 5 // This header is designed to give you 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 // event to some other universe, you can copy-and-paste this file, | 7 // event to some other universe, you can copy-and-paste this file, |
| 8 // implement the TRACE_EVENT_API macros, and do any other necessary fixup for | 8 // implement the TRACE_EVENT_API macros, and do any other necessary fixup for |
| 9 // the target platform. The end result is that multiple libraries can funnel | 9 // the target platform. The end result is that multiple libraries can funnel |
| 10 // events through to a shared trace event collector. | 10 // events through to a shared trace event collector. |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 #include "base/atomicops.h" | 156 #include "base/atomicops.h" |
| 157 #include "base/debug/trace_event_impl.h" | 157 #include "base/debug/trace_event_impl.h" |
| 158 #include "build/build_config.h" | 158 #include "build/build_config.h" |
| 159 | 159 |
| 160 // By default, const char* argument values are assumed to have long-lived scope | 160 // By default, const char* argument values are assumed to have long-lived scope |
| 161 // and will not be copied. Use this macro to force a const char* to be copied. | 161 // and will not be copied. Use this macro to force a const char* to be copied. |
| 162 #define TRACE_STR_COPY(str) \ | 162 #define TRACE_STR_COPY(str) \ |
| 163 trace_event_internal::TraceStringWithCopy(str) | 163 trace_event_internal::TraceStringWithCopy(str) |
| 164 | 164 |
| 165 // By default, uint64 ID argument values are not mangled with the Process ID in |
| 166 // TRACE_EVENT_ASYNC macros. Use this macro to force Process ID mangling. |
| 167 #define TRACE_ID_MANGLE(id) \ |
| 168 trace_event_internal::TraceID::ForceMangle(id) |
| 169 |
| 165 // Records a pair of begin and end events called "name" for the current | 170 // Records a pair of begin and end events called "name" for the current |
| 166 // scope, with 0, 1 or 2 associated arguments. If the category is not | 171 // scope, with 0, 1 or 2 associated arguments. If the category is not |
| 167 // enabled, then this does nothing. | 172 // enabled, then this does nothing. |
| 168 // - category and name strings must have application lifetime (statics or | 173 // - category and name strings must have application lifetime (statics or |
| 169 // literals). They may not include " chars. | 174 // literals). They may not include " chars. |
| 170 #define TRACE_EVENT0(category, name) \ | 175 #define TRACE_EVENT0(category, name) \ |
| 171 INTERNAL_TRACE_EVENT_ADD_SCOPED(category, name) | 176 INTERNAL_TRACE_EVENT_ADD_SCOPED(category, name) |
| 172 #define TRACE_EVENT1(category, name, arg1_name, arg1_val) \ | 177 #define TRACE_EVENT1(category, name, arg1_name, arg1_val) \ |
| 173 INTERNAL_TRACE_EVENT_ADD_SCOPED(category, name, arg1_name, arg1_val) | 178 INTERNAL_TRACE_EVENT_ADD_SCOPED(category, name, arg1_name, arg1_val) |
| 174 #define TRACE_EVENT2(category, name, arg1_name, arg1_val, arg2_name, arg2_val) \ | 179 #define TRACE_EVENT2(category, name, arg1_name, arg1_val, arg2_name, arg2_val) \ |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 // does nothing. | 387 // does nothing. |
| 383 // - category and name strings must have application lifetime (statics or | 388 // - category and name strings must have application lifetime (statics or |
| 384 // literals). They may not include " chars. | 389 // literals). They may not include " chars. |
| 385 // - |id| is used to match the ASYNC_BEGIN event with the ASYNC_END event. ASYNC | 390 // - |id| is used to match the ASYNC_BEGIN event with the ASYNC_END event. ASYNC |
| 386 // events are considered to match if their category, name and id values all | 391 // events are considered to match if their category, name and id values all |
| 387 // match. |id| must either be a pointer or an integer value up to 64 bits. If | 392 // match. |id| must either be a pointer or an integer value up to 64 bits. If |
| 388 // it's a pointer, the bits will be xored with a hash of the process ID so | 393 // it's a pointer, the bits will be xored with a hash of the process ID so |
| 389 // that the same pointer on two different processes will not collide. | 394 // that the same pointer on two different processes will not collide. |
| 390 // An asynchronous operation can consist of multiple phases. The first phase is | 395 // An asynchronous operation can consist of multiple phases. The first phase is |
| 391 // defined by the ASYNC_BEGIN calls. Additional phases can be defined using the | 396 // defined by the ASYNC_BEGIN calls. Additional phases can be defined using the |
| 392 // ASYNC_STEP_BEGIN macros. When the operation completes, call ASYNC_END. | 397 // ASYNC_STEP macros. When the operation completes, call ASYNC_END. |
| 393 // An async operation can span threads and processes, but all events in that | 398 // An ASYNC trace typically occur on a single thread (if not, they will only be |
| 399 // drawn on the thread defined in the ASYNC_BEGIN event), but all events in that |
| 394 // operation must use the same |name| and |id|. Each event can have its own | 400 // operation must use the same |name| and |id|. Each event can have its own |
| 395 // args. | 401 // args. |
| 396 #define TRACE_EVENT_ASYNC_BEGIN0(category, name, id) \ | 402 #define TRACE_EVENT_ASYNC_BEGIN0(category, name, id) \ |
| 397 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ | 403 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ |
| 398 category, name, id, TRACE_EVENT_FLAG_NONE) | 404 category, name, id, TRACE_EVENT_FLAG_NONE) |
| 399 #define TRACE_EVENT_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \ | 405 #define TRACE_EVENT_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \ |
| 400 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ | 406 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ |
| 401 category, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) | 407 category, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) |
| 402 #define TRACE_EVENT_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val, \ | 408 #define TRACE_EVENT_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val, \ |
| 403 arg2_name, arg2_val) \ | 409 arg2_name, arg2_val) \ |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ | 465 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ |
| 460 category, name, id, TRACE_EVENT_FLAG_COPY, \ | 466 category, name, id, TRACE_EVENT_FLAG_COPY, \ |
| 461 arg1_name, arg1_val) | 467 arg1_name, arg1_val) |
| 462 #define TRACE_EVENT_COPY_ASYNC_END2(category, name, id, arg1_name, arg1_val, \ | 468 #define TRACE_EVENT_COPY_ASYNC_END2(category, name, id, arg1_name, arg1_val, \ |
| 463 arg2_name, arg2_val) \ | 469 arg2_name, arg2_val) \ |
| 464 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ | 470 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ |
| 465 category, name, id, TRACE_EVENT_FLAG_COPY, \ | 471 category, name, id, TRACE_EVENT_FLAG_COPY, \ |
| 466 arg1_name, arg1_val, arg2_name, arg2_val) | 472 arg1_name, arg1_val, arg2_name, arg2_val) |
| 467 | 473 |
| 468 | 474 |
| 475 // Records a single FLOW_BEGIN event called "name" immediately, with 0, 1 or 2 |
| 476 // associated arguments. If the category is not enabled, then this |
| 477 // does nothing. |
| 478 // - category and name strings must have application lifetime (statics or |
| 479 // literals). They may not include " chars. |
| 480 // - |id| is used to match the FLOW_BEGIN event with the FLOW_END event. FLOW |
| 481 // events are considered to match if their category, name and id values all |
| 482 // match. |id| must either be a pointer or an integer value up to 64 bits. If |
| 483 // it's a pointer, the bits will be xored with a hash of the process ID so |
| 484 // that the same pointer on two different processes will not collide. |
| 485 // FLOW events are different from ASYNC events in how they are drawn by the |
| 486 // tracing UI. A FLOW defines asynchronous data flow, such as posting a task |
| 487 // (FLOW_BEGIN) and later executing that task (FLOW_END). Expect FLOWs to be |
| 488 // drawn as lines or arrows from FLOW_BEGIN scopes to FLOW_END scopes. Similar |
| 489 // to ASYNC, a FLOW can consist of multiple phases. The first phase is defined |
| 490 // by the FLOW_BEGIN calls. Additional phases can be defined using the FLOW_STEP |
| 491 // macros. When the operation completes, call FLOW_END. An async operation can |
| 492 // span threads and processes, but all events in that operation must use the |
| 493 // same |name| and |id|. Each event can have its own args. |
| 494 #define TRACE_EVENT_FLOW_BEGIN0(category, name, id) \ |
| 495 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ |
| 496 category, name, id, TRACE_EVENT_FLAG_NONE) |
| 497 #define TRACE_EVENT_FLOW_BEGIN1(category, name, id, arg1_name, arg1_val) \ |
| 498 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ |
| 499 category, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) |
| 500 #define TRACE_EVENT_FLOW_BEGIN2(category, name, id, arg1_name, arg1_val, \ |
| 501 arg2_name, arg2_val) \ |
| 502 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ |
| 503 category, name, id, TRACE_EVENT_FLAG_NONE, \ |
| 504 arg1_name, arg1_val, arg2_name, arg2_val) |
| 505 #define TRACE_EVENT_COPY_FLOW_BEGIN0(category, name, id) \ |
| 506 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ |
| 507 category, name, id, TRACE_EVENT_FLAG_COPY) |
| 508 #define TRACE_EVENT_COPY_FLOW_BEGIN1(category, name, id, arg1_name, arg1_val) \ |
| 509 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ |
| 510 category, name, id, TRACE_EVENT_FLAG_COPY, \ |
| 511 arg1_name, arg1_val) |
| 512 #define TRACE_EVENT_COPY_FLOW_BEGIN2(category, name, id, arg1_name, arg1_val, \ |
| 513 arg2_name, arg2_val) \ |
| 514 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ |
| 515 category, name, id, TRACE_EVENT_FLAG_COPY, \ |
| 516 arg1_name, arg1_val, arg2_name, arg2_val) |
| 517 |
| 518 // Records a single FLOW_STEP event for |step| immediately. If the category |
| 519 // is not enabled, then this does nothing. The |name| and |id| must match the |
| 520 // FLOW_BEGIN event above. The |step| param identifies this step within the |
| 521 // async event. This should be called at the beginning of the next phase of an |
| 522 // asynchronous operation. |
| 523 #define TRACE_EVENT_FLOW_STEP0(category, name, id, step) \ |
| 524 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \ |
| 525 category, name, id, TRACE_EVENT_FLAG_NONE, "step", step) |
| 526 #define TRACE_EVENT_FLOW_STEP1(category, name, id, step, \ |
| 527 arg1_name, arg1_val) \ |
| 528 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \ |
| 529 category, name, id, TRACE_EVENT_FLAG_NONE, "step", step, \ |
| 530 arg1_name, arg1_val) |
| 531 #define TRACE_EVENT_COPY_FLOW_STEP0(category, name, id, step) \ |
| 532 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \ |
| 533 category, name, id, TRACE_EVENT_FLAG_COPY, "step", step) |
| 534 #define TRACE_EVENT_COPY_FLOW_STEP1(category, name, id, step, \ |
| 535 arg1_name, arg1_val) \ |
| 536 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \ |
| 537 category, name, id, TRACE_EVENT_FLAG_COPY, "step", step, \ |
| 538 arg1_name, arg1_val) |
| 539 |
| 540 // Records a single FLOW_END event for "name" immediately. If the category |
| 541 // is not enabled, then this does nothing. |
| 542 #define TRACE_EVENT_FLOW_END0(category, name, id) \ |
| 543 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ |
| 544 category, name, id, TRACE_EVENT_FLAG_NONE) |
| 545 #define TRACE_EVENT_FLOW_END1(category, name, id, arg1_name, arg1_val) \ |
| 546 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ |
| 547 category, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) |
| 548 #define TRACE_EVENT_FLOW_END2(category, name, id, arg1_name, arg1_val, \ |
| 549 arg2_name, arg2_val) \ |
| 550 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ |
| 551 category, name, id, TRACE_EVENT_FLAG_NONE, \ |
| 552 arg1_name, arg1_val, arg2_name, arg2_val) |
| 553 #define TRACE_EVENT_COPY_FLOW_END0(category, name, id) \ |
| 554 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ |
| 555 category, name, id, TRACE_EVENT_FLAG_COPY) |
| 556 #define TRACE_EVENT_COPY_FLOW_END1(category, name, id, arg1_name, arg1_val) \ |
| 557 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ |
| 558 category, name, id, TRACE_EVENT_FLAG_COPY, \ |
| 559 arg1_name, arg1_val) |
| 560 #define TRACE_EVENT_COPY_FLOW_END2(category, name, id, arg1_name, arg1_val, \ |
| 561 arg2_name, arg2_val) \ |
| 562 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ |
| 563 category, name, id, TRACE_EVENT_FLAG_COPY, \ |
| 564 arg1_name, arg1_val, arg2_name, arg2_val) |
| 565 |
| 566 |
| 469 //////////////////////////////////////////////////////////////////////////////// | 567 //////////////////////////////////////////////////////////////////////////////// |
| 470 // Implementation specific tracing API definitions. | 568 // Implementation specific tracing API definitions. |
| 471 | 569 |
| 472 // Get a pointer to the enabled state of the given trace category. Only | 570 // Get a pointer to the enabled state of the given trace category. Only |
| 473 // long-lived literal strings should be given as the category name. The returned | 571 // long-lived literal strings should be given as the category name. The returned |
| 474 // pointer can be held permanently in a local static for example. If the | 572 // pointer can be held permanently in a local static for example. If the |
| 475 // unsigned char is non-zero, tracing is enabled. If tracing is enabled, | 573 // unsigned char is non-zero, tracing is enabled. If tracing is enabled, |
| 476 // TRACE_EVENT_API_ADD_TRACE_EVENT can be called. It's OK if tracing is disabled | 574 // TRACE_EVENT_API_ADD_TRACE_EVENT can be called. It's OK if tracing is disabled |
| 477 // between the load of the tracing state and the call to | 575 // between the load of the tracing state and the call to |
| 478 // TRACE_EVENT_API_ADD_TRACE_EVENT, because this flag only provides an early out | 576 // TRACE_EVENT_API_ADD_TRACE_EVENT, because this flag only provides an early out |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 // definitions must never be changed, because third party libraries may use old | 697 // definitions must never be changed, because third party libraries may use old |
| 600 // definitions. | 698 // definitions. |
| 601 | 699 |
| 602 // Phase indicates the nature of an event entry. E.g. part of a begin/end pair. | 700 // Phase indicates the nature of an event entry. E.g. part of a begin/end pair. |
| 603 #define TRACE_EVENT_PHASE_BEGIN ('B') | 701 #define TRACE_EVENT_PHASE_BEGIN ('B') |
| 604 #define TRACE_EVENT_PHASE_END ('E') | 702 #define TRACE_EVENT_PHASE_END ('E') |
| 605 #define TRACE_EVENT_PHASE_INSTANT ('I') | 703 #define TRACE_EVENT_PHASE_INSTANT ('I') |
| 606 #define TRACE_EVENT_PHASE_ASYNC_BEGIN ('S') | 704 #define TRACE_EVENT_PHASE_ASYNC_BEGIN ('S') |
| 607 #define TRACE_EVENT_PHASE_ASYNC_STEP ('T') | 705 #define TRACE_EVENT_PHASE_ASYNC_STEP ('T') |
| 608 #define TRACE_EVENT_PHASE_ASYNC_END ('F') | 706 #define TRACE_EVENT_PHASE_ASYNC_END ('F') |
| 707 #define TRACE_EVENT_PHASE_FLOW_BEGIN ('s') |
| 708 #define TRACE_EVENT_PHASE_FLOW_STEP ('t') |
| 709 #define TRACE_EVENT_PHASE_FLOW_END ('f') |
| 609 #define TRACE_EVENT_PHASE_METADATA ('M') | 710 #define TRACE_EVENT_PHASE_METADATA ('M') |
| 610 #define TRACE_EVENT_PHASE_COUNTER ('C') | 711 #define TRACE_EVENT_PHASE_COUNTER ('C') |
| 611 | 712 |
| 612 // Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT. | 713 // Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT. |
| 613 #define TRACE_EVENT_FLAG_NONE (static_cast<unsigned char>(0)) | 714 #define TRACE_EVENT_FLAG_NONE (static_cast<unsigned char>(0)) |
| 614 #define TRACE_EVENT_FLAG_COPY (static_cast<unsigned char>(1 << 0)) | 715 #define TRACE_EVENT_FLAG_COPY (static_cast<unsigned char>(1 << 0)) |
| 615 #define TRACE_EVENT_FLAG_HAS_ID (static_cast<unsigned char>(1 << 1)) | 716 #define TRACE_EVENT_FLAG_HAS_ID (static_cast<unsigned char>(1 << 1)) |
| 616 #define TRACE_EVENT_FLAG_MANGLE_ID (static_cast<unsigned char>(1 << 2)) | 717 #define TRACE_EVENT_FLAG_MANGLE_ID (static_cast<unsigned char>(1 << 2)) |
| 617 | 718 |
| 618 // Type values for identifying types in the TraceValue union. | 719 // Type values for identifying types in the TraceValue union. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 631 const int kZeroNumArgs = 0; | 732 const int kZeroNumArgs = 0; |
| 632 const int kNoThreshholdBeginId = -1; | 733 const int kNoThreshholdBeginId = -1; |
| 633 const long long kNoThresholdValue = 0; | 734 const long long kNoThresholdValue = 0; |
| 634 const unsigned long long kNoEventId = 0; | 735 const unsigned long long kNoEventId = 0; |
| 635 | 736 |
| 636 // TraceID encapsulates an ID that can either be an integer or pointer. Pointers | 737 // TraceID encapsulates an ID that can either be an integer or pointer. Pointers |
| 637 // are mangled with the Process ID so that they are unlikely to collide when the | 738 // are mangled with the Process ID so that they are unlikely to collide when the |
| 638 // same pointer is used on different processes. | 739 // same pointer is used on different processes. |
| 639 class TraceID { | 740 class TraceID { |
| 640 public: | 741 public: |
| 641 explicit TraceID(const void* id, unsigned char* flags) : | 742 class ForceMangle { |
| 642 data_(static_cast<unsigned long long>( | 743 public: |
| 643 reinterpret_cast<unsigned long>(id))) { | 744 explicit ForceMangle(unsigned long long id) : data_(id) {} |
| 745 explicit ForceMangle(unsigned long id) : data_(id) {} |
| 746 explicit ForceMangle(unsigned int id) : data_(id) {} |
| 747 explicit ForceMangle(unsigned short id) : data_(id) {} |
| 748 explicit ForceMangle(unsigned char id) : data_(id) {} |
| 749 explicit ForceMangle(long long id) |
| 750 : data_(static_cast<unsigned long long>(id)) {} |
| 751 explicit ForceMangle(long id) |
| 752 : data_(static_cast<unsigned long long>(id)) {} |
| 753 explicit ForceMangle(int id) |
| 754 : data_(static_cast<unsigned long long>(id)) {} |
| 755 explicit ForceMangle(short id) |
| 756 : data_(static_cast<unsigned long long>(id)) {} |
| 757 explicit ForceMangle(signed char id) |
| 758 : data_(static_cast<unsigned long long>(id)) {} |
| 759 |
| 760 unsigned long long data() const { return data_; } |
| 761 |
| 762 private: |
| 763 unsigned long long data_; |
| 764 }; |
| 765 |
| 766 explicit TraceID(const void* id, unsigned char* flags) |
| 767 : data_(static_cast<unsigned long long>( |
| 768 reinterpret_cast<unsigned long>(id))) { |
| 644 *flags |= TRACE_EVENT_FLAG_MANGLE_ID; | 769 *flags |= TRACE_EVENT_FLAG_MANGLE_ID; |
| 645 } | 770 } |
| 646 explicit TraceID(unsigned long long id, unsigned char* flags) : | 771 explicit TraceID(ForceMangle id, unsigned char* flags) : data_(id.data()) { |
| 647 data_(id) { (void)flags; } | 772 *flags |= TRACE_EVENT_FLAG_MANGLE_ID; |
| 648 explicit TraceID(unsigned long id, unsigned char* flags) : | 773 } |
| 649 data_(id) { (void)flags; } | 774 explicit TraceID(unsigned long long id, unsigned char* flags) |
| 650 explicit TraceID(unsigned int id, unsigned char* flags) : | 775 : data_(id) { (void)flags; } |
| 651 data_(id) { (void)flags; } | 776 explicit TraceID(unsigned long id, unsigned char* flags) |
| 652 explicit TraceID(unsigned short id, unsigned char* flags) : | 777 : data_(id) { (void)flags; } |
| 653 data_(id) { (void)flags; } | 778 explicit TraceID(unsigned int id, unsigned char* flags) |
| 654 explicit TraceID(unsigned char id, unsigned char* flags) : | 779 : data_(id) { (void)flags; } |
| 655 data_(id) { (void)flags; } | 780 explicit TraceID(unsigned short id, unsigned char* flags) |
| 656 explicit TraceID(long long id, unsigned char* flags) : | 781 : data_(id) { (void)flags; } |
| 657 data_(static_cast<unsigned long long>(id)) { (void)flags; } | 782 explicit TraceID(unsigned char id, unsigned char* flags) |
| 658 explicit TraceID(long id, unsigned char* flags) : | 783 : data_(id) { (void)flags; } |
| 659 data_(static_cast<unsigned long long>(id)) { (void)flags; } | 784 explicit TraceID(long long id, unsigned char* flags) |
| 660 explicit TraceID(int id, unsigned char* flags) : | 785 : data_(static_cast<unsigned long long>(id)) { (void)flags; } |
| 661 data_(static_cast<unsigned long long>(id)) { (void)flags; } | 786 explicit TraceID(long id, unsigned char* flags) |
| 662 explicit TraceID(short id, unsigned char* flags) : | 787 : data_(static_cast<unsigned long long>(id)) { (void)flags; } |
| 663 data_(static_cast<unsigned long long>(id)) { (void)flags; } | 788 explicit TraceID(int id, unsigned char* flags) |
| 664 explicit TraceID(signed char id, unsigned char* flags) : | 789 : data_(static_cast<unsigned long long>(id)) { (void)flags; } |
| 665 data_(static_cast<unsigned long long>(id)) { (void)flags; } | 790 explicit TraceID(short id, unsigned char* flags) |
| 791 : data_(static_cast<unsigned long long>(id)) { (void)flags; } |
| 792 explicit TraceID(signed char id, unsigned char* flags) |
| 793 : data_(static_cast<unsigned long long>(id)) { (void)flags; } |
| 666 | 794 |
| 667 unsigned long long data() const { return data_; } | 795 unsigned long long data() const { return data_; } |
| 668 | 796 |
| 669 private: | 797 private: |
| 670 unsigned long long data_; | 798 unsigned long long data_; |
| 671 }; | 799 }; |
| 672 | 800 |
| 673 // Simple union to store various types as unsigned long long. | 801 // Simple union to store various types as unsigned long long. |
| 674 union TraceValueUnion { | 802 union TraceValueUnion { |
| 675 bool as_bool; | 803 bool as_bool; |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 864 const char* name; | 992 const char* name; |
| 865 int threshold_begin_id; | 993 int threshold_begin_id; |
| 866 }; | 994 }; |
| 867 Data* p_data_; | 995 Data* p_data_; |
| 868 Data data_; | 996 Data data_; |
| 869 }; | 997 }; |
| 870 | 998 |
| 871 } // namespace trace_event_internal | 999 } // namespace trace_event_internal |
| 872 | 1000 |
| 873 #endif // BASE_DEBUG_TRACE_EVENT_H_ | 1001 #endif // BASE_DEBUG_TRACE_EVENT_H_ |
| OLD | NEW |