1 : // Copyright 2012 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 : //
15 : // Declares utility function for writing coverage data as KCacheGrind
16 : // and QCacheGrind compatible .cachegrind files.
17 : //
18 : // The file format is documented here:
19 : //
20 : // http://kcachegrind.sourceforge.net/cgi-bin/show.cgi/KcacheGrindCalltreeFormat
21 :
22 : #ifndef SYZYGY_GRINDER_CACHE_GRIND_WRITER_H_
23 : #define SYZYGY_GRINDER_CACHE_GRIND_WRITER_H_
24 :
25 : #include "base/files/file_path.h"
26 : #include "syzygy/grinder/coverage_data.h"
27 :
28 m : namespace grinder {
29 :
30 : // Dumps the provided @p coverage information to an CacheGrind file.
31 : // @param coverage the summarized coverage info to be written.
32 : // @param path the path to the file to be created or overwritten.
33 : // @param file the file handle to be written to.
34 : // @returns true on success, false otherwise.
35 m : bool WriteCacheGrindCoverageFile(const CoverageData& coverage,
36 m : const base::FilePath& path);
37 m : bool WriteCacheGrindCoverageFile(const CoverageData& coverage, FILE* file);
38 :
39 m : } // namespace grinder
40 :
41 : #endif // SYZYGY_GRINDER_CACHE_GRIND_WRITER_H_
|