Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: base/trace_event/memory_dump_manager.cc

Issue 1344543002: [tracing] Expose level of detail of memory dumps in the trace JSON (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup_levdetail
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698