1 : // Copyright 2013 Google Inc. All Rights Reserved.
2 : //
3 : // Licensed under the Apache License, Version 2.0 (the "License");
4 : // you may not use this file except in compliance with the License.
5 : // You may obtain a copy of the License at
6 : //
7 : // http://www.apache.org/licenses/LICENSE-2.0
8 : //
9 : // Unless required by applicable law or agreed to in writing, software
10 : // distributed under the License is distributed on an "AS IS" BASIS,
11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 : // See the License for the specific language governing permissions and
13 : // limitations under the License.
14 : #ifndef SYZYGY_SAMPLER_SAMPLER_APP_H_
15 : #define SYZYGY_SAMPLER_SAMPLER_APP_H_
16 :
17 : #include "base/files/file_path.h"
18 : #include "syzygy/common/application.h"
19 :
20 m : namespace sampler {
21 :
22 : // The application class that takes care of running a profiling sampler. This
23 : // works by polling running processes and attaching a
24 : // base::win::SamplingProfiler instance to every module of interest. The output
25 : // is then shuttled to trace data files.
26 m : class SamplerApp : public common::AppImplBase {
27 m : public:
28 m : SamplerApp();
29 :
30 : // @name Implementation of the AppImplbase interface.
31 : // @{
32 m : bool ParseCommandLine(const CommandLine* command_line);
33 m : int Run();
34 : // @}
35 :
36 m : protected:
37 : // Helper function for printing a usage statement.
38 : // @param program The path to the executable.
39 : // @param message An optional message that will precede the usage statement.
40 : // @returns false.
41 m : bool PrintUsage(const base::FilePath& program,
42 m : const base::StringPiece& message);
43 m : };
44 :
45 m : } // namespace sampler
46 :
47 : #endif // SYZYGY_SAMPLER_SAMPLER_APP_H_
|