File: lcov.1

package info (click to toggle)
lcov 2.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,464 kB
  • sloc: perl: 27,911; sh: 7,320; xml: 6,982; python: 1,152; makefile: 597; cpp: 520; ansic: 176
file content (1920 lines) | stat: -rw-r--r-- 44,921 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
\" Define project URL
.ds lcovurl https://github.com/linux\-test\-project/lcov

.TH lcov 1 "LCOV 2.0" 2023\-05\-17 "User Manuals"
.SH NAME
lcov \- a graphical GCOV front\-end
.SH SYNOPSIS

Capture coverage data tracefile (from compiler-generated data).
.br
The lcov tracefile
.I (".info" file)
format is described in man
.B geninfo(1).

.br

.RS 3
.B lcov
.BR \-c | \-\-capture
.RS 4
.br
.RB [ \-d | \-\-directory
.IR directory ]
.RB [ \-k | \-\-kernel\-directory
.IR directory ]
.br
.RB [ \-o | \-\-output\-file
.IR tracefile ]
.RB [ \-t | \-\-test\-name
.IR testname ]
.br
.RB [ \-b | \-\-base\-directory
.IR directory ]
.br
.RB [ \-\-build\-directory
.IR directory ]
.br
.RB [ \-\-source\-directory
.IR directory ]
.br
.RB [ \-i | \-\-initial ]
.br
.RB [ \-\-all ] ]
.br
.RB [ \-\-gcov\-tool
.IR tool ]
.br
.RB [ \-\-branch\-coverage ]
.br
.RB [ \-\-mcdc\-coverage ]
.br
.RB [ \-\-demangle\-cpp
.IR [ param ] ]
.br
.RB [ \-\-checksum ]
.RB [ \-\-no\-checksum ]
.RB [ \-\-no\-recursion ]
.RB [ \-f | \-\-follow ]
.br
.RB [ \-\-sort\-input ]
.br
.RB [ \-\-compat\-libtool ]
.RB [ \-\-no\-compat\-libtool ]
.br
.RB [ \-\-msg\-log
.IR [ log_file_name ] ]
.br
.RB [ \-\-ignore\-errors
.IR errors ]
.br
.RB [\-\-expect\-message\-count
.IR message_type=expr[,message_type=expr..]]
.br
.RB [ \-\-preserve ]
.RB [ \-\-to\-package
.IR package ]
.RB [ \-\-from\-package
.IR package ]
.RB [ \-\-no\-markers ]
.RB [ \-\-external ]
.RB [ \-\-no\-external ]
.br
.RB [ \-\-compat
.IR  mode =on|off|auto]
.br
.RB [ \-\-context\-script
.IR script_file ]
.br
.RB [ \-\-criteria\-script
.IR script_file ]
.br
.RB [ \-\-resolve-\-script
.IR script_file ]
.br
.RB [ \-\-version\-script
.IR script_file ]
.br
.RB [ \-\-comment
.IR comment_string ]
.br
.RB [ \-\-large\-file
.IR regexp ]
.br
.RE
.RE

Generate tracefile (from compiler-generated data) with all counter values set to zero:
.br

.RS 3
.B lcov
.BR \-z | \-\-zerocounters
.RS 4
.br
.RB [ \-d | \-\-directory
.IR directory ]
.RB [ \-\-no\-recursion ]
.RB [ \-f | \-\-follow ]
.br
.RE
.RE

Show coverage counts recorded in previously generated tracefile:
.br

.RS 3
.B lcov
.BR \-l | \-\-list
.I tracefile
.RS 4
.br
.RB [ \-\-list\-full\-path ]
.RB [ \-\-no\-list\-full\-path ]
.br
.RE
.RE

Aggregate multiple coverage tracefiles into one:
.br

.RS 3
.B lcov
.BR \-a | \-\-add\-tracefile
.I tracefile_pattern
.RS 4
.br
.RB [ \-o | \-\-output\-file
.IR tracefile ]
.br
.RB [ \-\-prune\-tests ]
.br
.RB [ \-\-forget\-test\-names ]
.br
.RB [ \-\-map\-functions ]
.br
.RB [ \-\-branch\-coverage ]
.br
.RB [ \-\-mcdc\-coverage ]
.br
.RB [ \-\-checksum ]
.RB [ \-\-no\-checksum ]
.br
.RB [ \-\-sort\-input ]
.br
.RE

Depending on your use model, it may not be necessary to create aggregate coverage data files.
For example, if your regression tests are split into multiple suites, you may want to keep separate suite data and to compare both per-suite and aggregate results over time.
.B genhtml
allows you specify tracefiles via one or more glob patterns - which enables you
generate aggregate reports without explicitly generating aggregated trace files.
See the
.B genhtml
man page.
.RE


Generate new tracefile from existing tracefile, keeping only data from files matching pattern:
.br

.RS 3
.B lcov
.BR \-e | \-\-extract
.I tracefile pattern
.RS 4
.br
.RB [ \-o | \-\-output\-file
.IR tracefile ]
.RB [ \-\-checksum ]
.RB [ \-\-no\-checksum ]
.br
.RE
.RE

Generate new tracefile from existing tracefile, removing data from files matching pattern:
.br

.RS 3
.B lcov
.BR \-r | \-\-remove
.I tracefile pattern
.RS 4
.br
.RB [ \-o | \-\-output\-file
.IR tracefile ]
.RB [ \-\-checksum ]
.RB [ \-\-no\-checksum ]
.br
.RE
.RE

Generate new tracefile from existing tracefiles by performing set operations on coverage data:
.br

