| OLD | NEW |
| 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" |
| 11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/lazy_instance.h" | 13 #include "base/lazy_instance.h" |
| 14 #include "base/location.h" | 14 #include "base/location.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/profiler/native_stack_sampler.h" | 16 #include "base/profiler/native_stack_sampler.h" |
| 17 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
| 18 #include "base/thread_task_runner_handle.h" | 18 #include "base/threading/thread_task_runner_handle.h" |
| 19 #include "base/timer/elapsed_timer.h" | 19 #include "base/timer/elapsed_timer.h" |
| 20 | 20 |
| 21 namespace base { | 21 namespace base { |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 // Used to ensure only one profiler is running at a time. | 25 // Used to ensure only one profiler is running at a time. |
| 26 LazyInstance<Lock> concurrent_profiling_lock = LAZY_INSTANCE_INITIALIZER; | 26 LazyInstance<Lock> concurrent_profiling_lock = LAZY_INSTANCE_INITIALIZER; |
| 27 | 27 |
| 28 // AsyncRunner ---------------------------------------------------------------- | 28 // AsyncRunner ---------------------------------------------------------------- |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 } | 281 } |
| 282 | 282 |
| 283 bool operator<(const StackSamplingProfiler::Frame &a, | 283 bool operator<(const StackSamplingProfiler::Frame &a, |
| 284 const StackSamplingProfiler::Frame &b) { | 284 const StackSamplingProfiler::Frame &b) { |
| 285 return (a.module_index < b.module_index) || | 285 return (a.module_index < b.module_index) || |
| 286 (a.module_index == b.module_index && | 286 (a.module_index == b.module_index && |
| 287 a.instruction_pointer < b.instruction_pointer); | 287 a.instruction_pointer < b.instruction_pointer); |
| 288 } | 288 } |
| 289 | 289 |
| 290 } // namespace base | 290 } // namespace base |
| OLD | NEW |