diff options
author | tejohnson <tejohnson@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-05-08 21:22:28 +0000 |
---|---|---|
committer | tejohnson <tejohnson@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-05-08 21:22:28 +0000 |
commit | 4ef7becbf1f12b8f2200ccee6740731bc7853350 (patch) | |
tree | e8169275509aad912d8d4b57d59a52610ef8bcc8 /gcc/doc/gcov.texi | |
parent | c02159a73f8377f6751f96a07010ad54d96c172e (diff) | |
download | gcc-4ef7becbf1f12b8f2200ccee6740731bc7853350.tar.gz |
This patch adds functionality to libgcov to enable user applications to
collect profile data only in regions of interest. This is useful, for
example, to collect profile data from a long-running server only
during the time when it is serving requests.
Specifically, the new routines __gcov_reset will clear all profile counters
to zero and __gcov_dump will write out the profile information collected so
far. A global variable is used to prevent writing out the profile a
second time during exit.
2012-05-08 Teresa Johnson <tejohnson@google.com>
* libgcc/libgcov.c (gcov_clear, __gcov_reset): New functions.
(__gcov_dump): Ditto.
(gcov_dump_complete): New global variable.
(gcov_exit): Export hidden to enable use in L_gcov_dump.
(__gcov_flush): Outline functionality now in gcov_clear.
* libgcc/Makefile.in (L_gcov_reset, L_gcov_dump): Define.
* gcc/gcov-io.h (__gcov_reset, __gcov_dump): Declare.
* gcc/doc/gcov.texi: Add note on using __gcov_reset and __gcov_dump.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187297 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/doc/gcov.texi')
-rw-r--r-- | gcc/doc/gcov.texi | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/doc/gcov.texi b/gcc/doc/gcov.texi index e771f72e402..7256664c0ee 100644 --- a/gcc/doc/gcov.texi +++ b/gcc/doc/gcov.texi @@ -538,6 +538,12 @@ now be calculable at compile time in some instances. Because the coverage of all the uses of the inline function will be shown for the same source lines, the line counts themselves might seem inconsistent. +Long-running applications can use the @code{_gcov_reset} and @code{_gcov_dump} +facilities to restrict profile collection to the program region of +interest. Calling @code{_gcov_reset(void)} will clear all profile counters +to zero, and calling @code{_gcov_dump(void)} will cause the profile information +collected at that point to be dumped to @file{.gcda} output files. + @c man end @node Gcov Data Files |