.RS 3
.B lcov
.BR \-\-intersect
.I rh_glob_pattern
.RS 4
.br
.RB [ \-o | \-\-output\-file
.IR tracefile ]
.br
lh_glob_pattern


The output will reflect
.RS 2
.I (union of files matching lh_glob_patterns)
.I intersect
.I (union of files matching rh_glob_patterns)
.RE
such that coverpoints found in both sets are merged (summed) whereas coverpoints found in only one set are dropped.
Note that branch blocks are defined to be the same if and only if their block ID and the associated branch expressions list are identical.
Functions are defined to be the same if their name and location are identical.
.RE
.RE

.RS 3
.B lcov
.BR \-\-subtract
.I rh_glob_pattern
.RS 4
.br
.RB [ \-o | \-\-output\-file
.IR tracefile ]
.br
lh_glob_pattern

The output will reflect
.RS 2
.I (union of files matching lh_glob_patterns)
.I subtract
.I (union of files matching rh_glob_patterns)
.RE
such that coverpoints found only in the set on the left will be retained and all others are dropped.
.RE

.RE



Summarize tracefile content:
.br

.RS 3
.B lcov
.BR \-\-summary
.I tracefile
.RE

Print version or help message and exit:
.br

.RS 3
.B lcov
.RB [ \-h | \-\-help ]
.RB [ \-\-version ]
.RE

Common lcov options - supported by all the above use cases:
.br

.RS 3
.B lcov
.RB [ \-\-keep\-going ]
.br
.RS 5
.RB [ \-\-filter
.IR type  ]
.br
.br
.RB [ \-q | \-\-quiet ]
.br
.RB [ \-v | \-\-verbose ]
.br
.RB [ \-\-comment
.IR comment_string ]
.br
.RB [ \-\-debug ]
.br
.RB [ \-\-parallel | -j
.IR [integer] ]
.br
.RB [ \-\-memory
.IR integer_num_Mb ]
.br
.RB [ \-\-tempdir
.IR dirname ]
.br
.RB [ \-\-branch\-coverage ]
.br
.RB [ \-\-mcdc\-coverage ]
.br
.RB [ \-\-config\-file
.IR config\-file ]
.RB [ \-\-rc
.IR keyword = value ]
.br
.RB [ \-\-profile
.IR [ profile\-file ] ]
.br
.RB [ \-\-include
.IR glob_pattern ]
.br
.RB [ \-\-exclude
.IR glob_pattern ]
.br
.RB [ \-\-erase\-functions
.IR regexp_pattern ]
.br
.RB [ \-\-substitute
.IR regexp_pattern ]
.br
.RB [ \-\-omit\-lines
.IR regexp_pattern ]
.br
.RB [ \-\-fail\-under\-branches
.IR percentage ]
.br
.RB [ \-\-fail\-under\-lines
.IR percentage ]
.br
.RE
.RE

.SH DESCRIPTION
.B lcov
is a graphical front\-end for GCC's coverage testing tool gcov. It collects
line, function and branch coverage data for multiple source files and creates
HTML pages containing the source code annotated with coverage information.
It also adds overview pages for easy navigation within the file structure.

Use
.B lcov
to collect coverage data and
.B genhtml
to create HTML pages. Coverage data can either be collected from the
currently running Linux kernel or from a user space application. To do this,
you have to complete the following preparation steps:

For Linux kernel coverage:
.RS
Follow the setup instructions for the gcov\-kernel infrastructure:
.I https://docs.kernel.org/dev-tools/gcov.html
.br
.RE

For user space application coverage:
.RS 3
Compile the application with GCC using the options
"\-fprofile\-arcs" and "\-ftest\-coverage" or "\-\-coverage".
.RE

Please note that this man page refers to the output format of
.B lcov
as ".info file" or "tracefile" and that the output of GCOV
is called ".da file".

Also note that when printing percentages, 0% and 100% are only printed when
the values are exactly 0% and 100% respectively. Other values which would
conventionally be rounded to 0% or 100% are instead printed as nearest
non-boundary value. This behavior is in accordance with that of the
.BR gcov (1)
tool.

By default,
.B lcov
and related tools generate and collect line and function coverage data.
Branch data is not collected or displayed by default; all tools support the
.B\ \--branch\-coverage
and
.B \-\-mdcd\-coverage
options to enable branch and MC/DC coverage, respectively - or you can permanently enable branch coverage by adding the appropriate
settings to your personal, group, or site lcov configuration file.  See man
.B lcovrc(5)
for details.

.SH OPTIONS

In general, (almost) all
.B lcov
options can also be specified in a configuration file - see man
.B lcovrc(5)
for details.


.B \-a
.I tracefile_pattern
.br
.B \-\-add\-tracefile
.I tracefile_pattern
.br
.RS
Add contents of all files matching glob pattern
.IR tracefile_pattern.

Specify several tracefiles using the \-a switch to combine the coverage data
contained in these files by adding up execution counts for matching test and
filename combinations.

The result of the add operation will be written to stdout or the tracefile
specified with \-o.

Only one of  \-z, \-c, \-a, \-e, \-r, \-l or \-\-summary may be
specified at a time.

.RE

.B \-b
.I directory
.br
.B \-\-base\-directory
.I directory
.br
.RS
.RI "Use " directory
as base directory for relative paths.

Use this option to specify the base directory of a build\-environment
when lcov produces error messages like:

.RS
ERROR: could not read source file /home/user/project/subdir1/subdir2/subdir1/subdir2/file.c
.RE

In this example, use /home/user/project as base directory.

