|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 1/4] xen: indicate gcov in log messages
>>> On 06.09.16 at 14:47, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 06/09/16 13:41, Wei Liu wrote:
>> --- a/xen/drivers/char/console.c
>> +++ b/xen/drivers/char/console.c
>> @@ -735,10 +735,11 @@ void __init console_init_preirq(void)
>> spin_lock(&console_lock);
>> __putstr(xen_banner());
>> spin_unlock(&console_lock);
>> - printk("Xen version %d.%d%s (%s@%s) (%s) debug=%c %s\n",
>> + printk("Xen version %d.%d%s (%s@%s) (%s) debug=%c gcov=%c %s\n",
>
> Please instead use
>
> printk("Xen version %d.%d%s (%s@%s) (%s) debug=%c"
> #ifdef CONFIG_GCOV
> " gcov=y"
> #endif
> " %s\n",
>
> Enabling gcov will be extremely rare in the grand scheme of things, and
> this method causes zero overhead for the case where gcov is compiled
> out. (Similarly elsewhere.)
How about instead of the kind of ugly #ifdef-ery above, instead of
+#ifdef CONFIG_GCOV
+#define gcov_build() 1
+#else
+#define gcov_build() 0
+#endif
we'd have
+#ifdef CONFIG_GCOV
+#define gcov_string "gcov=y"
+#else
+#define gcov_string ""
+#endif
(with the identifier name open for improvement), which can then be
embedded easily into any string literal?
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |