From: Sandra Loosemore <sandra@codesourcery.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: [doc, committed] document interaction between -p/-pg and no_instrument_function attribute
Date: Mon, 19 Nov 2018 01:07:00 -0000 [thread overview]
Message-ID: <e7be6353-8e65-02e1-b9a8-693075ad2bfc@codesourcery.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 79 bytes --]
Like the subject line says. I've checked in this patch for PR 40498.
-Sandra
[-- Attachment #2: gcc.log --]
[-- Type: text/x-log, Size: 312 bytes --]
2018-11-18 Sandra Loosemore <sandra@codesourcery.com>
PR other/40498
gcc/
* doc/extend.texi (Common Function Attributes): Document that
no_instrument_function applies to -p and -pg, too.
* doc/invoke.texi (Instrumentation Options): Add cross-references
to docs for -p, -pg, and -finstrument-functions.
[-- Attachment #3: gcc.patch --]
[-- Type: text/x-patch, Size: 2345 bytes --]
Index: doc/extend.texi
===================================================================
--- doc/extend.texi (revision 266245)
+++ doc/extend.texi (working copy)
@@ -3015,7 +3015,10 @@ semantically equivalent function.
@item no_instrument_function
@cindex @code{no_instrument_function} function attribute
@opindex finstrument-functions
-If @option{-finstrument-functions} is given, profiling function calls are
+@opindex p
+@opindex pg
+If any of @option{-finstrument-functions}, @option{-p}, or @option{-pg} are
+given, profiling function calls are
generated at entry and exit of most user-compiled functions.
Functions with this attribute are not so instrumented.
Index: doc/invoke.texi
===================================================================
--- doc/invoke.texi (revision 266246)
+++ doc/invoke.texi (working copy)
@@ -11980,21 +11980,21 @@ program analysis purposes.
@table @gcctabopt
@cindex @command{prof}
+@cindex @command{gprof}
@item -p
+@itemx -pg
@opindex p
-Generate extra code to write profile information suitable for the
-analysis program @command{prof}. You must use this option when compiling
-the source files you want data about, and you must also use it when
-linking.
-
-@cindex @command{gprof}
-@item -pg
@opindex pg
Generate extra code to write profile information suitable for the
-analysis program @command{gprof}. You must use this option when compiling
+analysis program @command{prof} (for @option{-p}) or @command{gprof}
+(for @option{-pg}). You must use this option when compiling
the source files you want data about, and you must also use it when
linking.
+You can use the function attribute @code{no_instrument_function} to
+suppress profiling of individual functions when compiling with these options.
+@xref{Common Function Attributes}.
+
@item -fprofile-arcs
@opindex fprofile-arcs
Add code so that program flow @dfn{arcs} are instrumented. During
@@ -12742,6 +12742,7 @@ example, for the profiling functions lis
interrupt routines, and any functions from which the profiling functions
cannot safely be called (perhaps signal handlers, if the profiling
routines generate output or allocate memory).
+@xref{Common Function Attributes}.
@item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
@opindex finstrument-functions-exclude-file-list
reply other threads:[~2018-11-19 1:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e7be6353-8e65-02e1-b9a8-693075ad2bfc@codesourcery.com \
--to=sandra@codesourcery.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).