aboutsummaryrefslogtreecommitdiff
path: root/libgcc/gcov.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2022-03-30 21:45:23 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-04-28 20:46:49 +0200
commit39d80300b3c769c3a7805a46ee5facc6adf1a4d0 (patch)
tree2c8609ca844a90b8006e39f11c2735a91fe73dff /libgcc/gcov.h
parent68a4673fe25e067df74373a45180d80c70da102f (diff)
downloadgcc-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 'libgcc/gcov.h')
-rw-r--r--libgcc/gcov.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/libgcc/gcov.h b/libgcc/gcov.h
index cea9302..cdd4206 100644
--- a/libgcc/gcov.h
+++ b/libgcc/gcov.h
@@ -43,7 +43,8 @@ extern void __gcov_dump (void);
stream. The ALLOCATE_FN callback shall allocate memory with a size in
characters specified by the first callback parameter. The ARG parameter is
a user-provided argument passed as the last argument to the callback
- functions. */
+ functions. It is recommended to use the __gcov_filename_to_gcfn()
+ in the filename callback function. */
extern void
__gcov_info_to_gcda (const struct gcov_info *__info,
@@ -52,4 +53,18 @@ __gcov_info_to_gcda (const struct gcov_info *__info,
void *(*__allocate_fn) (unsigned, void *),
void *__arg);
+/* Convert the FILENAME to a gcfn data stream. The DUMP_FN callback is
+ subsequently called with chunks (the begin and length of the chunk are
+ passed as the first two callback parameters) of the gcfn data stream.
+ The ARG parameter is a user-provided argument passed as the last
+ argument to the DUMP_FN callback function. This function is intended
+ to be used by the filename callback of __gcov_info_to_gcda(). The gcfn
+ data stream is used by the merge-stream subcommand of the gcov-tool to
+ get the filename associated with a gcda data stream. */
+
+extern void
+__gcov_filename_to_gcfn (const char *__filename,
+ void (*__dump_fn) (const void *, unsigned, void *),
+ void *__arg);
+
#endif /* GCC_GCOV_H */