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

From
Juergen Gross <jgross@suse.com>
Date
2023-09-13 13:36:23
Also in
lkml, virtualization, xen-devel
Reply to
Steven Rostedt, 2023-09-13
On 13.09.23 15:26, Steven Rostedt wrote:
On Wed, 13 Sep 2023 13:38:27 +0200
Juergen Gross [off-list ref] wrote:
quoted
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.
Thanks. I'll add that to another patch I'm just writing for cleaning up
include/trace/events/xen.h (some defined trace events are no longer used).


Juergen

Attachments

Thread (4 messages) 4 messages, 2 authors, last reply 2023-09-13
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help