Drop the lazy mode (cpu or mmu) from the xen_mc_batch and xen_mc_issue trace entries.
This is done in preparation of removing the xen_lazy_mode percpu variable. Signed-off-by: Juergen Gross <[email protected]> --- arch/x86/xen/xen-ops.h | 11 +++++++---- include/trace/events/xen.h | 33 +++++++++++++++++++-------------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h index 6808010ac379..dc892f421f25 100644 --- a/arch/x86/xen/xen-ops.h +++ b/arch/x86/xen/xen-ops.h @@ -98,7 +98,7 @@ static inline void xen_mc_batch(void) /* need to disable interrupts until this entry is complete */ local_irq_save(flags); - trace_xen_mc_batch(xen_get_lazy_mode()); + trace_xen_mc_batch(flags); __this_cpu_write(xen_mc_irq_flags, flags); } @@ -114,13 +114,16 @@ void xen_mc_flush(void); /* Issue a multicall if we're not in a lazy mode */ static inline void xen_mc_issue(unsigned mode) { - trace_xen_mc_issue(mode); + bool flush = !(xen_get_lazy_mode() & mode); + unsigned long flags = this_cpu_read(xen_mc_irq_flags); - if ((xen_get_lazy_mode() & mode) == 0) + trace_xen_mc_issue(flush, flags); + + if (flush) xen_mc_flush(); /* restore flags saved in xen_mc_batch */ - local_irq_restore(this_cpu_read(xen_mc_irq_flags)); + local_irq_restore(flags); } /* Set up a callback to be called when the current batch is flushed */ diff --git a/include/trace/events/xen.h b/include/trace/events/xen.h index e3f139f0bc78..ad384969e2cb 100644 --- a/include/trace/events/xen.h +++ b/include/trace/events/xen.h @@ -12,24 +12,29 @@ struct multicall_entry; /* Multicalls */ -DECLARE_EVENT_CLASS(xen_mc__batch, - TP_PROTO(enum xen_lazy_mode mode), - TP_ARGS(mode), +TRACE_EVENT(xen_mc_batch, + TP_PROTO(unsigned long flags), + TP_ARGS(flags), TP_STRUCT__entry( - __field(enum xen_lazy_mode, mode) + __field(unsigned long, flags) ), - TP_fast_assign(__entry->mode = mode), - TP_printk("start batch LAZY_%s", - (__entry->mode == XEN_LAZY_MMU) ? "MMU" : - (__entry->mode == XEN_LAZY_CPU) ? "CPU" : "NONE") + TP_fast_assign(__entry->flags = flags), + TP_printk("start batch lazy flags %lx", __entry->flags) ); -#define DEFINE_XEN_MC_BATCH(name) \ - DEFINE_EVENT(xen_mc__batch, name, \ - TP_PROTO(enum xen_lazy_mode mode), \ - TP_ARGS(mode)) -DEFINE_XEN_MC_BATCH(xen_mc_batch); -DEFINE_XEN_MC_BATCH(xen_mc_issue); +TRACE_EVENT(xen_mc_issue, + TP_PROTO(bool flush, unsigned long flags), + TP_ARGS(flush, flags), + TP_STRUCT__entry( + __field(unsigned long, flags) + __field(bool, flush) + ), + TP_fast_assign(__entry->flush = flush; + __entry->flags = flags; + ), + TP_printk("flush: %s, flags %lx", + __entry->flush ? "yes" : "no", __entry->flags) + ); TRACE_DEFINE_SIZEOF(ulong); -- 2.54.0
