| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 // Without the use of these static category pointers and enabled flags all | 159 // Without the use of these static category pointers and enabled flags all |
| 160 // trace points would carry a significant performance cost of aquiring a lock | 160 // trace points would carry a significant performance cost of aquiring a lock |
| 161 // and resolving the category. | 161 // and resolving the category. |
| 162 | 162 |
| 163 #ifndef TraceEvent_h | 163 #ifndef TraceEvent_h |
| 164 #define TraceEvent_h | 164 #define TraceEvent_h |
| 165 | 165 |
| 166 #include "platform/EventTracer.h" | 166 #include "platform/EventTracer.h" |
| 167 | 167 |
| 168 #include "wtf/DynamicAnnotations.h" | 168 #include "wtf/DynamicAnnotations.h" |
| 169 #include "wtf/UnusedParam.h" | |
| 170 #include "wtf/text/CString.h" | 169 #include "wtf/text/CString.h" |
| 171 | 170 |
| 172 // By default, const char* argument values are assumed to have long-lived scope | 171 // By default, const char* argument values are assumed to have long-lived scope |
| 173 // and will not be copied. Use this macro to force a const char* to be copied. | 172 // and will not be copied. Use this macro to force a const char* to be copied. |
| 174 #define TRACE_STR_COPY(str) \ | 173 #define TRACE_STR_COPY(str) \ |
| 175 WebCore::TraceEvent::TraceStringWithCopy(str) | 174 WebCore::TraceEvent::TraceStringWithCopy(str) |
| 176 | 175 |
| 177 // By default, uint64 ID argument values are not mangled with the Process ID in | 176 // By default, uint64 ID argument values are not mangled with the Process ID in |
| 178 // TRACE_EVENT_ASYNC macros. Use this macro to force Process ID mangling. | 177 // TRACE_EVENT_ASYNC macros. Use this macro to force Process ID mangling. |
| 179 #define TRACE_ID_MANGLE(id) \ | 178 #define TRACE_ID_MANGLE(id) \ |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 | 685 |
| 687 TraceID(const void* id, unsigned char* flags) : | 686 TraceID(const void* id, unsigned char* flags) : |
| 688 m_data(static_cast<unsigned long long>(reinterpret_cast<unsigned long>(i
d))) | 687 m_data(static_cast<unsigned long long>(reinterpret_cast<unsigned long>(i
d))) |
| 689 { | 688 { |
| 690 *flags |= TRACE_EVENT_FLAG_MANGLE_ID; | 689 *flags |= TRACE_EVENT_FLAG_MANGLE_ID; |
| 691 } | 690 } |
| 692 TraceID(ForceMangle id, unsigned char* flags) : m_data(id.data()) | 691 TraceID(ForceMangle id, unsigned char* flags) : m_data(id.data()) |
| 693 { | 692 { |
| 694 *flags |= TRACE_EVENT_FLAG_MANGLE_ID; | 693 *flags |= TRACE_EVENT_FLAG_MANGLE_ID; |
| 695 } | 694 } |
| 696 TraceID(DontMangle id, unsigned char* flags) : m_data(id.data()) { UNUSED_PA
RAM(flags); } | 695 TraceID(DontMangle id, unsigned char*) : m_data(id.data()) { } |
| 697 TraceID(unsigned long long id, unsigned char* flags) : m_data(id) { UNUSED_P
ARAM(flags); } | 696 TraceID(unsigned long long id, unsigned char*) : m_data(id) { } |
| 698 TraceID(unsigned long id, unsigned char* flags) : m_data(id) { UNUSED_PARAM(
flags); } | 697 TraceID(unsigned long id, unsigned char*) : m_data(id) { } |
| 699 TraceID(unsigned id, unsigned char* flags) : m_data(id) { UNUSED_PARAM(flags
); } | 698 TraceID(unsigned id, unsigned char*) : m_data(id) { } |
| 700 TraceID(unsigned short id, unsigned char* flags) : m_data(id) { UNUSED_PARAM
(flags); } | 699 TraceID(unsigned short id, unsigned char*) : m_data(id) { } |
| 701 TraceID(unsigned char id, unsigned char* flags) : m_data(id) { UNUSED_PARAM(
flags); } | 700 TraceID(unsigned char id, unsigned char*) : m_data(id) { } |
| 702 TraceID(long long id, unsigned char* flags) : | 701 TraceID(long long id, unsigned char*) : |
| 703 m_data(static_cast<unsigned long long>(id)) { UNUSED_PARAM(flags); } | 702 m_data(static_cast<unsigned long long>(id)) { } |
| 704 TraceID(long id, unsigned char* flags) : | 703 TraceID(long id, unsigned char*) : |
| 705 m_data(static_cast<unsigned long long>(id)) { UNUSED_PARAM(flags); } | 704 m_data(static_cast<unsigned long long>(id)) { } |
| 706 TraceID(int id, unsigned char* flags) : | 705 TraceID(int id, unsigned char*) : |
| 707 m_data(static_cast<unsigned long long>(id)) { UNUSED_PARAM(flags); } | 706 m_data(static_cast<unsigned long long>(id)) { } |
| 708 TraceID(short id, unsigned char* flags) : | 707 TraceID(short id, unsigned char*) : |
| 709 m_data(static_cast<unsigned long long>(id)) { UNUSED_PARAM(flags); } | 708 m_data(static_cast<unsigned long long>(id)) { } |
| 710 TraceID(signed char id, unsigned char* flags) : | 709 TraceID(signed char id, unsigned char*) : |
| 711 m_data(static_cast<unsigned long long>(id)) { UNUSED_PARAM(flags); } | 710 m_data(static_cast<unsigned long long>(id)) { } |
| 712 | 711 |
| 713 unsigned long long data() const { return m_data; } | 712 unsigned long long data() const { return m_data; } |
| 714 | 713 |
| 715 private: | 714 private: |
| 716 unsigned long long m_data; | 715 unsigned long long m_data; |
| 717 }; | 716 }; |
| 718 | 717 |
| 719 // Simple union to store various types as unsigned long long. | 718 // Simple union to store various types as unsigned long long. |
| 720 union TraceValueUnion { | 719 union TraceValueUnion { |
| 721 bool m_bool; | 720 bool m_bool; |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 const char* m_categoryGroup; | 933 const char* m_categoryGroup; |
| 935 const char* m_name; | 934 const char* m_name; |
| 936 IDType m_id; | 935 IDType m_id; |
| 937 }; | 936 }; |
| 938 | 937 |
| 939 } // namespace TraceEvent | 938 } // namespace TraceEvent |
| 940 | 939 |
| 941 } // namespace WebCore | 940 } // namespace WebCore |
| 942 | 941 |
| 943 #endif | 942 #endif |
| OLD | NEW |