This option is required when using lcov on projects built with libtool or
similar build environments that work with a base directory, i.e. environments,
where the current working directory when invoking the compiler is not the same
directory in which the source code file is located.

Note that this option will not work in environments where multiple base
directories are used. In that case use configuration file setting
.B geninfo_auto_base=1
(see man
.BR lcovrc (5)
).

.RE

.B \-\-build\-directory
.I build_directory
.br
.RS
search for .gcno data files from build_directory rather than
adjacent to the corresponding .gcda file.

See man
.BR geninfo (1))
for details.


.RE
.BI "\-\-source\-directory " dirname
.RS
Add 'dirname' to the list of places to look for source files.
.br

For relative source file paths listed in
.I e.g.
paths found in
.IR tracefile,
or found in gcov output during
.I \-\-capture
\- possibly after substitutions have been applied -
.B lcov
 will first look for the path from 'cwd' (where genhtml was
invoked) and
then from each alternate directory name in the order specified.
The first location matching location is used.

This option can be specified multiple times, to add more directories to the source search path.


.RE
.B \-c
.br
.B \-\-capture
.br
.RS
Capture runtime coverage data.

By default captures the current kernel execution counts and writes the
resulting coverage data to the standard output. Use the \-\-directory
option to capture counts for a user space program.

The result of the capture operation will be written to stdout or the tracefile
specified with \-o.

When combined with the
.BR \-\-all
flag, both runtime and compile-time coverage will be extracted in one step.
See the description of the
.BR \-\-initial
flag, below.

See man
.BR geninfo (1))
for more details about the capture process and available options and parameters.


Only one of  \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
specified at a time.
.RE

.B \-\-branch\-coverage
.RS
.br
Collect and/or retain branch coverage data.

This is equivalent to using the option "\-\-rc branch_coverage=1"; the option was added to better match the genhml interface.

.RE

.B \-\-mcdc\-coverage
.RS
.br
Collect retain MC/DC data.

This is equivalent to using the option "\-\-rc mcdc_coverage=1".
MC/DC coverage is supported for GCC versions 14.2 and higher, or
LLVM 18.1 and higher.
.br
See
.I llvm2lcov \-\-help
for details on MC/DC data capture in LLVM.

.br
See the MC/DC section of man
.B genhtml(1)
for more details

.RE

.B \-\-checksum
.br
.B \-\-no\-checksum
.br
.RS
Specify whether to generate checksum data when writing tracefiles and/or to
verify matching checksums when combining trace files.

Use \-\-checksum to enable checksum generation or \-\-no\-checksum to
disable it. Checksum generation is
.B disabled
by default.

When checksum generation is enabled, a checksum will be generated for each
source code line and stored along with the coverage data. This checksum will
be used to prevent attempts to combine coverage data from different source
code versions.

If you don't work with different source code versions, disable this option
to speed up coverage data processing and to reduce the size of tracefiles.

Note that this options is somewhat subsumed by the
.B \-\-version\-script
option - which does something similar, but at the 'whole file' level.
.RE

.B \-\-compat
.IR mode = value [, mode = value ,...]
.br
.RS
Set compatibility mode.

Use \-\-compat to specify that lcov should enable one or more compatibility
modes when capturing coverage data. You can provide a comma-separated list
of mode=value pairs to specify the values for multiple modes.

Valid
.I values
are:

.B on
.RS
Enable compatibility mode.
.RE
.B off
.RS
Disable compatibility mode.
.RE
.B auto
.RS
Apply auto-detection to determine if compatibility mode is required. Note that
auto-detection is not available for all compatibility modes.
.RE

If no value is specified, 'on' is assumed as default value.

Valid
.I modes
are:

.B libtool
.RS
Enable this mode if you are capturing coverage data for a project that
was built using the libtool mechanism. See also
\-\-compat\-libtool.

The default value for this setting is 'on'.

.RE
.B hammer
.RS
Enable this mode if you are capturing coverage data for a project that
was built using a version of GCC 3.3 that contains a modification
(hammer patch) of later GCC versions. You can identify a modified GCC 3.3
by checking the build directory of your project for files ending in the
extension '.bbg'. Unmodified versions of GCC 3.3 name these files '.bb'.

The default value for this setting is 'auto'.

.RE
.B split_crc
.RS
Enable this mode if you are capturing coverage data for a project that
was built using a version of GCC 4.6 that contains a modification
(split function checksums) of later GCC versions. Typical error messages
when running lcov on coverage data produced by such GCC versions are
\'out of memory' and 'reached unexpected end of file'.

The default value for this setting is 'auto'
.RE

.RE

.B \-\-compat\-libtool
.br
.B \-\-no\-compat\-libtool
.br
.RS
Specify whether to enable libtool compatibility mode.

Use \-\-compat\-libtool to enable libtool compatibility mode or \-\-no\-compat\-libtool
to disable it. The libtool compatibility mode is
.B enabled
by default.

When libtool compatibility mode is enabled, lcov will assume that the source
code relating to a .da file located in a directory named ".libs" can be
found in its parent directory.

If you have directories named ".libs" in your build environment but don't use
libtool, disable this option to prevent problems when capturing coverage data.
.RE

.B \-\-config\-file
.I config\-file
.br
.RS
Specify a configuration file to use.
See man
.B lcovrc(5)
for details of the file format and options.  Also see the
.I config_file
entry in the same man page for details on how to include one config file into
another.

When this option is specified, neither the system\-wide configuration file
/etc/lcovrc, nor the per\-user configuration file ~/.lcovrc is read.

