1geninfo(1) User Manuals geninfo(1)
2
3
4
6 geninfo - Generate tracefiles from .da files
7
9 geninfo [-h|--help] [-v|--version] [-q|--quiet]
10 [-i|--initial] [-t|--test-name test-name]
11 [-o|--output-filename filename] [-f|--follow]
12 [-b|--base-directory directory]
13 [--checksum] [--no-checksum]
14 [--compat-libtool] [--no-compat-libtool]
15 [--gcov-tool tool] [--ignore-errors errors]
16 [--no-recursion] directory
17
19 geninfo converts all GCOV coverage data files found in directory into
20 tracefiles, which the genhtml tool can convert to HTML output.
21
22 Unless the --output-filename option is specified, geninfo writes its
23 output to one file per .da file, the name of which is generated by sim‐
24 ply appending ".info" to the respective .da file name.
25
26 Note that the current user needs write access to both directory as well
27 as to the original source code location. This is necessary because some
28 temporary files have to be created there during the conversion process.
29
30 Note also that geninfo is called from within lcov, so that there is
31 usually no need to call it directly.
32
34 -b directory
35 --base-directory directory
36 Use directory as base directory for relative paths.
37
38 Use this option to specify the base directory of a build-envi‐
39 ronment when geninfo produces error messages like:
40
41 ERROR: could not read source file /home/user/project/sub‐
42 dir1/subdir2/subdir1/subdir2/file.c
43
44 In this example, use /home/user/project as base directory.
45
46 This option is required when using geninfo on projects built
47 with libtool or similar build environments that work with a base
48 directory, i.e. environments, where the current working direc‐
49 tory when invoking the compiler is not the same directory in
50 which the source code file is located.
51
52 Note that this option will not work in environments where multi‐
53 ple base directories are used. In that case repeat the geninfo
54 call for each base directory while using the --ignore-errors
55 option to prevent geninfo from exiting when the first source
56 code file could not be found. This way you can get partial cov‐
57 erage information for each base directory which can then be com‐
58 bined using the -a option.
59
60 --checksum
61 --no-checksum
62 Specify whether to generate checksum data when writing trace‐
63 files.
64
65 Use --checksum to enable checksum generation or --no-checksum to
66 disable it. Checksum generation is disabled by default.
67
68 When checksum generation is enabled, a checksum will be gener‐
69 ated for each source code line and stored along with the cover‐
70 age data. This checksum will be used to prevent attempts to com‐
71 bine coverage data from different source code versions.
72
73 If you don't work with different source code versions, disable
74 this option to speed up coverage data processing and to reduce
75 the size of tracefiles.
76
77 --compat-libtool
78 --no-compat-libtool
79 Specify whether to enable libtool compatibility mode.
80
81 Use --compat-libtool to enable libtool compatibility mode or
82 --no-compat-libtool to disable it. The libtool compatibility
83 mode is enabled by default.
84
85 When libtool compatibility mode is enabled, geninfo will assume
86 that the source code relating to a .da file located in a direc‐
87 tory named ".libs" can be found in its parent directory.
88
89 If you have directories named ".libs" in your build environment
90 but don't use libtool, disable this option to prevent problems
91 when capturing coverage data.
92
93 -f
94 --follow
95 Follow links when searching .da files.
96
97 --gcov-tool tool
98 Specify the location of the gcov tool.
99
100 -h
101 --help
102 Print a short help text, then exit.
103
104 --ignore-errors errors
105 Specify a list of errors after which to continue processing.
106
107 Use this option to specify a list of one or more classes of
108 errors after which geninfo should continue processing instead of
109 aborting.
110
111 errors can be a comma-separated list of the following keywords:
112
113 gcov: the gcov tool returned with a non-zero return code.
114
115 source: the source code file for a data set could not be found.
116
117 -i
118 --initial
119 Capture initial zero coverage data.
120
121 Run geninfo with this option on the directories containing .bb,
122 .bbg or .gcno files before running any test case. The result is
123 a "baseline" coverage data file that contains zero coverage for
124 every instrumented line. Combine this data file (using lcov -a)
125 with coverage data files captured after a test run to ensure
126 that the percentage of total lines covered is correct even when
127 not all source code files were loaded during the test.
128
129 --no-recursion
130 Use this option if you want to get coverage data for the speci‐
131 fied directory only without processing subdirectories.
132
133 -o output-filename
134 --output-filename output-filename
135 Write all data to output-filename.
136
137 If you want to have all data written to a single file (for eas‐
138 ier handling), use this option to specify the respective file‐
139 name. By default, one tracefile will be created for each pro‐
140 cessed .da file.
141
142 -q
143 --quiet
144 Do not print progress messages.
145
146 Suppresses all informational progress output. When this switch
147 is enabled, only error or warning messages are printed.
148
149 -t testname
150 --test-name testname
151 Use test case name testname for resulting data. Valid test case
152 names can consist of letters, decimal digits and the underscore
153 character ('_').
154
155 This proves useful when data from several test cases is merged
156 (i.e. by simply concatenating the respective tracefiles) in
157 which case a test name can be used to differentiate between data
158 from each test case.
159
160 -v
161 --version
162 Print version number, then exit.
163
164
165
167 /etc/lcovrc
168 The system-wide configuration file.
169
170 ~/.lcovrc
171 The per-user configuration file.
172
173 Following is a quick description of the tracefile format as used by
174 genhtml, geninfo and lcov.
175
176 A tracefile is made up of several human-readable lines of text, divided
177 into sections. If available, a tracefile begins with the testname which
178 is stored in the following format:
179
180 TN:<test name>
181
182 For each source file referenced in the .da file, there is a section
183 containing filename and coverage data:
184
185 SF:<absolute path to the source file>
186
187 Following is a list of line numbers for each function name found in the
188 source file:
189
190 FN:<line number of function start>,<function name>
191
192 Next, there is a list of execution counts for each instrumented func‐
193 tion:
194
195 FNDA:<execution count>,<function name>
196
197 This list is followed by two lines containing the number of functions
198 found and hit:
199
200 FNF:<number of functions found>
201 FNH:<number of function hit>
202
203 Then there is a list of execution counts for each instrumented line
204 (i.e. a line which resulted in executable code):
205
206 DA:<line number>,<execution count>[,<checksum>]
207
208 Note that there may be an optional checksum present for each instru‐
209 mented line. The current geninfo implementation uses an MD5 hash as
210 checksumming algorithm.
211
212 At the end of a section, there is a summary about how many lines were
213 found and how many were actually instrumented:
214
215 LH:<number of lines with a non-zero execution count>
216 LF:<number of instrumented lines>
217
218 Each sections ends with:
219
220 end_of_record
221
222 In addition to the main source code file there are sections for all
223 #included files which also contain executable code.
224
225 Note that the absolute path of a source file is generated by interpret‐
226 ing the contents of the respective .bb file (see gcov (1) for more
227 information on this file type). Relative filenames are prefixed with
228 the directory in which the .bb file is found.
229
230 Note also that symbolic links to the .bb file will be resolved so that
231 the actual file path is used instead of the path to a link. This
232 approach is necessary for the mechanism to work with the /proc/gcov
233 files.
234
235
237 Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>
238
239
241 lcov(1), genhtml(1), genpng(1), gendesc(1), gcov(1)
242
243
244
2452008-11-17 LCOV 1.7 geninfo(1)