Re: [PATCH 2/4] Adding support for coverage information

Jan Beulich
Mon, 04 Feb 2013 15:44:45 -0000

>>> On 04.02.13 at 16:29, Frediano Ziglio
<frediano.ziglio@citrix.com> wrote:
> On Mon, 2013-02-04 at 09:39 +0000, Jan Beulich wrote:
>> >>> On 01.02.13 at 15:48, Frediano Ziglio
<frediano.ziglio@citrix.com> wrote:
>> > +ifeq ($(coverage),y)
>> > +$(filter-out %.init.o,$(obj-y) $(obj-bin-y)): CFLAGS +=
-fprofile-arcs -ftest-coverage -DTEST_COVERAGE
>> > +endif
>>
>> For one - isn''t simply using $(obj-y) here sufficient (i.e.
without the
>> $(filter-out ...))?
>>
>> And second, I would thing this then ought to become a single line:
>>
>> $(obj-$(coverage)): CFLAGS += -fprofile-arcs -ftest-coverage
-DTEST_COVERAGE
>>
>
> Yes, it works fine and seems to compile all proper files but I
don''t
> understand why.
> What''s the difference between $(obj-bin-y) and $(obj-y) ??

The former is the set of all .init.o files, which (when building with
clang instead of gcc) must not undergo certain transformations
(and aren''t worth it, as init-time only code isn''t really
performance
critical).

>> > +
>> > +void init_coverage(void)
>>
>> __init
>>
>
> I removed from previous and put in the header as suggestion.

Not sure what you mean here, but just in case - __init
annotations do specifically not belong on declarations, but
only on definitions.

>> > +#if BITS_PER_LONG >= 64
>> > +typedef long gcov_type;
>> > +#else
>> > +typedef long long gcov_type;
>> > +#endif
>>
>> What''s this???
>>
>
> This came from Linux, probably for Xen a simple
>
> typedef long gcov_type
>
> is ok.

No. Your goal - just to reiterate - must be not to use types the
size of which depends on the guest word size.

Jan