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

Side by Side Diff: base/profiler/stack_sampling_profiler.cc

Issue 2267483002: Revert of Reland Introduce mojo interface for collecting StackSamplingProfiler data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/profiler/stack_sampling_profiler.h ('k') | components/metrics/BUILD.gn » ('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/profiler/stack_sampling_profiler.h" 5 #include "base/profiler/stack_sampling_profiler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 StackSamplingProfiler::Module::~Module() {} 94 StackSamplingProfiler::Module::~Module() {}
95 95
96 // StackSamplingProfiler::Frame ----------------------------------------------- 96 // StackSamplingProfiler::Frame -----------------------------------------------
97 97
98 StackSamplingProfiler::Frame::Frame(uintptr_t instruction_pointer, 98 StackSamplingProfiler::Frame::Frame(uintptr_t instruction_pointer,
99 size_t module_index) 99 size_t module_index)
100 : instruction_pointer(instruction_pointer), module_index(module_index) {} 100 : instruction_pointer(instruction_pointer), module_index(module_index) {}
101 101
102 StackSamplingProfiler::Frame::~Frame() {} 102 StackSamplingProfiler::Frame::~Frame() {}
103 103
104 StackSamplingProfiler::Frame::Frame() 104 StackSamplingProfiler::Frame::Frame() {}
105 : instruction_pointer(0), module_index(kUnknownModuleIndex) {
106 }
107 105
108 // StackSamplingProfiler::CallStackProfile ------------------------------------ 106 // StackSamplingProfiler::CallStackProfile ------------------------------------
109 107
110 StackSamplingProfiler::CallStackProfile::CallStackProfile() {} 108 StackSamplingProfiler::CallStackProfile::CallStackProfile() {}
111 109
112 StackSamplingProfiler::CallStackProfile::CallStackProfile( 110 StackSamplingProfiler::CallStackProfile::CallStackProfile(
113 const CallStackProfile& other) = default; 111 const CallStackProfile& other) = default;
114 112
115 StackSamplingProfiler::CallStackProfile::~CallStackProfile() {} 113 StackSamplingProfiler::CallStackProfile::~CallStackProfile() {}
116 114
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 sampling_thread_.reset(); 268 sampling_thread_.reset();
271 } 269 }
272 270
273 void StackSamplingProfiler::Stop() { 271 void StackSamplingProfiler::Stop() {
274 if (sampling_thread_) 272 if (sampling_thread_)
275 sampling_thread_->Stop(); 273 sampling_thread_->Stop();
276 } 274 }
277 275
278 // StackSamplingProfiler::Frame global functions ------------------------------ 276 // StackSamplingProfiler::Frame global functions ------------------------------
279 277
280 bool operator==(const StackSamplingProfiler::Module& a,
281 const StackSamplingProfiler::Module& b) {
282 return a.base_address == b.base_address && a.id == b.id &&
283 a.filename == b.filename;
284 }
285
286 bool operator==(const StackSamplingProfiler::Frame &a, 278 bool operator==(const StackSamplingProfiler::Frame &a,
287 const StackSamplingProfiler::Frame &b) { 279 const StackSamplingProfiler::Frame &b) {
288 return a.instruction_pointer == b.instruction_pointer && 280 return a.instruction_pointer == b.instruction_pointer &&
289 a.module_index == b.module_index; 281 a.module_index == b.module_index;
290 } 282 }
291 283
292 bool operator<(const StackSamplingProfiler::Frame &a, 284 bool operator<(const StackSamplingProfiler::Frame &a,
293 const StackSamplingProfiler::Frame &b) { 285 const StackSamplingProfiler::Frame &b) {
294 return (a.module_index < b.module_index) || 286 return (a.module_index < b.module_index) ||
295 (a.module_index == b.module_index && 287 (a.module_index == b.module_index &&
296 a.instruction_pointer < b.instruction_pointer); 288 a.instruction_pointer < b.instruction_pointer);
297 } 289 }
298 290
299 } // namespace base 291 } // namespace base
OLDNEW
« no previous file with comments | « base/profiler/stack_sampling_profiler.h ('k') | components/metrics/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698