aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2018-11-12 22:01:38 +0100
committerMartin Liska <marxin@gcc.gnu.org>2018-11-12 21:01:38 +0000
commite18240ffe2b48af6e77018e5f4e797c4b57cae72 (patch)
tree47b3de5539d55bde0524f303bd78eed461e6601e /gcc/doc
parente375da43d77a3b54185f26c6f474e3482185e7e4 (diff)
downloadgcc-e18240ffe2b48af6e77018e5f4e797c4b57cae72.zip
gcc-e18240ffe2b48af6e77018e5f4e797c4b57cae72.tar.gz
gcc-e18240ffe2b48af6e77018e5f4e797c4b57cae72.tar.bz2
Instrument only selected files (PR gcov-profile/87442).
2018-11-12 Martin Liska <mliska@suse.cz> PR gcov-profile/87442 * common.opt: Add -fprofile-filter-files and -fprofile-exclude-files options. * doc/invoke.texi: Document them. * tree-profile.c (parse_profile_filter): New. (parse_profile_file_filtering): Likewise. (release_profile_file_filtering): Likewise. (include_source_file_for_profile): Likewise. (tree_profiling): Filter source files based on the newly added options. 2018-11-12 Martin Liska <mliska@suse.cz> PR gcov-profile/87442 * gcc.dg/profile-filtering-1.c: New test. * gcc.dg/profile-filtering-2.c: New test. From-SVN: r266037
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/invoke.texi19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 5eef746..75e9556 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -484,6 +484,7 @@ Objective-C and Objective-C++ Dialects}.
@gccoptlist{-p -pg -fprofile-arcs --coverage -ftest-coverage @gol
-fprofile-abs-path @gol
-fprofile-dir=@var{path} -fprofile-generate -fprofile-generate=@var{path} @gol
+-fprofile-update=@var{method} -fprofile-filter-files=@var{regex} -fprofile-exclude-files=@var{regex} @gol
-fsanitize=@var{style} -fsanitize-recover -fsanitize-recover=@var{style} @gol
-fasan-shadow-offset=@var{number} -fsanitize-sections=@var{s1},@var{s2},... @gol
-fsanitize-undefined-trap-on-error -fbounds-check @gol
@@ -11896,6 +11897,24 @@ when supported by a target, or to @samp{single} otherwise. The GCC driver
automatically selects @samp{prefer-atomic} when @option{-pthread}
is present in the command line.
+@item -fprofile-filter-files=@var{regex}
+@opindex fprofile-filter-files
+
+Instrument only functions from files where names match
+any regular expression (separated by a semi-colon).
+
+For example, @option{-fprofile-filter-files=main.c;module.*.c} will instrument
+only @file{main.c} and all C files starting with 'module'.
+
+@item -fprofile-exclude-files=@var{regex}
+@opindex fprofile-exclude-files
+
+Instrument only functions from files where names do not match
+all the regular expressions (separated by a semi-colon).
+
+For example, @option{-fprofile-exclude-files=/usr/*} will prevent instrumentation
+of all files that are located in @file{/usr/} folder.
+
@item -fsanitize=address
@opindex fsanitize=address
Enable AddressSanitizer, a fast memory error detector.