diff options
author | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2010-12-16 17:33:27 -0500 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2011-07-18 18:43:26 -0400 |
commit | c796f213a6934712ede728d9b53ef0e5066db23a (patch) | |
tree | 30fffcabfad42297b2d4b1f455a5f88ccf91091b /include/trace | |
parent | f04e2ee41d3dbeb6eeb3685d1b4c208b898e278f (diff) |
xen/trace: add multicall tracing
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/xen.h | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/include/trace/events/xen.h b/include/trace/events/xen.h index 46c170c75d4e..330848269bc1 100644 --- a/include/trace/events/xen.h +++ b/include/trace/events/xen.h | |||
@@ -6,7 +6,125 @@ | |||
6 | 6 | ||
7 | #include <linux/tracepoint.h> | 7 | #include <linux/tracepoint.h> |
8 | #include <asm/paravirt_types.h> | 8 | #include <asm/paravirt_types.h> |
9 | #include <asm/xen/trace_types.h> | ||
9 | 10 | ||
11 | /* Multicalls */ | ||
12 | |||
13 | TRACE_EVENT(xen_mc_batch, | ||
14 | TP_PROTO(enum paravirt_lazy_mode mode), | ||
15 | TP_ARGS(mode), | ||
16 | TP_STRUCT__entry( | ||
17 | __field(enum paravirt_lazy_mode, mode) | ||
18 | ), | ||
19 | TP_fast_assign(__entry->mode = mode), | ||
20 | TP_printk("start batch LAZY_%s", | ||
21 | (__entry->mode == PARAVIRT_LAZY_MMU) ? "MMU" : | ||
22 | (__entry->mode == PARAVIRT_LAZY_CPU) ? "CPU" : "NONE") | ||
23 | ); | ||
24 | |||
25 | TRACE_EVENT(xen_mc_issue, | ||
26 | TP_PROTO(enum paravirt_lazy_mode mode), | ||
27 | TP_ARGS(mode), | ||
28 | TP_STRUCT__entry( | ||
29 | __field(enum paravirt_lazy_mode, mode) | ||
30 | ), | ||
31 | TP_fast_assign(__entry->mode = mode), | ||
32 | TP_printk("issue mode LAZY_%s", | ||
33 | (__entry->mode == PARAVIRT_LAZY_MMU) ? "MMU" : | ||
34 | (__entry->mode == PARAVIRT_LAZY_CPU) ? "CPU" : "NONE") | ||
35 | ); | ||
36 | |||
37 | TRACE_EVENT(xen_mc_entry, | ||
38 | TP_PROTO(struct multicall_entry *mc, unsigned nargs), | ||
39 | TP_ARGS(mc, nargs), | ||
40 | TP_STRUCT__entry( | ||
41 | __field(unsigned int, op) | ||
42 | __field(unsigned int, nargs) | ||
43 | __array(unsigned long, args, 6) | ||
44 | ), | ||
45 | TP_fast_assign(__entry->op = mc->op; | ||
46 | __entry->nargs = nargs; | ||
47 | memcpy(__entry->args, mc->args, sizeof(unsigned long) * nargs); | ||
48 | memset(__entry->args + nargs, 0, sizeof(unsigned long) * (6 - nargs)); | ||
49 | ), | ||
50 | TP_printk("op %u%s args [%lx, %lx, %lx, %lx, %lx, %lx]", | ||
51 | __entry->op, xen_hypercall_name(__entry->op), | ||
52 | __entry->args[0], __entry->args[1], __entry->args[2], | ||
53 | __entry->args[3], __entry->args[4], __entry->args[5]) | ||
54 | ); | ||
55 | |||
56 | TRACE_EVENT(xen_mc_entry_alloc, | ||
57 | TP_PROTO(size_t args), | ||
58 | TP_ARGS(args), | ||
59 | TP_STRUCT__entry( | ||
60 | __field(size_t, args) | ||
61 | ), | ||
62 | TP_fast_assign(__entry->args = args), | ||
63 | TP_printk("alloc entry %zu arg bytes", __entry->args) | ||
64 | ); | ||
65 | |||
66 | TRACE_EVENT(xen_mc_callback, | ||
67 | TP_PROTO(xen_mc_callback_fn_t fn, void *data), | ||
68 | TP_ARGS(fn, data), | ||
69 | TP_STRUCT__entry( | ||
70 | __field(xen_mc_callback_fn_t, fn) | ||
71 | __field(void *, data) | ||
72 | ), | ||
73 | TP_fast_assign( | ||
74 | __entry->fn = fn; | ||
75 | __entry->data = data; | ||
76 | ), | ||
77 | TP_printk("callback %pf, data %p", | ||
78 | __entry->fn, __entry->data) | ||
79 | ); | ||
80 | |||
81 | TRACE_EVENT(xen_mc_flush_reason, | ||
82 | TP_PROTO(enum xen_mc_flush_reason reason), | ||
83 | TP_ARGS(reason), | ||
84 | TP_STRUCT__entry( | ||
85 | __field(enum xen_mc_flush_reason, reason) | ||
86 | ), | ||
87 | TP_fast_assign(__entry->reason = reason), | ||
88 | TP_printk("flush reason %s", | ||
89 | (__entry->reason == XEN_MC_FL_NONE) ? "NONE" : | ||
90 | (__entry->reason == XEN_MC_FL_BATCH) ? "BATCH" : | ||
91 | (__entry->reason == XEN_MC_FL_ARGS) ? "ARGS" : | ||
92 | (__entry->reason == XEN_MC_FL_CALLBACK) ? "CALLBACK" : "??") | ||
93 | ); | ||
94 | |||
95 | TRACE_EVENT(xen_mc_flush, | ||
96 | TP_PROTO(unsigned mcidx, unsigned argidx, unsigned cbidx), | ||
97 | TP_ARGS(mcidx, argidx, cbidx), | ||
98 | TP_STRUCT__entry( | ||
99 | __field(unsigned, mcidx) | ||
100 | __field(unsigned, argidx) | ||
101 | __field(unsigned, cbidx) | ||
102 | ), | ||
103 | TP_fast_assign(__entry->mcidx = mcidx; | ||
104 | __entry->argidx = argidx; | ||
105 | __entry->cbidx = cbidx), | ||
106 | TP_printk("flushing %u hypercalls, %u arg bytes, %u callbacks", | ||
107 | __entry->mcidx, __entry->argidx, __entry->cbidx) | ||
108 | ); | ||
109 | |||
110 | TRACE_EVENT(xen_mc_extend_args, | ||
111 | TP_PROTO(unsigned long op, size_t args, enum xen_mc_extend_args res), | ||
112 | TP_ARGS(op, args, res), | ||
113 | TP_STRUCT__entry( | ||
114 | __field(unsigned int, op) | ||
115 | __field(size_t, args) | ||
116 | __field(enum xen_mc_extend_args, res) | ||
117 | ), | ||
118 | TP_fast_assign(__entry->op = op; | ||
119 | __entry->args = args; | ||
120 | __entry->res = res), | ||
121 | TP_printk("extending op %u%s by %zu bytes res %s", | ||
122 | __entry->op, xen_hypercall_name(__entry->op), | ||
123 | __entry->args, | ||
124 | __entry->res == XEN_MC_XE_OK ? "OK" : | ||
125 | __entry->res == XEN_MC_XE_BAD_OP ? "BAD_OP" : | ||
126 | __entry->res == XEN_MC_XE_NO_SPACE ? "NO_SPACE" : "???") | ||
127 | ); | ||
10 | #endif /* _TRACE_XEN_H */ | 128 | #endif /* _TRACE_XEN_H */ |
11 | 129 | ||
12 | /* This part must be outside protection */ | 130 | /* This part must be outside protection */ |