OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2006-2008 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 #ifndef CHROME_COMMON_PROFILING_H_ | |
6 #define CHROME_COMMON_PROFILING_H_ | |
7 #pragma once | |
8 | |
9 #include "build/build_config.h" | |
10 | |
11 #include "base/basictypes.h" | |
12 #include "base/debug/profiler.h" | |
13 | |
14 // The Profiling class manages the interaction with a sampling based profiler. | |
15 // Its function is controlled by the kProfilingAtStart, kProfilingFile, and | |
16 // kProfilingFlush command line values. | |
17 // All of the API should only be called from the main thread of the process.cddd fd | |
evanm
2011/02/01 19:39:59
typos in here
DaveMoore
2011/02/01 21:33:04
Done.
| |
18 class Profiling { | |
19 public: | |
20 // Called early in a process' life to allow profiling of the startup process. | |
evanm
2011/02/01 19:39:59
Maybe mention that this examines command-line flag
DaveMoore
2011/02/01 21:33:04
Changed method name to ProcessStarted() to match M
| |
21 static void StartAtStart(); | |
22 | |
23 // Start profiling. | |
24 static void Start(); | |
25 | |
26 // Stop profiling and write out profiling file. | |
27 static void Stop(); | |
28 | |
29 // Returns true if the process is being profiled. | |
30 static bool BeingProfiled(); | |
31 | |
32 // Called when the main message loop is started, so that automatic flushing | |
33 // of the profile data file can be done. | |
34 static void MainMessageLoopStarted(); | |
35 | |
36 // Toggle profiling on/off. | |
37 static void Toggle(); | |
38 | |
39 private: | |
40 // Do not instantiate this class. | |
41 Profiling(); | |
42 | |
43 DISALLOW_COPY_AND_ASSIGN(Profiling); | |
44 }; | |
45 | |
46 #endif // CHROME_COMMON_PROFILING_H_ | |
47 | |
OLD | NEW |