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

Re: [Xen-devel] [PATCH v1 2/7] sched: Remove dependency on __LINE__ for release builds



>>> On 06.05.16 at 17:48, <ross.lagerwall@xxxxxxxxxx> wrote:
> When using xsplice, use of __LINE__ can generate spurious changes in
> functions due to embedded line numbers.  For release builds, remove the
> use of these line numbers in domain_crash*() and print the current text
> address instead.

Which makes it more cumbersome to look up the origin. At the very
least ...

> --- a/xen/include/xen/sched.h
> +++ b/xen/include/xen/sched.h
> @@ -611,20 +611,34 @@ void vcpu_end_shutdown_deferral(struct vcpu *v);
>   * from any processor.
>   */
>  void __domain_crash(struct domain *d);
> +#ifdef NDEBUG

... should this imo become "defined(NDEBUG) &&
defined(CONFIG_XSPLICE)" then.

> +#define domain_crash(d) do {                                              \
> +    printk("domain_crash called from %p\n", current_text_addr());         \

And I'd really expect %ps or %pS to be used here.

> +    __domain_crash(d);                                                    \
> +} while (0)
> +#else
>  #define domain_crash(d) do {                                              \
>      printk("domain_crash called from %s:%d\n", __FILE__, __LINE__);       \
>      __domain_crash(d);                                                    \
>  } while (0)
> +#endif

Furthermore, considering this basically repeats ...

> +#ifdef NDEBUG
> +#define domain_crash_synchronous() do {                                   \
> +    printk("domain_crash_sync called from %p\n", current_text_addr());    \
> +    __domain_crash_synchronous();                                         \
> +} while (0)
> +#else
>  #define domain_crash_synchronous() do {                                   \
>      printk("domain_crash_sync called from %s:%d\n", __FILE__, __LINE__);  \
>      __domain_crash_synchronous();                                         \
>  } while (0)
> +#endif

... here, please limit the #ifdef-ery by abstracting just the
printk() invocation in a way that makes it possible to be used in
both places.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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