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