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

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

Issue 2415183004: Revert of [tracing] Add filtering mode in TraceLog (Closed)
Patch Set: Created 4 years, 2 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 | base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc » ('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/heap_profiler_allocation_context_tracker.h" 5 #include "base/trace_event/heap_profiler_allocation_context_tracker.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 9
10 #include "base/atomicops.h" 10 #include "base/atomicops.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // Guard for stack underflow. If tracing was started with a TRACE_EVENT in 122 // Guard for stack underflow. If tracing was started with a TRACE_EVENT in
123 // scope, the frame was never pushed, so it is possible that pop is called 123 // scope, the frame was never pushed, so it is possible that pop is called
124 // on an empty stack. 124 // on an empty stack.
125 if (pseudo_stack_.empty()) 125 if (pseudo_stack_.empty())
126 return; 126 return;
127 127
128 // Assert that pushes and pops are nested correctly. This DCHECK can be 128 // Assert that pushes and pops are nested correctly. This DCHECK can be
129 // hit if some TRACE_EVENT macro is unbalanced (a TRACE_EVENT_END* call 129 // hit if some TRACE_EVENT macro is unbalanced (a TRACE_EVENT_END* call
130 // without a corresponding TRACE_EVENT_BEGIN). 130 // without a corresponding TRACE_EVENT_BEGIN).
131 DCHECK(stack_frame == pseudo_stack_.back()) 131 DCHECK(stack_frame == pseudo_stack_.back())
132 << "Encountered an unmatched TRACE_EVENT_END: " 132 << "Encountered an unmatched TRACE_EVENT_END";
133 << stack_frame.trace_event_name
134 << " vs event in stack: " << pseudo_stack_.back().trace_event_name;
135 133
136 pseudo_stack_.pop_back(); 134 pseudo_stack_.pop_back();
137 } 135 }
138 136
139 void AllocationContextTracker::PushCurrentTaskContext(const char* context) { 137 void AllocationContextTracker::PushCurrentTaskContext(const char* context) {
140 DCHECK(context); 138 DCHECK(context);
141 if (task_contexts_.size() < kMaxTaskDepth) 139 if (task_contexts_.size() < kMaxTaskDepth)
142 task_contexts_.push_back(context); 140 task_contexts_.push_back(context);
143 else 141 else
144 NOTREACHED(); 142 NOTREACHED();
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 // If task context was unavailable, then the category names are taken from 244 // If task context was unavailable, then the category names are taken from
247 // trace events. 245 // trace events.
248 ctx.type_name = pseudo_stack_.back().trace_event_category; 246 ctx.type_name = pseudo_stack_.back().trace_event_category;
249 } 247 }
250 248
251 return ctx; 249 return ctx;
252 } 250 }
253 251
254 } // namespace trace_event 252 } // namespace trace_event
255 } // namespace base 253 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698