xref: /openbmc/linux/include/trace/events/dlm.h (revision ffcdf473)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM dlm
4 
5 #if !defined(_TRACE_DLM_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_DLM_H
7 
8 #include <linux/dlm.h>
9 #include <linux/dlmconstants.h>
10 #include <linux/tracepoint.h>
11 
12 #include "../../../fs/dlm/dlm_internal.h"
13 
14 #define show_lock_flags(flags) __print_flags(flags, "|",	\
15 	{ DLM_LKF_NOQUEUE,	"NOQUEUE" },			\
16 	{ DLM_LKF_CANCEL,	"CANCEL" },			\
17 	{ DLM_LKF_CONVERT,	"CONVERT" },			\
18 	{ DLM_LKF_VALBLK,	"VALBLK" },			\
19 	{ DLM_LKF_QUECVT,	"QUECVT" },			\
20 	{ DLM_LKF_IVVALBLK,	"IVVALBLK" },			\
21 	{ DLM_LKF_CONVDEADLK,	"CONVDEADLK" },			\
22 	{ DLM_LKF_PERSISTENT,	"PERSISTENT" },			\
23 	{ DLM_LKF_NODLCKWT,	"NODLCKWT" },			\
24 	{ DLM_LKF_NODLCKBLK,	"NODLCKBLK" },			\
25 	{ DLM_LKF_EXPEDITE,	"EXPEDITE" },			\
26 	{ DLM_LKF_NOQUEUEBAST,	"NOQUEUEBAST" },		\
27 	{ DLM_LKF_HEADQUE,	"HEADQUE" },			\
28 	{ DLM_LKF_NOORDER,	"NOORDER" },			\
29 	{ DLM_LKF_ORPHAN,	"ORPHAN" },			\
30 	{ DLM_LKF_ALTPR,	"ALTPR" },			\
31 	{ DLM_LKF_ALTCW,	"ALTCW" },			\
32 	{ DLM_LKF_FORCEUNLOCK,	"FORCEUNLOCK" },		\
33 	{ DLM_LKF_TIMEOUT,	"TIMEOUT" })
34 
35 #define show_lock_mode(mode) __print_symbolic(mode,		\
36 	{ DLM_LOCK_IV,		"IV"},				\
37 	{ DLM_LOCK_NL,		"NL"},				\
38 	{ DLM_LOCK_CR,		"CR"},				\
39 	{ DLM_LOCK_CW,		"CW"},				\
40 	{ DLM_LOCK_PR,		"PR"},				\
41 	{ DLM_LOCK_PW,		"PW"},				\
42 	{ DLM_LOCK_EX,		"EX"})
43 
44 #define show_dlm_sb_flags(flags) __print_flags(flags, "|",	\
45 	{ DLM_SBF_DEMOTED,	"DEMOTED" },			\
46 	{ DLM_SBF_VALNOTVALID,	"VALNOTVALID" },		\
47 	{ DLM_SBF_ALTMODE,	"ALTMODE" })
48 
49 #define show_lkb_flags(flags) __print_flags(flags, "|",		\
50 	{ BIT(DLM_DFL_USER_BIT), "USER" },			\
51 	{ BIT(DLM_DFL_ORPHAN_BIT), "ORPHAN" })
52 
53 #define show_header_cmd(cmd) __print_symbolic(cmd,		\
54 	{ DLM_MSG,		"MSG"},				\
55 	{ DLM_RCOM,		"RCOM"},			\
56 	{ DLM_OPTS,		"OPTS"},			\
57 	{ DLM_ACK,		"ACK"},				\
58 	{ DLM_FIN,		"FIN"})
59 
60 #define show_message_version(version) __print_symbolic(version,	\
61 	{ DLM_VERSION_3_1,	"3.1"},				\
62 	{ DLM_VERSION_3_2,	"3.2"})
63 
64 #define show_message_type(type) __print_symbolic(type,		\
65 	{ DLM_MSG_REQUEST,	"REQUEST"},			\
66 	{ DLM_MSG_CONVERT,	"CONVERT"},			\
67 	{ DLM_MSG_UNLOCK,	"UNLOCK"},			\
68 	{ DLM_MSG_CANCEL,	"CANCEL"},			\
69 	{ DLM_MSG_REQUEST_REPLY, "REQUEST_REPLY"},		\
70 	{ DLM_MSG_CONVERT_REPLY, "CONVERT_REPLY"},		\
71 	{ DLM_MSG_UNLOCK_REPLY,	"UNLOCK_REPLY"},		\
72 	{ DLM_MSG_CANCEL_REPLY,	"CANCEL_REPLY"},		\
73 	{ DLM_MSG_GRANT,	"GRANT"},			\
74 	{ DLM_MSG_BAST,		"BAST"},			\
75 	{ DLM_MSG_LOOKUP,	"LOOKUP"},			\
76 	{ DLM_MSG_REMOVE,	"REMOVE"},			\
77 	{ DLM_MSG_LOOKUP_REPLY,	"LOOKUP_REPLY"},		\
78 	{ DLM_MSG_PURGE,	"PURGE"})
79 
80 #define show_rcom_type(type) __print_symbolic(type,            \
81 	{ DLM_RCOM_STATUS,              "STATUS"},              \
82 	{ DLM_RCOM_NAMES,               "NAMES"},               \
83 	{ DLM_RCOM_LOOKUP,              "LOOKUP"},              \
84 	{ DLM_RCOM_LOCK,                "LOCK"},                \
85 	{ DLM_RCOM_STATUS_REPLY,        "STATUS_REPLY"},        \
86 	{ DLM_RCOM_NAMES_REPLY,         "NAMES_REPLY"},         \
87 	{ DLM_RCOM_LOOKUP_REPLY,        "LOOKUP_REPLY"},        \
88 	{ DLM_RCOM_LOCK_REPLY,          "LOCK_REPLY"})
89 
90 
91 /* note: we begin tracing dlm_lock_start() only if ls and lkb are found */
92 TRACE_EVENT(dlm_lock_start,
93 
94 	TP_PROTO(struct dlm_ls *ls, struct dlm_lkb *lkb, const void *name,
95 		 unsigned int namelen, int mode, __u32 flags),
96 
97 	TP_ARGS(ls, lkb, name, namelen, mode, flags),
98 
99 	TP_STRUCT__entry(
100 		__field(__u32, ls_id)
101 		__field(__u32, lkb_id)
102 		__field(int, mode)
103 		__field(__u32, flags)
104 		__dynamic_array(unsigned char, res_name,
105 				lkb->lkb_resource ? lkb->lkb_resource->res_length : namelen)
106 	),
107 
108 	TP_fast_assign(
109 		struct dlm_rsb *r;
110 
111 		__entry->ls_id = ls->ls_global_id;
112 		__entry->lkb_id = lkb->lkb_id;
113 		__entry->mode = mode;
114 		__entry->flags = flags;
115 
116 		r = lkb->lkb_resource;
117 		if (r)
118 			memcpy(__get_dynamic_array(res_name), r->res_name,
119 			       __get_dynamic_array_len(res_name));
120 		else if (name)
121 			memcpy(__get_dynamic_array(res_name), name,
122 			       __get_dynamic_array_len(res_name));
123 	),
124 
125 	TP_printk("ls_id=%u lkb_id=%x mode=%s flags=%s res_name=%s",
126 		  __entry->ls_id, __entry->lkb_id,
127 		  show_lock_mode(__entry->mode),
128 		  show_lock_flags(__entry->flags),
129 		  __print_hex_str(__get_dynamic_array(res_name),
130 				  __get_dynamic_array_len(res_name)))
131 
132 );
133 
134 TRACE_EVENT(dlm_lock_end,
135 
136 	TP_PROTO(struct dlm_ls *ls, struct dlm_lkb *lkb, const void *name,
137 		 unsigned int namelen, int mode, __u32 flags, int error,
138 		 bool kernel_lock),
139 
140 	TP_ARGS(ls, lkb, name, namelen, mode, flags, error, kernel_lock),
141 
142 	TP_STRUCT__entry(
143 		__field(__u32, ls_id)
144 		__field(__u32, lkb_id)
145 		__field(int, mode)
146 		__field(__u32, flags)
147 		__field(int, error)
148 		__dynamic_array(unsigned char, res_name,
149 				lkb->lkb_resource ? lkb->lkb_resource->res_length : namelen)
150 	),
151 
152 	TP_fast_assign(
153 		struct dlm_rsb *r;
154 
155 		__entry->ls_id = ls->ls_global_id;
156 		__entry->lkb_id = lkb->lkb_id;
157 		__entry->mode = mode;
158 		__entry->flags = flags;
159 		__entry->error = error;
160 
161 		r = lkb->lkb_resource;
162 		if (r)
163 			memcpy(__get_dynamic_array(res_name), r->res_name,
164 			       __get_dynamic_array_len(res_name));
165 		else if (name)
166 			memcpy(__get_dynamic_array(res_name), name,
167 			       __get_dynamic_array_len(res_name));
168 
169 		if (kernel_lock) {
170 			/* return value will be zeroed in those cases by dlm_lock()
171 			 * we do it here again to not introduce more overhead if
172 			 * trace isn't running and error reflects the return value.
173 			 */
174 			if (error == -EAGAIN || error == -EDEADLK)
175 				__entry->error = 0;
176 		}
177 
178 	),
179 
180 	TP_printk("ls_id=%u lkb_id=%x mode=%s flags=%s error=%d res_name=%s",
181 		  __entry->ls_id, __entry->lkb_id,
182 		  show_lock_mode(__entry->mode),
183 		  show_lock_flags(__entry->flags), __entry->error,
184 		  __print_hex_str(__get_dynamic_array(res_name),
185 				  __get_dynamic_array_len(res_name)))
186 
187 );
188 
189 TRACE_EVENT(dlm_bast,
190 
191 	TP_PROTO(struct dlm_ls *ls, struct dlm_lkb *lkb, int mode),
192 
193 	TP_ARGS(ls, lkb, mode),
194 
195 	TP_STRUCT__entry(
196 		__field(__u32, ls_id)
197 		__field(__u32, lkb_id)
198 		__field(int, mode)
199 		__dynamic_array(unsigned char, res_name,
200 				lkb->lkb_resource ? lkb->lkb_resource->res_length : 0)
201 	),
202 
203 	TP_fast_assign(
204 		struct dlm_rsb *r;
205 
206 		__entry->ls_id = ls->ls_global_id;
207 		__entry->lkb_id = lkb->lkb_id;
208 		__entry->mode = mode;
209 
210 		r = lkb->lkb_resource;
211 		if (r)
212 			memcpy(__get_dynamic_array(res_name), r->res_name,
213 			       __get_dynamic_array_len(res_name));
214 	),
215 
216 	TP_printk("ls_id=%u lkb_id=%x mode=%s res_name=%s",
217 		  __entry->ls_id, __entry->lkb_id,
218 		  show_lock_mode(__entry->mode),
219 		  __print_hex_str(__get_dynamic_array(res_name),
220 				  __get_dynamic_array_len(res_name)))
221 
222 );
223 
224 TRACE_EVENT(dlm_ast,
225 
226 	TP_PROTO(struct dlm_ls *ls, struct dlm_lkb *lkb),
227 
228 	TP_ARGS(ls, lkb),
229 
230 	TP_STRUCT__entry(
231 		__field(__u32, ls_id)
232 		__field(__u32, lkb_id)
233 		__field(u8, sb_flags)
234 		__field(int, sb_status)
235 		__dynamic_array(unsigned char, res_name,
236 				lkb->lkb_resource ? lkb->lkb_resource->res_length : 0)
237 	),
238 
239 	TP_fast_assign(
240 		struct dlm_rsb *r;
241 
242 		__entry->ls_id = ls->ls_global_id;
243 		__entry->lkb_id = lkb->lkb_id;
244 		__entry->sb_flags = lkb->lkb_lksb->sb_flags;
245 		__entry->sb_status = lkb->lkb_lksb->sb_status;
246 
247 		r = lkb->lkb_resource;
248 		if (r)
249 			memcpy(__get_dynamic_array(res_name), r->res_name,
250 			       __get_dynamic_array_len(res_name));
251 	),
252 
253 	TP_printk("ls_id=%u lkb_id=%x sb_flags=%s sb_status=%d res_name=%s",
254 		  __entry->ls_id, __entry->lkb_id,
255 		  show_dlm_sb_flags(__entry->sb_flags), __entry->sb_status,
256 		  __print_hex_str(__get_dynamic_array(res_name),
257 				  __get_dynamic_array_len(res_name)))
258 
259 );
260 
261 /* note: we begin tracing dlm_unlock_start() only if ls and lkb are found */
262 TRACE_EVENT(dlm_unlock_start,
263 
264 	TP_PROTO(struct dlm_ls *ls, struct dlm_lkb *lkb, __u32 flags),
265 
266 	TP_ARGS(ls, lkb, flags),
267 
268 	TP_STRUCT__entry(
269 		__field(__u32, ls_id)
270 		__field(__u32, lkb_id)
271 		__field(__u32, flags)
272 		__dynamic_array(unsigned char, res_name,
273 				lkb->lkb_resource ? lkb->lkb_resource->res_length : 0)
274 	),
275 
276 	TP_fast_assign(
277 		struct dlm_rsb *r;
278 
279 		__entry->ls_id = ls->ls_global_id;
280 		__entry->lkb_id = lkb->lkb_id;
281 		__entry->flags = flags;
282 
283 		r = lkb->lkb_resource;
284 		if (r)
285 			memcpy(__get_dynamic_array(res_name), r->res_name,
286 			       __get_dynamic_array_len(res_name));
287 	),
288 
289 	TP_printk("ls_id=%u lkb_id=%x flags=%s res_name=%s",
290 		  __entry->ls_id, __entry->lkb_id,
291 		  show_lock_flags(__entry->flags),
292 		  __print_hex_str(__get_dynamic_array(res_name),
293 				  __get_dynamic_array_len(res_name)))
294 
295 );
296 
297 TRACE_EVENT(dlm_unlock_end,
298 
299 	TP_PROTO(struct dlm_ls *ls, struct dlm_lkb *lkb, __u32 flags,
300 		 int error),
301 
302 	TP_ARGS(ls, lkb, flags, error),
303 
304 	TP_STRUCT__entry(
305 		__field(__u32, ls_id)
306 		__field(__u32, lkb_id)
307 		__field(__u32, flags)
308 		__field(int, error)
309 		__dynamic_array(unsigned char, res_name,
310 				lkb->lkb_resource ? lkb->lkb_resource->res_length : 0)
311 	),
312 
313 	TP_fast_assign(
314 		struct dlm_rsb *r;
315 
316 		__entry->ls_id = ls->ls_global_id;
317 		__entry->lkb_id = lkb->lkb_id;
318 		__entry->flags = flags;
319 		__entry->error = error;
320 
321 		r = lkb->lkb_resource;
322 		if (r)
323 			memcpy(__get_dynamic_array(res_name), r->res_name,
324 			       __get_dynamic_array_len(res_name));
325 	),
326 
327 	TP_printk("ls_id=%u lkb_id=%x flags=%s error=%d res_name=%s",
328 		  __entry->ls_id, __entry->lkb_id,
329 		  show_lock_flags(__entry->flags), __entry->error,
330 		  __print_hex_str(__get_dynamic_array(res_name),
331 				  __get_dynamic_array_len(res_name)))
332 
333 );
334 
335 DECLARE_EVENT_CLASS(dlm_rcom_template,
336 
337 	TP_PROTO(uint32_t dst, uint32_t h_seq, const struct dlm_rcom *rc),
338 
339 	TP_ARGS(dst, h_seq, rc),
340 
341 	TP_STRUCT__entry(
342 		__field(uint32_t, dst)
343 		__field(uint32_t, h_seq)
344 		__field(uint32_t, h_version)
345 		__field(uint32_t, h_lockspace)
346 		__field(uint32_t, h_nodeid)
347 		__field(uint16_t, h_length)
348 		__field(uint8_t, h_cmd)
349 		__field(uint32_t, rc_type)
350 		__field(int32_t, rc_result)
351 		__field(uint64_t, rc_id)
352 		__field(uint64_t, rc_seq)
353 		__field(uint64_t, rc_seq_reply)
354 		__dynamic_array(unsigned char, rc_buf,
355 				le16_to_cpu(rc->rc_header.h_length) - sizeof(*rc))
356 	),
357 
358 	TP_fast_assign(
359 		__entry->dst = dst;
360 		__entry->h_seq = h_seq;
361 		__entry->h_version = le32_to_cpu(rc->rc_header.h_version);
362 		__entry->h_lockspace = le32_to_cpu(rc->rc_header.u.h_lockspace);
363 		__entry->h_nodeid = le32_to_cpu(rc->rc_header.h_nodeid);
364 		__entry->h_length = le16_to_cpu(rc->rc_header.h_length);
365 		__entry->h_cmd = rc->rc_header.h_cmd;
366 		__entry->rc_type = le32_to_cpu(rc->rc_type);
367 		__entry->rc_result = le32_to_cpu(rc->rc_result);
368 		__entry->rc_id = le64_to_cpu(rc->rc_id);
369 		__entry->rc_seq = le64_to_cpu(rc->rc_seq);
370 		__entry->rc_seq_reply = le64_to_cpu(rc->rc_seq_reply);
371 		memcpy(__get_dynamic_array(rc_buf), rc->rc_buf,
372 		       __get_dynamic_array_len(rc_buf));
373 	),
374 
375 	TP_printk("dst=%u h_seq=%u h_version=%s h_lockspace=%u h_nodeid=%u "
376 		  "h_length=%u h_cmd=%s rc_type=%s rc_result=%d "
377 		  "rc_id=%llu rc_seq=%llu rc_seq_reply=%llu "
378 		  "rc_buf=0x%s", __entry->dst, __entry->h_seq,
379 		  show_message_version(__entry->h_version),
380 		  __entry->h_lockspace, __entry->h_nodeid, __entry->h_length,
381 		  show_header_cmd(__entry->h_cmd),
382 		  show_rcom_type(__entry->rc_type),
383 		  __entry->rc_result, __entry->rc_id, __entry->rc_seq,
384 		  __entry->rc_seq_reply,
385 		  __print_hex_str(__get_dynamic_array(rc_buf),
386 				  __get_dynamic_array_len(rc_buf)))
387 
388 );
389 
390 DEFINE_EVENT(dlm_rcom_template, dlm_send_rcom,
391 	     TP_PROTO(uint32_t dst, uint32_t h_seq, const struct dlm_rcom *rc),
392 	     TP_ARGS(dst, h_seq, rc));
393 
394 DEFINE_EVENT(dlm_rcom_template, dlm_recv_rcom,
395 	     TP_PROTO(uint32_t dst, uint32_t h_seq, const struct dlm_rcom *rc),
396 	     TP_ARGS(dst, h_seq, rc));
397 
398 TRACE_EVENT(dlm_send_message,
399 
400 	TP_PROTO(uint32_t dst, uint32_t h_seq, const struct dlm_message *ms,
401 		 const void *name, int namelen),
402 
403 	TP_ARGS(dst, h_seq, ms, name, namelen),
404 
405 	TP_STRUCT__entry(
406 		__field(uint32_t, dst)
407 		__field(uint32_t, h_seq)
408 		__field(uint32_t, h_version)
409 		__field(uint32_t, h_lockspace)
410 		__field(uint32_t, h_nodeid)
411 		__field(uint16_t, h_length)
412 		__field(uint8_t, h_cmd)
413 		__field(uint32_t, m_type)
414 		__field(uint32_t, m_nodeid)
415 		__field(uint32_t, m_pid)
416 		__field(uint32_t, m_lkid)
417 		__field(uint32_t, m_remid)
418 		__field(uint32_t, m_parent_lkid)
419 		__field(uint32_t, m_parent_remid)
420 		__field(uint32_t, m_exflags)
421 		__field(uint32_t, m_sbflags)
422 		__field(uint32_t, m_flags)
423 		__field(uint32_t, m_lvbseq)
424 		__field(uint32_t, m_hash)
425 		__field(int32_t, m_status)
426 		__field(int32_t, m_grmode)
427 		__field(int32_t, m_rqmode)
428 		__field(int32_t, m_bastmode)
429 		__field(int32_t, m_asts)
430 		__field(int32_t, m_result)
431 		__dynamic_array(unsigned char, m_extra,
432 				le16_to_cpu(ms->m_header.h_length) - sizeof(*ms))
433 		__dynamic_array(unsigned char, res_name, namelen)
434 	),
435 
436 	TP_fast_assign(
437 		__entry->dst = dst;
438 		__entry->h_seq = h_seq;
439 		__entry->h_version = le32_to_cpu(ms->m_header.h_version);
440 		__entry->h_lockspace = le32_to_cpu(ms->m_header.u.h_lockspace);
441 		__entry->h_nodeid = le32_to_cpu(ms->m_header.h_nodeid);
442 		__entry->h_length = le16_to_cpu(ms->m_header.h_length);
443 		__entry->h_cmd = ms->m_header.h_cmd;
444 		__entry->m_type = le32_to_cpu(ms->m_type);
445 		__entry->m_nodeid = le32_to_cpu(ms->m_nodeid);
446 		__entry->m_pid = le32_to_cpu(ms->m_pid);
447 		__entry->m_lkid = le32_to_cpu(ms->m_lkid);
448 		__entry->m_remid = le32_to_cpu(ms->m_remid);
449 		__entry->m_parent_lkid = le32_to_cpu(ms->m_parent_lkid);
450 		__entry->m_parent_remid = le32_to_cpu(ms->m_parent_remid);
451 		__entry->m_exflags = le32_to_cpu(ms->m_exflags);
452 		__entry->m_sbflags = le32_to_cpu(ms->m_sbflags);
453 		__entry->m_flags = le32_to_cpu(ms->m_flags);
454 		__entry->m_lvbseq = le32_to_cpu(ms->m_lvbseq);
455 		__entry->m_hash = le32_to_cpu(ms->m_hash);
456 		__entry->m_status = le32_to_cpu(ms->m_status);
457 		__entry->m_grmode = le32_to_cpu(ms->m_grmode);
458 		__entry->m_rqmode = le32_to_cpu(ms->m_rqmode);
459 		__entry->m_bastmode = le32_to_cpu(ms->m_bastmode);
460 		__entry->m_asts = le32_to_cpu(ms->m_asts);
461 		__entry->m_result = le32_to_cpu(ms->m_result);
462 		memcpy(__get_dynamic_array(m_extra), ms->m_extra,
463 		       __get_dynamic_array_len(m_extra));
464 		memcpy(__get_dynamic_array(res_name), name,
465 		       __get_dynamic_array_len(res_name));
466 	),
467 
468 	TP_printk("dst=%u h_seq=%u h_version=%s h_lockspace=%u h_nodeid=%u "
469 		  "h_length=%u h_cmd=%s m_type=%s m_nodeid=%u "
470 		  "m_pid=%u m_lkid=%u m_remid=%u m_parent_lkid=%u "
471 		  "m_parent_remid=%u m_exflags=%s m_sbflags=%s m_flags=%s "
472 		  "m_lvbseq=%u m_hash=%u m_status=%d m_grmode=%s "
473 		  "m_rqmode=%s m_bastmode=%s m_asts=%d m_result=%d "
474 		  "m_extra=0x%s res_name=0x%s", __entry->dst,
475 		  __entry->h_seq, show_message_version(__entry->h_version),
476 		  __entry->h_lockspace, __entry->h_nodeid, __entry->h_length,
477 		  show_header_cmd(__entry->h_cmd),
478 		  show_message_type(__entry->m_type),
479 		  __entry->m_nodeid, __entry->m_pid, __entry->m_lkid,
480 		  __entry->m_remid, __entry->m_parent_lkid,
481 		  __entry->m_parent_remid, show_lock_flags(__entry->m_exflags),
482 		  show_dlm_sb_flags(__entry->m_sbflags),
483 		  show_lkb_flags(__entry->m_flags), __entry->m_lvbseq,
484 		  __entry->m_hash, __entry->m_status,
485 		  show_lock_mode(__entry->m_grmode),
486 		  show_lock_mode(__entry->m_rqmode),
487 		  show_lock_mode(__entry->m_bastmode),
488 		  __entry->m_asts, __entry->m_result,
489 		  __print_hex_str(__get_dynamic_array(m_extra),
490 				  __get_dynamic_array_len(m_extra)),
491 		  __print_hex_str(__get_dynamic_array(res_name),
492 				  __get_dynamic_array_len(res_name)))
493 
494 );
495 
496 TRACE_EVENT(dlm_recv_message,
497 
498 	TP_PROTO(uint32_t dst, uint32_t h_seq, const struct dlm_message *ms),
499 
500 	TP_ARGS(dst, h_seq, ms),
501 
502 	TP_STRUCT__entry(
503 		__field(uint32_t, dst)
504 		__field(uint32_t, h_seq)
505 		__field(uint32_t, h_version)
506 		__field(uint32_t, h_lockspace)
507 		__field(uint32_t, h_nodeid)
508 		__field(uint16_t, h_length)
509 		__field(uint8_t, h_cmd)
510 		__field(uint32_t, m_type)
511 		__field(uint32_t, m_nodeid)
512 		__field(uint32_t, m_pid)
513 		__field(uint32_t, m_lkid)
514 		__field(uint32_t, m_remid)
515 		__field(uint32_t, m_parent_lkid)
516 		__field(uint32_t, m_parent_remid)
517 		__field(uint32_t, m_exflags)
518 		__field(uint32_t, m_sbflags)
519 		__field(uint32_t, m_flags)
520 		__field(uint32_t, m_lvbseq)
521 		__field(uint32_t, m_hash)
522 		__field(int32_t, m_status)
523 		__field(int32_t, m_grmode)
524 		__field(int32_t, m_rqmode)
525 		__field(int32_t, m_bastmode)
526 		__field(int32_t, m_asts)
527 		__field(int32_t, m_result)
528 		__dynamic_array(unsigned char, m_extra,
529 				le16_to_cpu(ms->m_header.h_length) - sizeof(*ms))
530 	),
531 
532 	TP_fast_assign(
533 		__entry->dst = dst;
534 		__entry->h_seq = h_seq;
535 		__entry->h_version = le32_to_cpu(ms->m_header.h_version);
536 		__entry->h_lockspace = le32_to_cpu(ms->m_header.u.h_lockspace);
537 		__entry->h_nodeid = le32_to_cpu(ms->m_header.h_nodeid);
538 		__entry->h_length = le16_to_cpu(ms->m_header.h_length);
539 		__entry->h_cmd = ms->m_header.h_cmd;
540 		__entry->m_type = le32_to_cpu(ms->m_type);
541 		__entry->m_nodeid = le32_to_cpu(ms->m_nodeid);
542 		__entry->m_pid = le32_to_cpu(ms->m_pid);
543 		__entry->m_lkid = le32_to_cpu(ms->m_lkid);
544 		__entry->m_remid = le32_to_cpu(ms->m_remid);
545 		__entry->m_parent_lkid = le32_to_cpu(ms->m_parent_lkid);
546 		__entry->m_parent_remid = le32_to_cpu(ms->m_parent_remid);
547 		__entry->m_exflags = le32_to_cpu(ms->m_exflags);
548 		__entry->m_sbflags = le32_to_cpu(ms->m_sbflags);
549 		__entry->m_flags = le32_to_cpu(ms->m_flags);
550 		__entry->m_lvbseq = le32_to_cpu(ms->m_lvbseq);
551 		__entry->m_hash = le32_to_cpu(ms->m_hash);
552 		__entry->m_status = le32_to_cpu(ms->m_status);
553 		__entry->m_grmode = le32_to_cpu(ms->m_grmode);
554 		__entry->m_rqmode = le32_to_cpu(ms->m_rqmode);
555 		__entry->m_bastmode = le32_to_cpu(ms->m_bastmode);
556 		__entry->m_asts = le32_to_cpu(ms->m_asts);
557 		__entry->m_result = le32_to_cpu(ms->m_result);
558 		memcpy(__get_dynamic_array(m_extra), ms->m_extra,
559 		       __get_dynamic_array_len(m_extra));
560 	),
561 
562 	TP_printk("dst=%u h_seq=%u h_version=%s h_lockspace=%u h_nodeid=%u "
563 		  "h_length=%u h_cmd=%s m_type=%s m_nodeid=%u "
564 		  "m_pid=%u m_lkid=%u m_remid=%u m_parent_lkid=%u "
565 		  "m_parent_remid=%u m_exflags=%s m_sbflags=%s m_flags=%s "
566 		  "m_lvbseq=%u m_hash=%u m_status=%d m_grmode=%s "
567 		  "m_rqmode=%s m_bastmode=%s m_asts=%d m_result=%d "
568 		  "m_extra=0x%s", __entry->dst,
569 		  __entry->h_seq, show_message_version(__entry->h_version),
570 		  __entry->h_lockspace, __entry->h_nodeid, __entry->h_length,
571 		  show_header_cmd(__entry->h_cmd),
572 		  show_message_type(__entry->m_type),
573 		  __entry->m_nodeid, __entry->m_pid, __entry->m_lkid,
574 		  __entry->m_remid, __entry->m_parent_lkid,
575 		  __entry->m_parent_remid, show_lock_flags(__entry->m_exflags),
576 		  show_dlm_sb_flags(__entry->m_sbflags),
577 		  show_lkb_flags(__entry->m_flags), __entry->m_lvbseq,
578 		  __entry->m_hash, __entry->m_status,
579 		  show_lock_mode(__entry->m_grmode),
580 		  show_lock_mode(__entry->m_rqmode),
581 		  show_lock_mode(__entry->m_bastmode),
582 		  __entry->m_asts, __entry->m_result,
583 		  __print_hex_str(__get_dynamic_array(m_extra),
584 				  __get_dynamic_array_len(m_extra)))
585 
586 );
587 
588 TRACE_EVENT(dlm_send,
589 
590 	TP_PROTO(int nodeid, int ret),
591 
592 	TP_ARGS(nodeid, ret),
593 
594 	TP_STRUCT__entry(
595 		__field(int, nodeid)
596 		__field(int, ret)
597 	),
598 
599 	TP_fast_assign(
600 		__entry->nodeid = nodeid;
601 		__entry->ret = ret;
602 	),
603 
604 	TP_printk("nodeid=%d ret=%d", __entry->nodeid, __entry->ret)
605 
606 );
607 
608 TRACE_EVENT(dlm_recv,
609 
610 	TP_PROTO(int nodeid, int ret),
611 
612 	TP_ARGS(nodeid, ret),
613 
614 	TP_STRUCT__entry(
615 		__field(int, nodeid)
616 		__field(int, ret)
617 	),
618 
619 	TP_fast_assign(
620 		__entry->nodeid = nodeid;
621 		__entry->ret = ret;
622 	),
623 
624 	TP_printk("nodeid=%d ret=%d", __entry->nodeid, __entry->ret)
625 
626 );
627 
628 #endif /* if !defined(_TRACE_DLM_H) || defined(TRACE_HEADER_MULTI_READ) */
629 
630 /* This part must be outside protection */
631 #include <trace/define_trace.h>
632