OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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, base::LeakyLazyInstanceTraits<ProfilerFuncs> > |
108 funcs = LAZY_INSTANCE_INITIALIZER; | 108 funcs = LAZY_INSTANCE_INITIALIZER; |
109 | 109 |
110 } // namespace | 110 } // namespace |
111 | 111 |
112 | 112 |
113 namespace base { | 113 namespace base { |
114 namespace win { | 114 namespace win { |
115 | 115 |
116 SamplingProfiler::SamplingProfiler() : is_started_(false) { | 116 SamplingProfiler::SamplingProfiler() : is_started_(false) { |
117 } | 117 } |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 return false; | 230 return false; |
231 | 231 |
232 // According to Nebbet, the sampling interval is in units of 100ns. | 232 // According to Nebbet, the sampling interval is in units of 100ns. |
233 *sampling_interval = base::TimeDelta::FromMicroseconds(interval / 10); | 233 *sampling_interval = base::TimeDelta::FromMicroseconds(interval / 10); |
234 | 234 |
235 return true; | 235 return true; |
236 } | 236 } |
237 | 237 |
238 } // namespace win | 238 } // namespace win |
239 } // namespace base | 239 } // namespace base |
OLD | NEW |