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

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

Issue 2040663002: Tracing: Added necessary plumbing to make sure clocksync metadata events are always included. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « base/trace_event/common/trace_event_common.h ('k') | base/trace_event/trace_event.h » ('j') | 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 #include <utility> 8 #include <utility>
9 9
10 #include "base/atomic_sequence_num.h" 10 #include "base/atomic_sequence_num.h"
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 if (heap_profiling_enabled_) { 654 if (heap_profiling_enabled_) {
655 // If heap profiling is enabled, the stack frame deduplicator and type name 655 // If heap profiling is enabled, the stack frame deduplicator and type name
656 // deduplicator will be in use. Add a metadata events to write the frames 656 // deduplicator will be in use. Add a metadata events to write the frames
657 // and type IDs. 657 // and type IDs.
658 session_state->SetStackFrameDeduplicator( 658 session_state->SetStackFrameDeduplicator(
659 WrapUnique(new StackFrameDeduplicator)); 659 WrapUnique(new StackFrameDeduplicator));
660 660
661 session_state->SetTypeNameDeduplicator( 661 session_state->SetTypeNameDeduplicator(
662 WrapUnique(new TypeNameDeduplicator)); 662 WrapUnique(new TypeNameDeduplicator));
663 663
664 TRACE_EVENT_API_ADD_METADATA_EVENT( 664 TRACE_EVENT_METADATA_FORCED1(
665 TraceLog::GetCategoryGroupEnabled("__metadata"), "stackFrames", 665 "stackFrames", "stackFrames",
666 "stackFrames",
667 WrapUnique(new SessionStateConvertableProxy<StackFrameDeduplicator>( 666 WrapUnique(new SessionStateConvertableProxy<StackFrameDeduplicator>(
668 session_state, &MemoryDumpSessionState::stack_frame_deduplicator))); 667 session_state, &MemoryDumpSessionState::stack_frame_deduplicator)));
669 668
670 TRACE_EVENT_API_ADD_METADATA_EVENT( 669 TRACE_EVENT_METADATA_FORCED1(
671 TraceLog::GetCategoryGroupEnabled("__metadata"), "typeNames", 670 "typeNames", "typeNames",
672 "typeNames",
673 WrapUnique(new SessionStateConvertableProxy<TypeNameDeduplicator>( 671 WrapUnique(new SessionStateConvertableProxy<TypeNameDeduplicator>(
674 session_state, &MemoryDumpSessionState::type_name_deduplicator))); 672 session_state, &MemoryDumpSessionState::type_name_deduplicator)));
675 } 673 }
676 674
677 { 675 {
678 AutoLock lock(lock_); 676 AutoLock lock(lock_);
679 677
680 DCHECK(delegate_); // At this point we must have a delegate. 678 DCHECK(delegate_); // At this point we must have a delegate.
681 session_state_ = session_state; 679 session_state_ = session_state;
682 680
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 if (heavy_dump_rate_ > 0 && periodic_dumps_count_ % heavy_dump_rate_ == 0) 837 if (heavy_dump_rate_ > 0 && periodic_dumps_count_ % heavy_dump_rate_ == 0)
840 level_of_detail = MemoryDumpLevelOfDetail::DETAILED; 838 level_of_detail = MemoryDumpLevelOfDetail::DETAILED;
841 ++periodic_dumps_count_; 839 ++periodic_dumps_count_;
842 840
843 MemoryDumpManager::GetInstance()->RequestGlobalDump( 841 MemoryDumpManager::GetInstance()->RequestGlobalDump(
844 MemoryDumpType::PERIODIC_INTERVAL, level_of_detail); 842 MemoryDumpType::PERIODIC_INTERVAL, level_of_detail);
845 } 843 }
846 844
847 } // namespace trace_event 845 } // namespace trace_event
848 } // namespace base 846 } // namespace base
OLDNEW
« no previous file with comments | « base/trace_event/common/trace_event_common.h ('k') | base/trace_event/trace_event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698