[PATCH] Instrument only selected files (PR gcov-profile/87442).

Martin Liška mliska@suse.cz
Thu Nov 8 13:42:00 GMT 2018


Hi.

The patch is about possibility to filter which files are instrumented. The usage
is explained in the PR.

Patch can bootstrap and survives regression tests on x86_64-linux-gnu.

Ready for trunk?
Thanks,
Martin

gcc/ChangeLog:

2018-11-08  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.

gcc/testsuite/ChangeLog:

2018-11-08  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.
---
 gcc/common.opt                             |  8 +++
 gcc/doc/invoke.texi                        | 19 +++++
 gcc/testsuite/gcc.dg/profile-filtering-1.c | 37 ++++++++++
 gcc/testsuite/gcc.dg/profile-filtering-2.c | 37 ++++++++++
 gcc/tree-profile.c                         | 84 ++++++++++++++++++++++
 5 files changed, 185 insertions(+)
 create mode 100644 gcc/testsuite/gcc.dg/profile-filtering-1.c
 create mode 100644 gcc/testsuite/gcc.dg/profile-filtering-2.c


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Instrument-only-selected-files-PR-gcov-profile-87442.patch
Type: text/x-patch
Size: 7739 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20181108/9946b35b/attachment.bin>


More information about the Gcc-patches mailing list