[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] lib: drop (replace) debug_build()



On 23.12.2020 17:53, Andrew Cooper wrote:
> On 23/12/2020 16:05, Jan Beulich wrote:
>> Its expansion shouldn't be tied to NDEBUG - down the road we may want to
>> allow enabling assertions independently of CONFIG_DEBUG. Replace the few
>> uses by a new xen_build_info() helper, subsuming gcov_string at the same
>> time (while replacing the stale CONFIG_GCOV used there) and also adding
>> CONFIG_UBSAN indication.
>>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>,

Thanks.

>> --- a/xen/common/version.c
>> +++ b/xen/common/version.c
>> @@ -70,6 +70,30 @@ const char *xen_deny(void)
>>      return "<denied>";
>>  }
>>  
>> +static const char build_info[] =
>> +    "debug="
>> +#ifdef CONFIG_DEBUG
>> +    "y"
>> +#else
>> +    "n"
>> +#endif
>> +#ifdef CONFIG_COVERAGE
>> +# ifdef __clang__
>> +    " llvmcov=y"
>> +# else
>> +    " gcov=y"
>> +# endif
>> +#endif
>> +#ifdef CONFIG_UBSAN
>> +    " ubsan=y"
>> +#endif
>> +    "";
>> +
>> +const char *xen_build_info(void)
>> +{
>> +    return build_info;
>> +}
> 
> ... do we really need a function here?
> 
> Wouldn't an extern const char build_info[] do?

It probably would, but I wanted things to remain consistent with
the siblings, many of which also return string literals (or
effectively plain numbers).

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.