This option may be useful when there is a need to run several
instances of
.B lcov
with different configuration file options in parallel.

Note that this option must be specified in full - abbreviations are not supported.

.RE

.B \-\-profile
.I [ profile\-data\-file ]
.br
.RS
Tell the tool to keep track of performance and other configuration data.
If the optional
.I profile\-data\-file
is not specified, then the profile data is written to a file named with the same
basename as the
.I \-\-output\-filename, with suffix
.I ".json"
appended.

.RE

Only one of  \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
specified at a time.
.RE

.B \-d
.I directory
.br
.B \-\-directory
.I  directory
.br
.RS
Use .da files in
.I directory
instead of kernel.

If you want to work on coverage data for a user space program, use this
option to specify the location where the program was compiled (that's
where the counter files ending with .da will be stored).

Note that you may specify this option more than once.
.RE

.B \-\-exclude
.I pattern
.br
.RS
Exclude source files matching
.IR pattern .

Use this switch if you want to exclude coverage data for a particular set
of source files matching any of the given patterns. Multiple patterns can be
specified by using multiple
.B --exclude
command line switches. The
.I patterns
will be interpreted as shell wildcard patterns (note that they may need to be
escaped accordingly to prevent the shell from expanding them first).

Note: The pattern must be specified to match the
.B absolute
path of each source file.
If you specify a pattern which does not seem to be correctly applied - files that you expected to be excluded still appear in the output - you can look for warning messages in the log file.
.B lcov
will emit a warning for every pattern which is not applied at least once.

Can be combined with the
.B --include
command line switch. If a given file matches both the include pattern and the
exclude pattern, the exclude pattern will take precedence.
.RE

.B \-\-erase\-functions
.I regexp
.br
.RS
Exclude coverage data from lines which fall within a function whose name matches the supplied regexp.  Note that this is a mangled or demangled name, depending on whether the \-\-demangle\-cpp option is used or not.

Note that this option requires that you use a gcc version which is new enough to support function begin/end line reports or that you configure the tool to derive the required dta - see the
.BI derive_function_end_line
discussion in man
.B lcovrc(5).

.RE
.B \-\-substitute
.I regexp_pattern
.br
.RS
Apply Perl regexp
.IR regexp_pattern
to source file names found during processing.  This is useful, for example, when the path name reported by gcov does not match your source layout and the file is not found, or in more complicated environments where the build directory structure does not match the source code layout or the layout in the projects's revision control system.

Use this option in situations where geninfo cannot find the correct
path to source code files of a project. By providing a
.I regexp_pattern
in Perl regular expression format (see man
.BR perlre (1)
), you can instruct geninfo to
remove or change parts of the incorrect source path.
Also see the
.B \-\-resolve\-script
option.

One or more
.I \-\-substitution
patterns and/or a
.I \-\-resolve-script
may be specified.  When multiple patterns are specified, they are applied in the order specified, substitution patterns first followed by the resolve callback.
The file search order is:
.RS
.IP 1. 3
Look for file name (unmodified).
.br
If the file exits: return it.
.PP
.IP 2. 3
Apply all substitution patterns in order - the result of the first pattern is used as the input of the second pattern, and so forth.
.br
If a file corresponding to the resulting name exists:  return it.
.PP
.IP 3. 3
Apply the 'resolve' callback to the final result of pattern substitutions.
.br
If a file corresponding to the resulting name exists:  return it.
.PP
.IP 4. 3
Otherwise:  return original (unmodified) file name.
.br
Depending on context, the unresolved file name may or may not result in an error.
.RE

Substitutions are used in multiple contexts by lcov/genhtml/geninfo:
.RS
.IP \-  3
during
.I \-\-capture,
applied to source file names found in gcov-generated coverage data files (see man
.B gcov(1)
).
.PP

.IP \- 3
during
.I \-\-capture,
applied to alternate
.I \-\-build\-dir
paths, when looking for the
.I .gcno
(compile time) data file corresponding to some
.I .gcda
(runtime) data file.
.PP

.IP \- 3
applied to file names found in lcov data files (".info" files) -
.I e.g.,
during lcov data aggregation or HTML and text report generation.
.br
For example, substituted names are used to find source files for
text-based filtering (see the
.I \-\-filter
section, below) and are passed to
.I \-\-version\-script, \-\-annotate\-script,
and
.I \-criteria\-script
callbacks.
.PP

.IP \- 3
applied to file names found in the
.I \-\-diff\-file
passed to genhtml.
.PP
.RE


.B Example:
.br

1. When geninfo reports that it cannot find source file
.br

    /path/to/src/.libs/file.c
.br

while the file is actually located in
.br

    /path/to/src/file.c
.br

use the following parameter:
.br

    \-\-substitute 's#/.libs##g'

This will remove all "/.libs" strings from the path.

2. When geninfo reports that it cannot find source file
.br

    /tmp/build/file.c
.br

while the file is actually located in
.br

    /usr/src/file.c
.br

use the following parameter:
.br

    \-\-substitute 's#/tmp/build#/usr/src#g'
.br

This will change all "/tmp/build" strings in the path to "/usr/src".
.PP

.RE

.B \-\-omit\-lines
.I regexp
.br
.RS
Exclude coverage data from lines whose content matches
.IR regexp .

Use this switch if you want to exclude line and branch coverage data for some particular constructs in your code (e.g., some complicated macro).  Multiple patterns can be
specified by using multiple
.B --omit\-lines
command line switches. The
.I regexp
will be interpreted as perl regular expressions (note that they may need to be
escaped accordingly to prevent the shell from expanding them first).
If you want the pattern to explicitly match from the start or end of the line, your regexp should start and/or end with "^" and/or "$".

