From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1851) id 504D93848415; Tue, 25 May 2021 07:52:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 504D93848415 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Martin Liska To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/marxin/heads/100751-gcov_dump-docs)] DOC: update documentation of __gcov_{dump, reset} X-Act-Checkin: gcc X-Git-Author: Martin Liska X-Git-Refname: refs/users/marxin/heads/100751-gcov_dump-docs X-Git-Oldrev: d8f6ceb58e6f506866cf0eacd2874f30743ea47c X-Git-Newrev: ed8d32c681bd09002230921829e063891d60dc5a Message-Id: <20210525075255.504D93848415@sourceware.org> Date: Tue, 25 May 2021 07:52:55 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2021 07:52:55 -0000 https://gcc.gnu.org/g:ed8d32c681bd09002230921829e063891d60dc5a commit ed8d32c681bd09002230921829e063891d60dc5a Author: Martin Liska Date: Tue May 25 09:52:01 2021 +0200 DOC: update documentation of __gcov_{dump,reset} gcc/ChangeLog: PR gcov-profile/100751 * doc/gcov.texi: Document that __gcov_dump can be called just once and that __gcov_reset resets run-time counters. Diff: --- gcc/doc/gcov.texi | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gcc/doc/gcov.texi b/gcc/doc/gcov.texi index 1ad99e5569e..d076721b93c 100644 --- a/gcc/doc/gcov.texi +++ b/gcc/doc/gcov.texi @@ -885,13 +885,15 @@ 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. +interest. Calling @code{__gcov_reset(void)} will clear all run-time 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 +(the function can be called just once). Instrumented applications use a static destructor with priority 99 to invoke the @code{__gcov_dump} function. Thus @code{__gcov_dump} is executed after all user defined static destructors, as well as handlers registered with @code{atexit}. + If an executable loads a dynamic shared object via dlopen functionality, @option{-Wl,--dynamic-list-data} is needed to dump all profile data.