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

Side by Side Diff: base/trace_event/heap_profiler.h

Issue 1839503002: [tracing] Add native allocation tracing mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Increase Backtrace frames, request even more frames Created 4 years, 8 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/base_switches.cc ('k') | base/trace_event/heap_profiler_allocation_context.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef BASE_TRACE_EVENT_HEAP_PROFILER_H 5 #ifndef BASE_TRACE_EVENT_HEAP_PROFILER_H
6 #define BASE_TRACE_EVENT_HEAP_PROFILER_H 6 #define BASE_TRACE_EVENT_HEAP_PROFILER_H
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/trace_event/heap_profiler_allocation_context_tracker.h" 9 #include "base/trace_event/heap_profiler_allocation_context_tracker.h"
10 10
(...skipping 15 matching lines...) Expand all
26 // tracing from the heap profiler dumps. 26 // tracing from the heap profiler dumps.
27 #define HEAP_PROFILER_SCOPED_IGNORE \ 27 #define HEAP_PROFILER_SCOPED_IGNORE \
28 trace_event_internal::HeapProfilerScopedIgnore INTERNAL_HEAP_PROFILER_UID( \ 28 trace_event_internal::HeapProfilerScopedIgnore INTERNAL_HEAP_PROFILER_UID( \
29 scoped_ignore) 29 scoped_ignore)
30 30
31 namespace trace_event_internal { 31 namespace trace_event_internal {
32 32
33 class BASE_EXPORT HeapProfilerScopedIgnore { 33 class BASE_EXPORT HeapProfilerScopedIgnore {
34 public: 34 public:
35 inline HeapProfilerScopedIgnore() { 35 inline HeapProfilerScopedIgnore() {
36 using base::trace_event::AllocationContextTracker;
36 if (UNLIKELY( 37 if (UNLIKELY(
37 base::trace_event::AllocationContextTracker::capture_enabled())) { 38 AllocationContextTracker::capture_mode() !=
38 base::trace_event::AllocationContextTracker::GetInstanceForCurrentThread() 39 AllocationContextTracker::CaptureMode::DISABLED)) {
40 AllocationContextTracker::GetInstanceForCurrentThread()
39 ->begin_ignore_scope(); 41 ->begin_ignore_scope();
40 } 42 }
41 } 43 }
42 inline ~HeapProfilerScopedIgnore() { 44 inline ~HeapProfilerScopedIgnore() {
45 using base::trace_event::AllocationContextTracker;
43 if (UNLIKELY( 46 if (UNLIKELY(
44 base::trace_event::AllocationContextTracker::capture_enabled())) { 47 AllocationContextTracker::capture_mode() !=
45 base::trace_event::AllocationContextTracker::GetInstanceForCurrentThread() 48 AllocationContextTracker::CaptureMode::DISABLED)) {
49 AllocationContextTracker::GetInstanceForCurrentThread()
46 ->end_ignore_scope(); 50 ->end_ignore_scope();
47 } 51 }
48 } 52 }
49 }; 53 };
50 54
51 } // namespace trace_event_internal 55 } // namespace trace_event_internal
52 56
53 #endif // BASE_TRACE_EVENT_HEAP_PROFILER_H 57 #endif // BASE_TRACE_EVENT_HEAP_PROFILER_H
OLDNEW
« no previous file with comments | « base/base_switches.cc ('k') | base/trace_event/heap_profiler_allocation_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698