Note that the
.B lcovrc
config file setting
.B lcov_excl_line = regexp
is similar to
.B \-\-omit\-lines.
.B \-\-omit\-lines
is useful if there are multiple teams each of which want to exclude certain patterns.
.B \-\-omit\-lines
is additive and can be specified across multiple config files whereas each call to
.B lcov_excl_line
overrides the previous value - and thus teams must coordinate.

.RE

.B \-\-external
.br
.B \-\-no\-external
.br
.RS
Specify whether to capture coverage data for external source files.

External source files are files which are not located in one of the directories
specified by
.I \-\-directory
or
.I \-\-base\-directory.
Use
.I \-\-external
to include
coverpoints in external source files while capturing coverage data or
.I \-\-no\-external
to exclude them.
If your
.I \-\-directory
or
.I \-\-base\-directory
path contains a soft link, then actual target directory is not considered to be
"internal" unless the
.I \-\-follow
option is used.

The
.I \-\-no\-external
option is somewhat of a blunt instrument;  the
.I \-\-exclude
and
.I \-\-include
options provide finer grained control over which coverage data is and is not
included if your project structure is complex and/or
.I \-\-no\-external
does not do what you want.

Data for external source files is
.B included
by default.

.RE

.B \-\-forget\-test\-names
.br
.RS
If non\-zero, ignore testcase names in .info file -
.I i.e.,
treat all coverage data as if it came from the same testcase.
This may improve performance and reduce memory consumption if user does
not need per-testcase coverage summary in coverage reports.

This option can also be configured permanently using the configuration file
option
.IR forget_testcase_names .

.RE

.B \-\-prune\-tests
.br
.RS
Determine list of unique tracefiles.

Use this option to determine a list of unique tracefiles from the list
specified by
.BR \-\-add\-tracefile .
A tracefile is considered to be unique if it is the only tracefile that:

.RS

.IP 1. 3
contains data for a specific source file
.br
.PP
.IP 2. 3
contains data for a specific test case name
.br
.PP
.IP 3. 3
contains non-zero coverage data for a specific line, function or branch
.br
.PP

.RE

Note that the list of retained files may depend on the order they are processed.  For example, if
.I A
and
.I B
contain identical coverage data, then the first one we see will be retained and the second will be pruned.
The file processing order is nondeterministic when the
.BR \-\-parallel
option is used - implying that the pruned result may differ from one execution to the next in this case.

.BR \-\-prune\-tests must be specified together with
.BR \-\-add\-tracefile .
When specified,
.B lcov
will emit the list of unique files rather than combined tracefile data.
.br

.RE

.B \-\-map\-functions
.br
.RS
List tracefiles with non-zero coverage for each function.
.br

Use this option to determine the list of tracefiles that contain non-zero
coverage data for each function from the list of tracefiles specified by
.BR \-\-add\-tracefile .

This option must be specified together with
.BR \-\-add\-tracefile .
When specified,
.B lcov
will emit the list of functions and associated tracefiles rather than combined tracefile data.
.br

.RE
.B \-\-context\-script
.I script
.br
.RS

Use
.I script
to collect additional tool execution context information - to aid in
infrastructure debugging and/or tracking.

See the genhtml man page for more details on the context script.

.br

.RE
.B \-\-criteria\-script
.I script
.br
.RS

Use
.I script
to test for coverage acceptance criteria.

See the genhtml man page for more details on the criteria script.
Note that lcov does not keep track of date and owner information (see the
.I \-\-annotate\-script
entry in the genhtml man page) - so this information is not passed to the lcov callback.

.br

.RE
.B \-\-resolve\-script
.I script
.br
.RS
Use
.I script
to find the file path for some source file which appears in
an input data file if the file is not found after applying
.I \-\-substitute
patterns and searching the
.I \-\-source\-directory
list.  This option is equivalent to the
.B resolve_script
config file option. See man
.B lcovrc(5)
for details.
.RE

.RE
.B \-\-version\-script
.I script
.br
.RS

Use
.I script
to get a source file's version ID from revision control when
extracting data and to compare version IDs for the purpose of error checking when merging .info files.
.br

See the genhtml man page for more details on the version script.

.br

.RE
.B \-\-comment
.I comment_string
.br
.RS

Append
.I comment_string
to list of comments emitted into output result file.
This option may be specified multiple times.
Comments are printed at the top of the file, in the order they were specified.

Comments may be useful to document the conditions under which the trace file was
generated:  host, date, environment,
.I etc.

Note that this option has no effect for lcov overations which do not write an
output result file:
.I \-\-list
.I \-\-summary,
.I \-\-prune\-tests,
and
.I \-\-map\-functions.

See the
.B geninfo
man page for a description of the comment format in the result file.

.RE

.B \-e
.I tracefile
.I pattern
.br
.B \-\-extract
.I tracefile
.I pattern
.br
.RS
Extract data from
.IR tracefile .

Use this switch if you want to extract coverage data for only a particular
set of files from a tracefile. Additional command line parameters will be
interpreted as shell wildcard patterns (note that they may need to be
escaped accordingly to prevent the shell from expanding them first).
Every file entry in
.I tracefile
which matches at least one of those patterns will be extracted.

Note: The pattern must be specified to match the
.B absolute
path of each source file.

The result of the extract operation will be written to stdout or the tracefile
specified with \-o.

Only one of  \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
specified at a time.
.RE

.B \-f
.br
.B \-\-follow
.br
.RS
Follow links when searching for .da files.
.RE

