diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-03-30 21:45:23 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-04-28 20:46:49 +0200 |
commit | 39d80300b3c769c3a7805a46ee5facc6adf1a4d0 (patch) | |
tree | 2c8609ca844a90b8006e39f11c2735a91fe73dff /gcc/gcov-io.h | |
parent | 68a4673fe25e067df74373a45180d80c70da102f (diff) | |
download | gcc-39d80300b3c769c3a7805a46ee5facc6adf1a4d0.zip gcc-39d80300b3c769c3a7805a46ee5facc6adf1a4d0.tar.gz gcc-39d80300b3c769c3a7805a46ee5facc6adf1a4d0.tar.bz2 |
gcov: Add __gcov_filename_to_gcfn()
gcc/
* doc/invoke.texi (fprofile-info-section): Mention
__gcov_filename_to_gcfn(). Use "freestanding" to match with C11
standard language. Fix minor example code issues.
* gcov-io.h (GCOV_FILENAME_MAGIC): Define and document.
gcc/testsuite/
* gcc.dg/gcov-info-to-gcda.c: Test __gcov_filename_to_gcfn().
libgcc/
* gcov.h (__gcov_info_to_gcda): Mention __gcov_filename_to_gcfn().
(__gcov_filename_to_gcfn): Declare and document.
* libgcov-driver.c (dump_string): New.
(__gcov_filename_to_gcfn): Likewise.
(__gcov_info_to_gcda): Adjust comment to match C11 standard language.
Diffstat (limited to 'gcc/gcov-io.h')
-rw-r--r-- | gcc/gcov-io.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/gcc/gcov-io.h b/gcc/gcov-io.h index 204ae0c..3094763 100644 --- a/gcc/gcov-io.h +++ b/gcc/gcov-io.h @@ -60,14 +60,21 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see file : int32:magic int32:version int32:stamp record* - The magic ident is different for the notes and the data files. The - magic ident is used to determine the endianness of the file, when - reading. The version is the same for both files and is derived - from gcc's version number. The stamp value is used to synchronize - note and data files and to synchronize merging within a data - file. It need not be an absolute time stamp, merely a ticker that - increments fast enough and cycles slow enough to distinguish - different compile/run/compile cycles. + A filename header may be used to provide a filename for the data in + a stream of data to support gcov in freestanding environments. This + header is used by the merge-stream subcommand of the gcov-tool. The + format of the filename header is + + filename-header : int32:magic int32:version string + + The magic ident is different for the notes and the data files as + well as the filename header. The magic ident is used to determine + the endianness of the file, when reading. The version is the same + for both files and is derived from gcc's version number. The stamp + value is used to synchronize note and data files and to synchronize + merging within a data file. It need not be an absolute time stamp, + merely a ticker that increments fast enough and cycles slow enough + to distinguish different compile/run/compile cycles. Although the ident and version are formally 32 bit numbers, they are derived from 4 character ASCII strings. The version number @@ -228,6 +235,7 @@ typedef uint64_t gcov_type_unsigned; /* File magic. Must not be palindromes. */ #define GCOV_DATA_MAGIC ((gcov_unsigned_t)0x67636461) /* "gcda" */ #define GCOV_NOTE_MAGIC ((gcov_unsigned_t)0x67636e6f) /* "gcno" */ +#define GCOV_FILENAME_MAGIC ((gcov_unsigned_t)0x6763666e) /* "gcfn" */ #include "version.h" |