| Valgrind 3.3 - Advanced Debugging and Profiling for GNU/Linux applications by J. Seward, N. Nethercote, J. Weidendorfer and the Valgrind Development Team Paperback (6"x9"), 164 pages ISBN 0954612051 RRP £12.95 ($19.95) |
6.2.1 Output file
As well as printing summary information, Cachegrind also writes line-by-line cache profiling information to a user-specified file. By default this file is named ‘cachegrind.out.<pid>’. This file is human-readable, but is intended to be interpreted by the accompanying program cg_annotate, described in the next section.
Things to note about the ‘cachegrind.out.<pid>’ file:
- It is written every time Cachegrind is run, and will overwrite any existing ‘cachegrind.out.<pid>’ in the current directory (but that won't happen very often because it takes some time for process ids to be recycled).
- To use an output file name other than the default ‘cachegrind.out’, use the ‘--cachegrind-out-file’ switch.
- It can be big: ‘ls -l’ generates a file of about 350KB. Browsing a few files and web pages with a Konqueror built with full debugging information generates a file of around 15 MB.
The default ‘.<pid>’ suffix on the output file name serves two purposes. Firstly, it means you don't have to rename old log files that you don't want to overwrite. Secondly, and more importantly, it allows correct profiling with the ‘--trace-children=yes’ option of programs that spawn child processes.
| ISBN 0954612051 | Valgrind 3.3 - Advanced Debugging and Profiling for GNU/Linux applications | See the print edition |