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 #ifndef BASE_DEBUG_PROFILER_H | 5 #ifndef BASE_DEBUG_PROFILER_H |
6 #define BASE_DEBUG_PROFILER_H | 6 #define BASE_DEBUG_PROFILER_H |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/base_api.h" | 11 #include "base/base_export.h" |
12 | 12 |
13 // The Profiler functions allow usage of the underlying sampling based | 13 // The Profiler functions allow usage of the underlying sampling based |
14 // profiler. If the application has not been built with the necessary | 14 // profiler. If the application has not been built with the necessary |
15 // flags (-DENABLE_PROFILING and not -DNO_TCMALLOC) then these functions | 15 // flags (-DENABLE_PROFILING and not -DNO_TCMALLOC) then these functions |
16 // are noops. | 16 // are noops. |
17 namespace base { | 17 namespace base { |
18 namespace debug { | 18 namespace debug { |
19 | 19 |
20 // Start profiling with the supplied name. | 20 // Start profiling with the supplied name. |
21 // {pid} will be replaced by the process' pid and {count} will be replaced | 21 // {pid} will be replaced by the process' pid and {count} will be replaced |
22 // by the count of the profile run (starts at 1 with each process). | 22 // by the count of the profile run (starts at 1 with each process). |
23 BASE_API void StartProfiling(const std::string& name); | 23 BASE_EXPORT void StartProfiling(const std::string& name); |
24 | 24 |
25 // Stop profiling and write out data. | 25 // Stop profiling and write out data. |
26 BASE_API void StopProfiling(); | 26 BASE_EXPORT void StopProfiling(); |
27 | 27 |
28 // Force data to be written to file. | 28 // Force data to be written to file. |
29 BASE_API void FlushProfiling(); | 29 BASE_EXPORT void FlushProfiling(); |
30 | 30 |
31 // Returns true if process is being profiled. | 31 // Returns true if process is being profiled. |
32 BASE_API bool BeingProfiled(); | 32 BASE_EXPORT bool BeingProfiled(); |
33 | 33 |
34 } // namespace debug | 34 } // namespace debug |
35 } // namespace base | 35 } // namespace base |
36 | 36 |
37 #endif // BASE_DEBUG_DEBUGGER_H | 37 #endif // BASE_DEBUG_DEBUGGER_H |
OLD | NEW |