.BI "\-\-large\-file "
.I regexp
.RS
See the
.I \-\-large\-file
section of man
.B geninfo(1)
for details.
.RE

.B \-\-from\-package
.I package
.br
.RS
Use .da files in
.I package
instead of kernel or directory.

Use this option if you have separate machines for build and test and
want to perform the .info file creation on the build machine. See
\-\-to\-package for more information.
.RE

.B \-\-sort\-input
.br
.RS
Specify whether to sort file names before capture and/or aggregation.
Sorting reduces certain types of processing order-dependent output differences.
See the
.BI sort_input
section in
man
.B lcovrc(5).

.RE

.B \-\-gcov\-tool
.I tool
.br
.RS
Specify the location of the gcov tool.

See the geninfo man page for more details.
.RE

.B \-h
.br
.B \-\-help
.br
.RS
Print a short help text, then exit.
.RE

.B \-\-include
.I pattern
.br
.RS
Include source files matching
.IR pattern .

Use this switch if you want to include coverage data for only a particular set
of source files matching any of the given patterns. Multiple patterns can be
specified by using multiple
.B --include
command line switches. The
.I patterns
will be interpreted as shell wildcard patterns (note that they may need to be
escaped accordingly to prevent the shell from expanding them first).

Note: The pattern must be specified to match the
.B absolute
path of each source file.
.br

If you specify a pattern which does not seem to be correctly applied - files that you expected to be included in the output do not appear - lcov will generate an error message of type 'unused'.  See the \-\-ignore\-errors option for how to make lcov ignore the error or turn it into a warning.
.RE

.B \-\-msg\-log
.I [ log_file_name ]
.br
.RS
Specify location to store error and warning messages (in addition to writing to STDERR).
If
.I log_file_name
is not specified, then default location is used.
.RE

.B \-\-ignore\-errors
.I errors
.br
.RS
Specify a list of errors after which to continue processing.

Use this option to specify a list of one or more classes of errors after which
lcov should continue processing instead of aborting.
Note that the tool will generate a warning (rather than a fatal error) unless you ignore the error two (or more) times:
.br
.RS
lcov ... --ignore-errors source,source ...
.RE

.I errors
can be a comma\-separated list of the following keywords:

.IP branch: 3
branch ID (2nd field in the .info file 'BRDA' entry) does not follow expected integer sequence.
.PP

.IP callback: 3
Version script error.
.PP

.IP child: 3
child process returned non-zero exit code during
.I \-\-parallel
execution.  This typically indicates that the child encountered an error:  see the log file immediately above this message.
In contrast:  the
.B parallel
error indicates an unexpected/unhandled exception in the child process - not a 'typical' lcov error.
.PP

.IP corrupt: 3
corrupt/unreadable file found.
.PP

.IP count: 3
An excessive number of messages of some class have been reported - subsequent messages of that type will be suppressed.
The limit can be controlled by the 'max_message_count' variable. See man
.B lcovrc(5).
.PP

.IP deprecated: 3
You are using a deprecated option.
This option will be removed in an upcoming release - so you should change your
scripts now.
.PP

