| Index: base/debug/trace_event.h
|
| diff --git a/base/debug/trace_event.h b/base/debug/trace_event.h
|
| index 804b468116243bf17674fd64002f4ababf1c1ea0..d74f861a455737d67373ab2c8a1a22aeefaa1684 100644
|
| --- a/base/debug/trace_event.h
|
| +++ b/base/debug/trace_event.h
|
| @@ -162,6 +162,11 @@
|
| #define TRACE_STR_COPY(str) \
|
| trace_event_internal::TraceStringWithCopy(str)
|
|
|
| +// By default, uint64 ID argument values are not mangled with the Process ID in
|
| +// TRACE_EVENT_ASYNC macros. Use this macro to force Process ID mangling.
|
| +#define TRACE_ID_MANGLE(id) \
|
| + trace_event_internal::TraceID::ForceMangle(id)
|
| +
|
| // Records a pair of begin and end events called "name" for the current
|
| // scope, with 0, 1 or 2 associated arguments. If the category is not
|
| // enabled, then this does nothing.
|
| @@ -638,11 +643,38 @@ const unsigned long long kNoEventId = 0;
|
| // same pointer is used on different processes.
|
| class TraceID {
|
| public:
|
| + class ForceMangle {
|
| + public:
|
| + explicit ForceMangle(unsigned long long id) : data_(id) {}
|
| + explicit ForceMangle(unsigned long id) : data_(id) {}
|
| + explicit ForceMangle(unsigned int id) : data_(id) {}
|
| + explicit ForceMangle(unsigned short id) : data_(id) {}
|
| + explicit ForceMangle(unsigned char id) : data_(id) {}
|
| + explicit ForceMangle(long long id) :
|
| + data_(static_cast<unsigned long long>(id)) {}
|
| + explicit ForceMangle(long id) :
|
| + data_(static_cast<unsigned long long>(id)) {}
|
| + explicit ForceMangle(int id) :
|
| + data_(static_cast<unsigned long long>(id)) {}
|
| + explicit ForceMangle(short id) :
|
| + data_(static_cast<unsigned long long>(id)) {}
|
| + explicit ForceMangle(signed char id) :
|
| + data_(static_cast<unsigned long long>(id)) {}
|
| +
|
| + unsigned long long data() const { return data_; }
|
| +
|
| + private:
|
| + unsigned long long data_;
|
| + };
|
| +
|
| explicit TraceID(const void* id, unsigned char* flags) :
|
| data_(static_cast<unsigned long long>(
|
| reinterpret_cast<unsigned long>(id))) {
|
| *flags |= TRACE_EVENT_FLAG_MANGLE_ID;
|
| }
|
| + explicit TraceID(ForceMangle id, unsigned char* flags) : data_(id.data()) {
|
| + *flags |= TRACE_EVENT_FLAG_MANGLE_ID;
|
| + }
|
| explicit TraceID(unsigned long long id, unsigned char* flags) :
|
| data_(id) { (void)flags; }
|
| explicit TraceID(unsigned long id, unsigned char* flags) :
|
|
|