OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 // This is a cross platform interface for helper functions related to | |
6 // debuggers. You should use this to test if you're running under a debugger, | |
7 // and if you would like to yield (breakpoint) into the debugger. | |
Evan Martin
2011/02/01 02:45:59
This comment is wrong, no?
DaveMoore
2011/02/01 19:21:55
Done.
| |
8 | |
9 #ifndef BASE_DEBUG_PROFILER_H | |
10 #define BASE_DEBUG_PROFILER_H | |
11 #pragma once | |
12 | |
13 #include <string> | |
14 | |
15 // The Profiler functions allow usage of the underlying sampling based | |
16 // profiler. If the application has not been built with the necessary | |
17 // flags (-DENABLE_PROFILING and not -DNO_TCMALLOC) then these functions | |
18 // are noops. | |
19 namespace base { | |
20 namespace debug { | |
21 | |
22 // Start profiling with the supplied name. | |
23 // {pid} will be replaced by the process' pid and {count} will be replaced | |
24 // by the count of the profile run (starts at 1 with each process). | |
25 void StartProfiling(const std::string name); | |
jamesr
2011/02/01 01:21:45
nit: should this be by reference?
DaveMoore
2011/02/01 19:21:55
Done.
| |
26 | |
27 // Stop profiling and write out data. | |
28 void StopProfiling(); | |
29 | |
30 // Force data to be written to file. | |
31 void FlushProfiling(); | |
32 | |
33 // Returns true if process is being profiled. | |
34 bool BeingProfiled(); | |
35 | |
36 } // namespace debug | |
37 } // namespace base | |
38 | |
39 #endif // BASE_DEBUG_DEBUGGER_H | |
OLD | NEW |