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 #include "base/trace_event/memory_dump_manager.h" | 5 #include "base/trace_event/memory_dump_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 scoped_ptr<ProcessMemoryDumpAsyncState> pmd_async_state) { | 360 scoped_ptr<ProcessMemoryDumpAsyncState> pmd_async_state) { |
361 if (!pmd_async_state->task_runner->BelongsToCurrentThread()) { | 361 if (!pmd_async_state->task_runner->BelongsToCurrentThread()) { |
362 scoped_refptr<SingleThreadTaskRunner> task_runner = | 362 scoped_refptr<SingleThreadTaskRunner> task_runner = |
363 pmd_async_state->task_runner; | 363 pmd_async_state->task_runner; |
364 task_runner->PostTask(FROM_HERE, | 364 task_runner->PostTask(FROM_HERE, |
365 Bind(&MemoryDumpManager::FinalizeDumpAndAddToTrace, | 365 Bind(&MemoryDumpManager::FinalizeDumpAndAddToTrace, |
366 Passed(pmd_async_state.Pass()))); | 366 Passed(pmd_async_state.Pass()))); |
367 return; | 367 return; |
368 } | 368 } |
369 | 369 |
370 scoped_refptr<ConvertableToTraceFormat> event_value(new TracedValue()); | 370 TracedValue* traced_value = new TracedValue(); |
371 pmd_async_state->process_memory_dump.AsValueInto( | 371 scoped_refptr<ConvertableToTraceFormat> event_value(traced_value); |
372 static_cast<TracedValue*>(event_value.get())); | 372 pmd_async_state->process_memory_dump.AsValueInto(traced_value); |
| 373 traced_value->SetString("level_of_detail", |
| 374 MemoryDumpLevelOfDetailToString( |
| 375 pmd_async_state->req_args.level_of_detail)); |
373 const char* const event_name = | 376 const char* const event_name = |
374 MemoryDumpTypeToString(pmd_async_state->req_args.dump_type); | 377 MemoryDumpTypeToString(pmd_async_state->req_args.dump_type); |
375 | 378 |
376 TRACE_EVENT_API_ADD_TRACE_EVENT( | 379 TRACE_EVENT_API_ADD_TRACE_EVENT( |
377 TRACE_EVENT_PHASE_MEMORY_DUMP, | 380 TRACE_EVENT_PHASE_MEMORY_DUMP, |
378 TraceLog::GetCategoryGroupEnabled(kTraceCategory), event_name, | 381 TraceLog::GetCategoryGroupEnabled(kTraceCategory), event_name, |
379 pmd_async_state->req_args.dump_guid, kTraceEventNumArgs, | 382 pmd_async_state->req_args.dump_guid, kTraceEventNumArgs, |
380 kTraceEventArgNames, kTraceEventArgTypes, nullptr /* arg_values */, | 383 kTraceEventArgNames, kTraceEventArgTypes, nullptr /* arg_values */, |
381 &event_value, TRACE_EVENT_FLAG_HAS_ID); | 384 &event_value, TRACE_EVENT_FLAG_HAS_ID); |
382 | 385 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 next_dump_provider(next_dump_provider), | 506 next_dump_provider(next_dump_provider), |
504 callback(callback), | 507 callback(callback), |
505 task_runner(MessageLoop::current()->task_runner()) { | 508 task_runner(MessageLoop::current()->task_runner()) { |
506 } | 509 } |
507 | 510 |
508 MemoryDumpManager::ProcessMemoryDumpAsyncState::~ProcessMemoryDumpAsyncState() { | 511 MemoryDumpManager::ProcessMemoryDumpAsyncState::~ProcessMemoryDumpAsyncState() { |
509 } | 512 } |
510 | 513 |
511 } // namespace trace_event | 514 } // namespace trace_event |
512 } // namespace base | 515 } // namespace base |
OLD | NEW |