This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] gcov: Configurable destination for error output
- From: Aaron Conole <aconole at bytheb dot org>
- To: Nathan Sidwell <nathan at acm dot org>
- Cc: gcc-patches at gcc dot gnu dot org, Jan Hubicka <hubicka at ucw dot cz>, Nathan Sidwell <nathan at codesourcery dot com>
- Date: Mon, 22 Feb 2016 13:11:14 -0500
- Subject: Re: [PATCH] gcov: Configurable destination for error output
- Authentication-results: sourceware.org; auth=none
- References: <1456160612-25123-1-git-send-email-aconole at bytheb dot org> <56CB42FE dot 1020608 at acm dot org>
Nathan Sidwell <nathan@acm.org> writes:
Hi Nathan, thanks so much for looking at this!
> On 02/22/16 12:03, Aaron Conole wrote:
>> The previous gcov behavior was to always output errors on the stderr channel.
>> This is fine for most uses, but some programs will require stderr to be
>> silent for certain tests. This change allows configuring the gcov output by
>> an environment variable which will be used to open the appropriate file.
>
> Why is the invoker unable to direct fd2 before execing gcov?
I want to make sure I understand your question. You are asking why
something like: ` ./program_executed 2>/path/to/file `` is not preferred?
If this is the question, the problem is program errors will be intermingled
with gcov error messages. Let's suppose that I've got a unit test
program (since that's what I have as specifically happening). I expect
certain tests from that program to spit out errors on stderr. So, I
filter out that text in stderr, so normal case stderr results will be
clear. Now, I build with gcov enabled. In this case, gcov writes
'profiling:...' to stderr. Now, the test fails, even though nothing
changed apart from using gcov.
Sometimes this is a real user error (clean .gcda and .gcno files, do
clean build and then rerun), but other times, for instance if I use
openvswitch's 'make check', there is no rebuild which happens, but gcov
has merge mismatch errors anyway. I want to not squelch those errors,
but I don't want them intermingled with the program's error output.
I hope I explained myself and answered your question. Please let me know
if I didn't.
Thanks again,
-Aaron
> nathan