.IP empty: 3
the .info data file is empty (e.g., because all the code was 'removed' or excluded.
.PP

.IP excessive: 3
your coverage data contains a suspiciously large 'hit' count which is unlikely
to be correct - possibly indicating a bug in your toolchain.
See the
.I excessive_count_threshold
section in man
.B lcovrc(5)
for details.
.PP

.IP fork: 3
Unable to create child process during
.I \-\-parallel
execution.
.br
If the message is ignored (
.I \-\-ignore\-errors fork
), then genhtml
will wait a brief period and then retry the failed execution.
.br
If you see continued errors, either turn off or reduce parallelism, set a memory limit, or find a larger server to run the task.
.PP

.IP format: 3
Unexpected syntax or value found in .info file - for example, negative number or
zero line number encountered.
.PP

.IP gcov: 3
the gcov tool returned with a non\-zero return code.
.PP

.IP graph: 3
the graph file could not be found or is corrupted.
.PP

.IP inconsistent: 3
your coverage data is internally inconsistent:  it makes two or more mutually
exclusive claims.  For example, some expression is marked as both an exception branch and not an exception branch.  (See man
.B genhtml(1)
for more details.
.PP

.IP internal: 3
internal tool issue detected.  Please report this bug along with a testcase.
.PP

.IP mismatch: 3
Inconsistent entries found in trace file:


.RS 3
.IP \(bu 3
branch expression (3rd field in the .info file 'BRDA' entry) of merge data does not match, or
.PP
.IP \(bu 3
function execution count (FNDA:...) but no function declaration (FN:...).
.PP
.RE
.PP

.IP missing: 3
File does not exist or is not readable.
.PP

.IP negative: 3
negative 'hit' count found.

Note that negative counts may be caused by a known GCC bug - see

  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68080

and try compiling with "-fprofile-update=atomic". You will need to recompile, re-run your tests, and re-capture coverage data.
.PP

.IP package: 3
a required perl package is not installed on your system.  In some cases, it is possible to ignore this message and continue - however, certain features will be disabled in that case.
.PP

.IP parallel: 3
various types of errors related to parallelism -
.I i.e.,
a child process died due to an error.  The corresponding error message appears in the log file immediately before the
.I parallel
error.

If you see an error related to parallel execution that seems invalid, it may be a good idea to remove the \-\-parallel flag and try again.  If removing the flag leads to a different result, please report the issue (along with a testcase) so that the tool can be fixed.
.PP

.IP parent: 3
the parent process exited while child was active during
.I \-\-parallel
execution.  This happens when the parent has encountered a fatal error -
.I e.g.
an error in some other child which was not ignored.  This child cannot continue working without its parent - and so will exit.
.PP

.IP range: 3
Coverage data refers to a line number which is larger than the number of
lines in the source file.  This can be caused by a version mismatch or
by an issue in the
.I gcov
data.
.PP

.IP source: 3
the source code file for a data set could not be found.
.PP

.IP unsupported: 3
the requested feature is not supported for this tool configuration.  For example, function begin/end line range exclusions use some GCOV features that are not available in older GCC releases.
.PP

.IP unused: 3
the include/exclude/erase/omit/substitute pattern did not match any file pathnames.
.PP

.IP usage: 3
unsupported usage detected - e.g. an unsupported option combination.

.PP

.IP utility: 3
a tool called during processing returned an error code (e.g., 'find' encountered an unreadable directory).
.PP

.IP version: 3
revision control IDs of the file which we are trying to merge are not the same - line numbering and other information may be incorrect.
.PP

Also see man
.B lcovrc(5)
for a discussion of the 'max_message_count' parameter which can be used to control the number of warnings which are emitted before all subsequent messages are suppressed.  This can be used to reduce log file volume.

.RE

.BI "\-\-expect\-message\-count message_type:expr[,message_type:expr]"
.RS
Give
.B lcov
a constraint on the number of messages of one or more types which are expected to
be produced during execution.  If the constraint is not true, then generate an
error of type
.I "count"
(see above).

See man
.B genhtml(1)
for more details about the flag, as well as the
.I "expect_message_count"
section in man
.B lcovrc(5)
for a description of the equivalent configuration file option.
.RE

.BI "\-\-keep\-going "
.RS
Do not stop if error occurs: attempt to generate a result, however flawed.

This command line option corresponds to the
.I stop_on_error [0|1]
lcovrc option.  See man
.B lcovrc(5)
for more details.

.RE
.BI "\-\-preserve "
.RS
Preserve intermediate data files generated by various steps in the tool - e.g., for debugging.  By default, these files are deleted.

.RE
.BI "\-\-filter "
.I filters
.RS
Specify a list of coverpoint filters to apply to input data.
See the genhtml man page for details.


.RE
.BI "\-\-demangle\-cpp " [param]
.RS
Demangle C++ function names.  See the genhtml man page for details.


.RE

.B \-i
.br
.B \-\-initial
.RS
Capture initial zero coverage data - i.e., from the compile-time '.gcno' data
files.
Also see the
.B \-\-all
flag, which tells the tool to capture both compile-time ('.gcno') and runtime
('.gcda') data at the same time.

Run lcov with \-c and this option on the directories containing .bb, .bbg
or .gcno files before running any test case. The result is a "baseline"
coverage data file that contains zero coverage for every instrumented line.
Combine this data file (using lcov \-a) with coverage data files captured
after a test run to ensure that the percentage of total lines covered is
correct even when not all source code files were loaded during the test.

Recommended procedure when capturing data for a test case:

1. create baseline coverage data file
.RS
# lcov \-c \-i \-d appdir \-o app_base.info
.br

.RE
2. perform test
.RS
# appdir/test
.br

.RE
3. create test coverage data file
.RS
# lcov \-c \-d appdir \-o app_test.info
.br

.RE
4. combine baseline and test coverage data
.RS
# lcov \-a app_base.info \-a app_test.info \-o app_total.info
.br
.RE

The above 4 steps are equivalent to
.br
.RS
# lcov \-\-capture \-\-all -o app_total.info \-d appdir
.RE

The combined compile- and runtime data will produce a different result than
capturing runtime data alone if your project contains some compilation units
which are not used in any of your testcase executables or shared libraries -
that is, there are some '.gcno' (compile time) data files that do not
have matching '.gcda' (runtime) data files.
In that case, the runtime-only report will not contain any coverpoints from
the unused files, whereas those coverpoints will appear (with all zero 'hit'
counts) in the combined report.

The
.BR \-\-initial
flag is ignored except in
.BR \-\-capture
mode.  The
.BR \-\-all
flag is ignored if the
.BR \-\-initial
flag is specified.
.RE

.B \-k
.I subdirectory
.br
.B \-\-kernel\-directory
.I subdirectory
.br
.RS
Capture kernel coverage data only from
.IR subdirectory .

Use this option if you don't want to get coverage data for all of the
kernel, but only for specific subdirectories. This option may be specified
more than once.

Note that you may need to specify the full path to the kernel subdirectory
depending on the version of the kernel gcov support.
.RE

.B \-l
.I tracefile
.br
.B \-\-list
.I tracefile
.br
.RS
List the contents of the
.IR tracefile .

Only one of  \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
specified at a time.
.RE

.B \-\-list\-full\-path
.br
.B \-\-no\-list\-full\-path
.br
.RS
Specify whether to show full paths during list operation.

Use \-\-list\-full\-path to show full paths during list operation
or \-\-no\-list\-full\-path to show shortened paths. Paths are
.B shortened
by default.
.RE

.B \-\-no\-markers
.br
.RS
Use this option if you want to get coverage data without regard to exclusion
markers in the source code file. See
.BR "geninfo " (1)
for details on exclusion markers.
.RE

.B \-\-no\-recursion
.br
.RS
Use this option if you want to get coverage data for the specified directory
only without processing subdirectories.
.RE

.B \-o
.I tracefile
.br
.B \-\-output\-file
.I tracefile
.br
.RS
Write data to
.I tracefile
instead of stdout.

Specify "\-" as a filename to use the standard output.

By convention, lcov\-generated coverage data files are called "tracefiles" and
should have the filename extension ".info".
.RE

.B \-v
.br
.B \-\-verbose
.RS
Increment informational message verbosity.  This is mainly used for script and/or flow debugging - e.g., to figure out which data file are found, where.
Also see the \-\-quiet flag.

Messages are sent to stdout unless there is no output file (i.e., if the coverage data is written to stdout rather than to a file) and to stderr otherwise.

.RE
.B \-q
.br
.B \-\-quiet
.RS
Decrement informational message verbosity.

Decreased verbosity will suppress 'progress' messages for example - while error and warning messages will continue to be printed.

.RE
.B \-\-debug
.RS
Increment 'debug messages' verbosity.  This is useful primarily to developers who want to enhance the lcov tool suite.

.RE

.BI "\-\-parallel "
.I [ integer ]
.br
.BI "\-j "
.I [ integer ]
.RS
Specify parallelism to use during processing (maximum number of forked child processes).  If the optional integer parallelism parameter is zero or is missing, then use to use up the number of cores on the machine.  Default is to use a single process (no parallelism).
.br
Also see the
.I memory, memory_percentage, max_fork_fails
and
.I fork_fail_timeout
entries in man
.B lcovrc(5).

.RE
.BI "\-\-memory "
.I integer
.RS
Specify the maximum amount of memory to use during parallel processing, in Mb.  Effectively, the process will not fork() if this limit would be exceeded.  Default is 0 (zero) - which means that there is no limit.

This option may be useful if the compute farm environment imposes strict limits on resource utilization such that the job will be killed if it tries to use too many parallel children - but the user does now know a priori what the permissible maximum is.  This option enables the tool to use maximum parallelism - up to the limit imposed by the memory restriction.

The configuration file
.I memory_percentage
option provided another way to set the maximum memory consumption.
See man
.B lcovrc(5)
for details.

.RE

.B \-\-rc
.IR keyword = value
.br
.RS
Override a configuration directive.

Use this option to specify a
.IR keyword = value
statement which overrides the corresponding configuration statement in
the lcovrc configuration file. You can specify this option more than once
to override multiple configuration statements.
See man
.BR lcovrc (5)
for a list of available keywords and their meaning.
.RE

.B \-r
.I tracefile
.I pattern
.br
.B \-\-remove
.I tracefile
.I pattern
.br
.RS
Remove data from
.IR tracefile .

Use this switch if you want to remove coverage data for a particular
set of files from a tracefile. Additional command line parameters will be
interpreted as shell wildcard patterns (note that they may need to be
escaped accordingly to prevent the shell from expanding them first).
Every file entry in
.I tracefile
which matches at least one of those patterns will be removed.

Note: The pattern must be specified to match the
.B absolute
path of each source file.

The result of the remove operation will be written to stdout or the tracefile
specified with \-o.

Only one of  \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
specified at a time.
.RE

.B \-\-summary
.I tracefile
.br
.RS
Show summary coverage information for the specified tracefile.

Note that you may specify this option more than once.

Only one of  \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
specified at a time.
.RE

.B \-\-fail\-under\-branches
.I percentage
.br
.RS
Use this option to tell lcov to exit with a status of 1 if the total
branch coverage is less than
.I percentage.
.RE

.B \-\-fail\-under\-lines
.I percentage
.br
.RS
Use this option to tell lcov to exit with a status of 1 if the total
line coverage is less than
.I percentage.
.RE

.B \-t
.I testname
.br
.B \-\-test\-name
.I testname
.br
.RS
Specify test name to be stored in the tracefile.

This name identifies a coverage data set when more than one data set is merged
into a combined tracefile (see option \-a).

Valid test names can consist of letters, decimal digits and the underscore
character ("_").
.RE

.B \-\-to\-package
.I package
.br
.RS
Store .da files for later processing.

Use this option if you have separate machines for build and test and
want to perform the .info file creation on the build machine. To do this,
follow these steps:

On the test machine:
.RS
.br
\- run the test
.br
\- run lcov \-c [\-d directory] \-\-to-package
.I file
.br
\- copy
.I file
to the build machine
.RE
.br

On the build machine:
.RS
.br
\- run lcov \-c \-\-from-package
.I file
[\-o and other options]
.RE
.br

This works for both kernel and user space coverage data. Note that you might
have to specify the path to the build directory using \-b with
either \-\-to\-package or \-\-from-package. Note also that the package data
must be converted to a .info file before recompiling the program or it will
become invalid.
.RE

.B \-\-version
.br
.RS
Print version number, then exit.
.RE

.B \-z
.br
.B \-\-zerocounters
.br
.RS
Reset all execution counts to zero.

By default tries to reset kernel execution counts. Use the \-\-directory
option to reset all counters of a user space program.

Only one of  \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
specified at a time.
.RE

.B \-\-tempdir
.I dirname
.br
.RS
Write temporary and intermediate data to indicated directory.  Default is "/tmp".
.RE

.SH FILES

.I /etc/lcovrc
.RS
The system\-wide configuration file.
.RE

.I ~/.lcovrc
.RS
The per\-user configuration file.
.RE

.SH AUTHOR
Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>

Henry Cox <henry.cox@mediatek.com>
.RS
Filtering, error management, parallel execution sections.
.RE

.SH SEE ALSO
.BR lcovrc (5),
.BR genhtml (1),
.BR geninfo (1),
.BR genpng (1),
.BR gendesc (1),
.BR gcov (1)
.br

.I \*[lcovurl]
.br