OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/win/sampling_profiler.h" | 5 #include "base/win/sampling_profiler.h" |
6 | 6 |
7 #include <winternl.h> // for NTSTATUS. | 7 #include <winternl.h> // for NTSTATUS. |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 | 10 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 if (ZwSetIntervalProfile && | 97 if (ZwSetIntervalProfile && |
98 ZwQueryIntervalProfile && | 98 ZwQueryIntervalProfile && |
99 ZwCreateProfile && | 99 ZwCreateProfile && |
100 ZwStartProfile && | 100 ZwStartProfile && |
101 ZwStopProfile) { | 101 ZwStopProfile) { |
102 initialized_ = true; | 102 initialized_ = true; |
103 } | 103 } |
104 } | 104 } |
105 } | 105 } |
106 | 106 |
107 base::LazyInstance<ProfilerFuncs, base::LeakyLazyInstanceTraits<ProfilerFuncs> > | 107 base::LazyInstance<ProfilerFuncs>::Leaky funcs = LAZY_INSTANCE_INITIALIZER; |
108 funcs = LAZY_INSTANCE_INITIALIZER; | |
109 | 108 |
110 } // namespace | 109 } // namespace |
111 | 110 |
112 | 111 |
113 namespace base { | 112 namespace base { |
114 namespace win { | 113 namespace win { |
115 | 114 |
116 SamplingProfiler::SamplingProfiler() : is_started_(false) { | 115 SamplingProfiler::SamplingProfiler() : is_started_(false) { |
117 } | 116 } |
118 | 117 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 return false; | 229 return false; |
231 | 230 |
232 // According to Nebbet, the sampling interval is in units of 100ns. | 231 // According to Nebbet, the sampling interval is in units of 100ns. |
233 *sampling_interval = base::TimeDelta::FromMicroseconds(interval / 10); | 232 *sampling_interval = base::TimeDelta::FromMicroseconds(interval / 10); |
234 | 233 |
235 return true; | 234 return true; |
236 } | 235 } |
237 | 236 |
238 } // namespace win | 237 } // namespace win |
239 } // namespace base | 238 } // namespace base |
OLD | NEW |