Index: base/trace_event/memory_dump_manager.cc |
diff --git a/base/trace_event/memory_dump_manager.cc b/base/trace_event/memory_dump_manager.cc |
index 6aaa3599720d150bc957cee18d965f5d93ecf7e5..a74b95634db22a94b480b7ff4d1a7da3029c6cd0 100644 |
--- a/base/trace_event/memory_dump_manager.cc |
+++ b/base/trace_event/memory_dump_manager.cc |
@@ -4,6 +4,9 @@ |
#include "base/trace_event/memory_dump_manager.h" |
+#include <inttypes.h> |
+#include <stdio.h> |
+ |
#include <algorithm> |
#include <utility> |
@@ -82,9 +85,12 @@ const char* const kStrictThreadCheckBlacklist[] = { |
void OnGlobalDumpDone(MemoryDumpCallback wrapped_callback, |
uint64_t dump_guid, |
bool success) { |
- TRACE_EVENT_NESTABLE_ASYNC_END1( |
- MemoryDumpManager::kTraceCategory, "GlobalMemoryDump", |
- TRACE_ID_MANGLE(dump_guid), "success", success); |
+ char guid_str[20]; |
+ sprintf(guid_str, "0x%" PRIx64, dump_guid); |
ssid
2017/03/28 20:21:56
Do we need 0x?
base::Uint64ToString looks better,
Primiano Tucci (use gerrit)
2017/03/28 23:13:15
not too strong but helps debuggin to copy/paste an
|
+ TRACE_EVENT_NESTABLE_ASYNC_END2(MemoryDumpManager::kTraceCategory, |
+ "GlobalMemoryDump", TRACE_ID_LOCAL(dump_guid), |
+ "dump_guid", TRACE_STR_COPY(guid_str), |
+ "success", success); |
if (!wrapped_callback.is_null()) { |
wrapped_callback.Run(dump_guid, success); |
@@ -463,8 +469,10 @@ void MemoryDumpManager::RequestGlobalDump( |
// Creates an async event to keep track of the global dump evolution. |
// The |wrapped_callback| will generate the ASYNC_END event and then invoke |
// the real |callback| provided by the caller. |
- TRACE_EVENT_NESTABLE_ASYNC_BEGIN0(kTraceCategory, "GlobalMemoryDump", |
- TRACE_ID_MANGLE(guid)); |
+ TRACE_EVENT_NESTABLE_ASYNC_BEGIN2( |
+ kTraceCategory, "GlobalMemoryDump", TRACE_ID_LOCAL(guid), "dump_type", |
+ MemoryDumpTypeToString(dump_type), "level_of_detail", |
+ MemoryDumpLevelOfDetailToString(level_of_detail)); |
MemoryDumpCallback wrapped_callback = Bind(&OnGlobalDumpDone, callback); |
// The delegate will coordinate the IPC broadcast and at some point invoke |
@@ -492,8 +500,11 @@ bool MemoryDumpManager::IsDumpProviderRegisteredForTesting( |
void MemoryDumpManager::CreateProcessDump(const MemoryDumpRequestArgs& args, |
const MemoryDumpCallback& callback) { |
- TRACE_EVENT_NESTABLE_ASYNC_BEGIN0(kTraceCategory, "ProcessMemoryDump", |
- TRACE_ID_MANGLE(args.dump_guid)); |
+ char guid_str[20]; |
+ sprintf(guid_str, "0x%" PRIx64, args.dump_guid); |
+ TRACE_EVENT_NESTABLE_ASYNC_BEGIN1(kTraceCategory, "ProcessMemoryDump", |
+ TRACE_ID_LOCAL(args.dump_guid), "dump_guid", |
+ TRACE_STR_COPY(guid_str)); |
ssid
2017/03/28 20:21:56
For ProcessMemoryDump the guid is added at the BEG
Primiano Tucci (use gerrit)
2017/03/28 23:13:14
Aha I knew, well spotted.
ssid
2017/03/28 23:21:45
LOL!
|
// If argument filter is enabled then only background mode dumps should be |
// allowed. In case the trace config passed for background tracing session |
@@ -525,10 +536,6 @@ void MemoryDumpManager::CreateProcessDump(const MemoryDumpRequestArgs& args, |
MemoryDumpScheduler::GetInstance()->NotifyDumpTriggered(); |
} |
- TRACE_EVENT_WITH_FLOW0(kTraceCategory, "MemoryDumpManager::CreateProcessDump", |
- TRACE_ID_MANGLE(args.dump_guid), |
- TRACE_EVENT_FLAG_FLOW_OUT); |
- |
// Start the process dump. This involves task runner hops as specified by the |
// MemoryDumpProvider(s) in RegisterDumpProvider()). |
SetupNextMemoryDump(std::move(pmd_async_state)); |
@@ -672,11 +679,8 @@ void MemoryDumpManager::InvokeOnMemoryDump( |
if (should_dump) { |
// Invoke the dump provider. |
- TRACE_EVENT_WITH_FLOW1(kTraceCategory, |
- "MemoryDumpManager::InvokeOnMemoryDump", |
- TRACE_ID_MANGLE(pmd_async_state->req_args.dump_guid), |
- TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, |
- "dump_provider.name", mdpinfo->name); |
+ TRACE_EVENT1(kTraceCategory, "MemoryDumpManager::InvokeOnMemoryDump", |
+ "dump_provider.name", mdpinfo->name); |
// A stack allocated string with dump provider name is useful to debug |
// crashes while invoking dump after a |dump_provider| is not unregistered |
@@ -754,9 +758,7 @@ void MemoryDumpManager::FinalizeDumpAndAddToTrace( |
return; |
} |
- TRACE_EVENT_WITH_FLOW0(kTraceCategory, |
- "MemoryDumpManager::FinalizeDumpAndAddToTrace", |
- TRACE_ID_MANGLE(dump_guid), TRACE_EVENT_FLAG_FLOW_IN); |
+ TRACE_EVENT0(kTraceCategory, "MemoryDumpManager::FinalizeDumpAndAddToTrace"); |
// The results struct to fill. |
// TODO(hjd): Transitional until we send the full PMD. See crbug.com/704203 |
@@ -822,7 +824,7 @@ void MemoryDumpManager::FinalizeDumpAndAddToTrace( |
} |
TRACE_EVENT_NESTABLE_ASYNC_END0(kTraceCategory, "ProcessMemoryDump", |
- TRACE_ID_MANGLE(dump_guid)); |
+ TRACE_ID_LOCAL(dump_guid)); |
} |
void MemoryDumpManager::OnTraceLogEnabled() { |