Skip to content

File format

Mitchell Hentges edited this page Feb 6, 2017 · 20 revisions

gcda/gcno structure (Input of lcov-rs)

These are binary files. Reference

gcda and gcno files follow the same "container" format:

Offset Size (bytes) Purpose Ignored?
0 4 Magic String ("gcda" or "gcno")
4 4 Version
8 4 Stamp (used for "merging") x
12 * Contains records

Each file is contained with different types of records.

gcno records

TAG_FUNCTION[0x01000000]
Offset Size (bytes) Purpose Ignored?
0 4 Identifier x
4 4 Line # Checksum x
8 4 Config Checksum x
12 4 Fn Name Length
16 ^ Fn Name
? 4 Source Path Length
? ^ Source Path
? 4 Line #
TAG_LINES[0x01450000]

Some exceptions, see gcov header

Offset Size (bytes) Purpose Ignored?
0 4 Block # x
4 ? Contains multiple lines

Where each line is:

Offset Size (bytes) Purpose Ignored?
0 4 Line #
------ ------ If Line # == 0, then changing file: ------
4 4 Next filename's size
8 ^ Next filename

lcov "info" file (Output of lcov-rs)

This is a text file. Reference

Prefix Purpose Data Format Strategy
TN Test Name String name of test Leave blank, like lcov is doing in local tests
SF Source File Absolute path to source file
FN Function line # of fn start, fn name
FNDA Fn Data Execution count of fn, fn name
FNF # Fn Found integer
FNH # Fn Executed integer
DA Executions for some Line line #, execution count
LF # Lines Found integer
LH # Lines Executed integer
end_of_record End of Record Signifies end of data for source file Use the constant "end_of_record"
Clone this wiki locally