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

Re: [PATCH 2/3] x86/xen: move paravirt lazy code



On Wed, 13 Sep 2023 13:38:27 +0200
Juergen Gross <jgross@xxxxxxxx> wrote:

> diff --git a/include/trace/events/xen.h b/include/trace/events/xen.h
> index 44a3f565264d..0577f0cdd231 100644
> --- a/include/trace/events/xen.h
> +++ b/include/trace/events/xen.h
> @@ -6,26 +6,26 @@
>  #define _TRACE_XEN_H
>  
>  #include <linux/tracepoint.h>
> -#include <asm/paravirt_types.h>
> +#include <asm/xen/hypervisor.h>
>  #include <asm/xen/trace_types.h>
>  
>  struct multicall_entry;
>  
>  /* Multicalls */
>  DECLARE_EVENT_CLASS(xen_mc__batch,
> -         TP_PROTO(enum paravirt_lazy_mode mode),
> +         TP_PROTO(enum xen_lazy_mode mode),
>           TP_ARGS(mode),
>           TP_STRUCT__entry(
> -                 __field(enum paravirt_lazy_mode, mode)
> +                 __field(enum xen_lazy_mode, mode)
>                   ),
>           TP_fast_assign(__entry->mode = mode),
>           TP_printk("start batch LAZY_%s",
> -                   (__entry->mode == PARAVIRT_LAZY_MMU) ? "MMU" :
> -                   (__entry->mode == PARAVIRT_LAZY_CPU) ? "CPU" : "NONE")
> +                   (__entry->mode == XEN_LAZY_MMU) ? "MMU" :
> +                   (__entry->mode == XEN_LAZY_CPU) ? "CPU" : "NONE")

There's helper functions that make the above easier to implement as well as
exports the symbols so that user space can parse this better:

TRACE_DEFINE_ENUM(XEN_LAZY_NONE);
TRACE_DEFINE_ENUM(XEN_LAZY_MMU);
TRACE_DEFINE_ENUM(XEN_LAZY_CPU);

[..]

            TP_printk("start batch LAZY_%s",
                      __print_symbolic(mode,
                                       { XEN_LAZY_NONE, "NONE" },
                                       { XEN_LAZY_MMU,  "MMU   },
                                       { XEN_LAZY_CPU,  "CPU"  }))

Then user space parsers that read the raw data can convert these events
into something humans can read.

-- Steve

>       );
>  #define DEFINE_XEN_MC_BATCH(name)                    \
>       DEFINE_EVENT(xen_mc__batch, name,               \
> -             TP_PROTO(enum paravirt_lazy_mode mode), \
> +             TP_PROTO(enum xen_lazy_mode mode),      \
>                    TP_ARGS(mode))
>  
>  DEFINE_XEN_MC_BATCH(xen_mc_batch);



 


Rackspace

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