xref: /openbmc/linux/include/trace/events/afs.h (revision e72e8bf1)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /* AFS tracepoints
3  *
4  * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved.
5  * Written by David Howells (dhowells@redhat.com)
6  */
7 #undef TRACE_SYSTEM
8 #define TRACE_SYSTEM afs
9 
10 #if !defined(_TRACE_AFS_H) || defined(TRACE_HEADER_MULTI_READ)
11 #define _TRACE_AFS_H
12 
13 #include <linux/tracepoint.h>
14 
15 /*
16  * Define enums for tracing information.
17  */
18 #ifndef __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY
19 #define __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY
20 
21 enum afs_call_trace {
22 	afs_call_trace_alloc,
23 	afs_call_trace_free,
24 	afs_call_trace_get,
25 	afs_call_trace_put,
26 	afs_call_trace_wake,
27 	afs_call_trace_work,
28 };
29 
30 enum afs_server_trace {
31 	afs_server_trace_alloc,
32 	afs_server_trace_callback,
33 	afs_server_trace_destroy,
34 	afs_server_trace_free,
35 	afs_server_trace_gc,
36 	afs_server_trace_get_by_uuid,
37 	afs_server_trace_get_caps,
38 	afs_server_trace_get_install,
39 	afs_server_trace_get_new_cbi,
40 	afs_server_trace_give_up_cb,
41 	afs_server_trace_put_call,
42 	afs_server_trace_put_cbi,
43 	afs_server_trace_put_find_rsq,
44 	afs_server_trace_put_slist,
45 	afs_server_trace_put_slist_isort,
46 	afs_server_trace_put_uuid_rsq,
47 	afs_server_trace_update,
48 };
49 
50 enum afs_fs_operation {
51 	afs_FS_FetchData		= 130,	/* AFS Fetch file data */
52 	afs_FS_FetchACL			= 131,	/* AFS Fetch file ACL */
53 	afs_FS_FetchStatus		= 132,	/* AFS Fetch file status */
54 	afs_FS_StoreData		= 133,	/* AFS Store file data */
55 	afs_FS_StoreACL			= 134,	/* AFS Store file ACL */
56 	afs_FS_StoreStatus		= 135,	/* AFS Store file status */
57 	afs_FS_RemoveFile		= 136,	/* AFS Remove a file */
58 	afs_FS_CreateFile		= 137,	/* AFS Create a file */
59 	afs_FS_Rename			= 138,	/* AFS Rename or move a file or directory */
60 	afs_FS_Symlink			= 139,	/* AFS Create a symbolic link */
61 	afs_FS_Link			= 140,	/* AFS Create a hard link */
62 	afs_FS_MakeDir			= 141,	/* AFS Create a directory */
63 	afs_FS_RemoveDir		= 142,	/* AFS Remove a directory */
64 	afs_FS_GetVolumeInfo		= 148,	/* AFS Get information about a volume */
65 	afs_FS_GetVolumeStatus		= 149,	/* AFS Get volume status information */
66 	afs_FS_GetRootVolume		= 151,	/* AFS Get root volume name */
67 	afs_FS_SetLock			= 156,	/* AFS Request a file lock */
68 	afs_FS_ExtendLock		= 157,	/* AFS Extend a file lock */
69 	afs_FS_ReleaseLock		= 158,	/* AFS Release a file lock */
70 	afs_FS_Lookup			= 161,	/* AFS lookup file in directory */
71 	afs_FS_InlineBulkStatus		= 65536, /* AFS Fetch multiple file statuses with errors */
72 	afs_FS_FetchData64		= 65537, /* AFS Fetch file data */
73 	afs_FS_StoreData64		= 65538, /* AFS Store file data */
74 	afs_FS_GiveUpAllCallBacks	= 65539, /* AFS Give up all our callbacks on a server */
75 	afs_FS_GetCapabilities		= 65540, /* AFS Get FS server capabilities */
76 
77 	yfs_FS_FetchData		= 130,	 /* YFS Fetch file data */
78 	yfs_FS_FetchACL			= 64131, /* YFS Fetch file ACL */
79 	yfs_FS_FetchStatus		= 64132, /* YFS Fetch file status */
80 	yfs_FS_StoreACL			= 64134, /* YFS Store file ACL */
81 	yfs_FS_StoreStatus		= 64135, /* YFS Store file status */
82 	yfs_FS_RemoveFile		= 64136, /* YFS Remove a file */
83 	yfs_FS_CreateFile		= 64137, /* YFS Create a file */
84 	yfs_FS_Rename			= 64138, /* YFS Rename or move a file or directory */
85 	yfs_FS_Symlink			= 64139, /* YFS Create a symbolic link */
86 	yfs_FS_Link			= 64140, /* YFS Create a hard link */
87 	yfs_FS_MakeDir			= 64141, /* YFS Create a directory */
88 	yfs_FS_RemoveDir		= 64142, /* YFS Remove a directory */
89 	yfs_FS_GetVolumeStatus		= 64149, /* YFS Get volume status information */
90 	yfs_FS_SetVolumeStatus		= 64150, /* YFS Set volume status information */
91 	yfs_FS_SetLock			= 64156, /* YFS Request a file lock */
92 	yfs_FS_ExtendLock		= 64157, /* YFS Extend a file lock */
93 	yfs_FS_ReleaseLock		= 64158, /* YFS Release a file lock */
94 	yfs_FS_Lookup			= 64161, /* YFS lookup file in directory */
95 	yfs_FS_FlushCPS			= 64165,
96 	yfs_FS_FetchOpaqueACL		= 64168,
97 	yfs_FS_WhoAmI			= 64170,
98 	yfs_FS_RemoveACL		= 64171,
99 	yfs_FS_RemoveFile2		= 64173,
100 	yfs_FS_StoreOpaqueACL2		= 64174,
101 	yfs_FS_InlineBulkStatus		= 64536, /* YFS Fetch multiple file statuses with errors */
102 	yfs_FS_FetchData64		= 64537, /* YFS Fetch file data */
103 	yfs_FS_StoreData64		= 64538, /* YFS Store file data */
104 	yfs_FS_UpdateSymlink		= 64540,
105 };
106 
107 enum afs_vl_operation {
108 	afs_VL_GetEntryByNameU	= 527,		/* AFS Get Vol Entry By Name operation ID */
109 	afs_VL_GetAddrsU	= 533,		/* AFS Get FS server addresses */
110 	afs_YFSVL_GetEndpoints	= 64002,	/* YFS Get FS & Vol server addresses */
111 	afs_VL_GetCapabilities	= 65537,	/* AFS Get VL server capabilities */
112 };
113 
114 enum afs_edit_dir_op {
115 	afs_edit_dir_create,
116 	afs_edit_dir_create_error,
117 	afs_edit_dir_create_inval,
118 	afs_edit_dir_create_nospc,
119 	afs_edit_dir_delete,
120 	afs_edit_dir_delete_error,
121 	afs_edit_dir_delete_inval,
122 	afs_edit_dir_delete_noent,
123 };
124 
125 enum afs_edit_dir_reason {
126 	afs_edit_dir_for_create,
127 	afs_edit_dir_for_link,
128 	afs_edit_dir_for_mkdir,
129 	afs_edit_dir_for_rename_0,
130 	afs_edit_dir_for_rename_1,
131 	afs_edit_dir_for_rename_2,
132 	afs_edit_dir_for_rmdir,
133 	afs_edit_dir_for_silly_0,
134 	afs_edit_dir_for_silly_1,
135 	afs_edit_dir_for_symlink,
136 	afs_edit_dir_for_unlink,
137 };
138 
139 enum afs_eproto_cause {
140 	afs_eproto_bad_status,
141 	afs_eproto_cb_count,
142 	afs_eproto_cb_fid_count,
143 	afs_eproto_file_type,
144 	afs_eproto_ibulkst_cb_count,
145 	afs_eproto_ibulkst_count,
146 	afs_eproto_motd_len,
147 	afs_eproto_offline_msg_len,
148 	afs_eproto_volname_len,
149 	afs_eproto_yvl_fsendpt4_len,
150 	afs_eproto_yvl_fsendpt6_len,
151 	afs_eproto_yvl_fsendpt_num,
152 	afs_eproto_yvl_fsendpt_type,
153 	afs_eproto_yvl_vlendpt4_len,
154 	afs_eproto_yvl_vlendpt6_len,
155 	afs_eproto_yvl_vlendpt_type,
156 };
157 
158 enum afs_io_error {
159 	afs_io_error_cm_reply,
160 	afs_io_error_extract,
161 	afs_io_error_fs_probe_fail,
162 	afs_io_error_vl_lookup_fail,
163 	afs_io_error_vl_probe_fail,
164 };
165 
166 enum afs_file_error {
167 	afs_file_error_dir_bad_magic,
168 	afs_file_error_dir_big,
169 	afs_file_error_dir_missing_page,
170 	afs_file_error_dir_over_end,
171 	afs_file_error_dir_small,
172 	afs_file_error_dir_unmarked_ext,
173 	afs_file_error_mntpt,
174 	afs_file_error_writeback_fail,
175 };
176 
177 enum afs_flock_event {
178 	afs_flock_acquired,
179 	afs_flock_callback_break,
180 	afs_flock_defer_unlock,
181 	afs_flock_extend_fail,
182 	afs_flock_fail_other,
183 	afs_flock_fail_perm,
184 	afs_flock_no_lockers,
185 	afs_flock_release_fail,
186 	afs_flock_silly_delete,
187 	afs_flock_timestamp,
188 	afs_flock_try_to_lock,
189 	afs_flock_vfs_lock,
190 	afs_flock_vfs_locking,
191 	afs_flock_waited,
192 	afs_flock_waiting,
193 	afs_flock_work_extending,
194 	afs_flock_work_retry,
195 	afs_flock_work_unlocking,
196 	afs_flock_would_block,
197 };
198 
199 enum afs_flock_operation {
200 	afs_flock_op_copy_lock,
201 	afs_flock_op_flock,
202 	afs_flock_op_grant,
203 	afs_flock_op_lock,
204 	afs_flock_op_release_lock,
205 	afs_flock_op_return_ok,
206 	afs_flock_op_return_eagain,
207 	afs_flock_op_return_edeadlk,
208 	afs_flock_op_return_error,
209 	afs_flock_op_set_lock,
210 	afs_flock_op_unlock,
211 	afs_flock_op_wake,
212 };
213 
214 enum afs_cb_break_reason {
215 	afs_cb_break_no_break,
216 	afs_cb_break_for_callback,
217 	afs_cb_break_for_deleted,
218 	afs_cb_break_for_lapsed,
219 	afs_cb_break_for_unlink,
220 	afs_cb_break_for_vsbreak,
221 	afs_cb_break_for_volume_callback,
222 	afs_cb_break_for_zap,
223 };
224 
225 #endif /* end __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY */
226 
227 /*
228  * Declare tracing information enums and their string mappings for display.
229  */
230 #define afs_call_traces \
231 	EM(afs_call_trace_alloc,		"ALLOC") \
232 	EM(afs_call_trace_free,			"FREE ") \
233 	EM(afs_call_trace_get,			"GET  ") \
234 	EM(afs_call_trace_put,			"PUT  ") \
235 	EM(afs_call_trace_wake,			"WAKE ") \
236 	E_(afs_call_trace_work,			"QUEUE")
237 
238 #define afs_server_traces \
239 	EM(afs_server_trace_alloc,		"ALLOC    ") \
240 	EM(afs_server_trace_callback,		"CALLBACK ") \
241 	EM(afs_server_trace_destroy,		"DESTROY  ") \
242 	EM(afs_server_trace_free,		"FREE     ") \
243 	EM(afs_server_trace_gc,			"GC       ") \
244 	EM(afs_server_trace_get_by_uuid,	"GET uuid ") \
245 	EM(afs_server_trace_get_caps,		"GET caps ") \
246 	EM(afs_server_trace_get_install,	"GET inst ") \
247 	EM(afs_server_trace_get_new_cbi,	"GET cbi  ") \
248 	EM(afs_server_trace_give_up_cb,		"giveup-cb") \
249 	EM(afs_server_trace_put_call,		"PUT call ") \
250 	EM(afs_server_trace_put_cbi,		"PUT cbi  ") \
251 	EM(afs_server_trace_put_find_rsq,	"PUT f-rsq") \
252 	EM(afs_server_trace_put_slist,		"PUT slist") \
253 	EM(afs_server_trace_put_slist_isort,	"PUT isort") \
254 	EM(afs_server_trace_put_uuid_rsq,	"PUT u-req") \
255 	E_(afs_server_trace_update,		"UPDATE")
256 
257 #define afs_fs_operations \
258 	EM(afs_FS_FetchData,			"FS.FetchData") \
259 	EM(afs_FS_FetchStatus,			"FS.FetchStatus") \
260 	EM(afs_FS_StoreData,			"FS.StoreData") \
261 	EM(afs_FS_StoreStatus,			"FS.StoreStatus") \
262 	EM(afs_FS_RemoveFile,			"FS.RemoveFile") \
263 	EM(afs_FS_CreateFile,			"FS.CreateFile") \
264 	EM(afs_FS_Rename,			"FS.Rename") \
265 	EM(afs_FS_Symlink,			"FS.Symlink") \
266 	EM(afs_FS_Link,				"FS.Link") \
267 	EM(afs_FS_MakeDir,			"FS.MakeDir") \
268 	EM(afs_FS_RemoveDir,			"FS.RemoveDir") \
269 	EM(afs_FS_GetVolumeInfo,		"FS.GetVolumeInfo") \
270 	EM(afs_FS_GetVolumeStatus,		"FS.GetVolumeStatus") \
271 	EM(afs_FS_GetRootVolume,		"FS.GetRootVolume") \
272 	EM(afs_FS_SetLock,			"FS.SetLock") \
273 	EM(afs_FS_ExtendLock,			"FS.ExtendLock") \
274 	EM(afs_FS_ReleaseLock,			"FS.ReleaseLock") \
275 	EM(afs_FS_Lookup,			"FS.Lookup") \
276 	EM(afs_FS_InlineBulkStatus,		"FS.InlineBulkStatus") \
277 	EM(afs_FS_FetchData64,			"FS.FetchData64") \
278 	EM(afs_FS_StoreData64,			"FS.StoreData64") \
279 	EM(afs_FS_GiveUpAllCallBacks,		"FS.GiveUpAllCallBacks") \
280 	EM(afs_FS_GetCapabilities,		"FS.GetCapabilities") \
281 	EM(yfs_FS_FetchACL,			"YFS.FetchACL") \
282 	EM(yfs_FS_FetchStatus,			"YFS.FetchStatus") \
283 	EM(yfs_FS_StoreACL,			"YFS.StoreACL") \
284 	EM(yfs_FS_StoreStatus,			"YFS.StoreStatus") \
285 	EM(yfs_FS_RemoveFile,			"YFS.RemoveFile") \
286 	EM(yfs_FS_CreateFile,			"YFS.CreateFile") \
287 	EM(yfs_FS_Rename,			"YFS.Rename") \
288 	EM(yfs_FS_Symlink,			"YFS.Symlink") \
289 	EM(yfs_FS_Link,				"YFS.Link") \
290 	EM(yfs_FS_MakeDir,			"YFS.MakeDir") \
291 	EM(yfs_FS_RemoveDir,			"YFS.RemoveDir") \
292 	EM(yfs_FS_GetVolumeStatus,		"YFS.GetVolumeStatus") \
293 	EM(yfs_FS_SetVolumeStatus,		"YFS.SetVolumeStatus") \
294 	EM(yfs_FS_SetLock,			"YFS.SetLock") \
295 	EM(yfs_FS_ExtendLock,			"YFS.ExtendLock") \
296 	EM(yfs_FS_ReleaseLock,			"YFS.ReleaseLock") \
297 	EM(yfs_FS_Lookup,			"YFS.Lookup") \
298 	EM(yfs_FS_FlushCPS,			"YFS.FlushCPS") \
299 	EM(yfs_FS_FetchOpaqueACL,		"YFS.FetchOpaqueACL") \
300 	EM(yfs_FS_WhoAmI,			"YFS.WhoAmI") \
301 	EM(yfs_FS_RemoveACL,			"YFS.RemoveACL") \
302 	EM(yfs_FS_RemoveFile2,			"YFS.RemoveFile2") \
303 	EM(yfs_FS_StoreOpaqueACL2,		"YFS.StoreOpaqueACL2") \
304 	EM(yfs_FS_InlineBulkStatus,		"YFS.InlineBulkStatus") \
305 	EM(yfs_FS_FetchData64,			"YFS.FetchData64") \
306 	EM(yfs_FS_StoreData64,			"YFS.StoreData64") \
307 	E_(yfs_FS_UpdateSymlink,		"YFS.UpdateSymlink")
308 
309 #define afs_vl_operations \
310 	EM(afs_VL_GetEntryByNameU,		"VL.GetEntryByNameU") \
311 	EM(afs_VL_GetAddrsU,			"VL.GetAddrsU") \
312 	EM(afs_YFSVL_GetEndpoints,		"YFSVL.GetEndpoints") \
313 	E_(afs_VL_GetCapabilities,		"VL.GetCapabilities")
314 
315 #define afs_edit_dir_ops				  \
316 	EM(afs_edit_dir_create,			"create") \
317 	EM(afs_edit_dir_create_error,		"c_fail") \
318 	EM(afs_edit_dir_create_inval,		"c_invl") \
319 	EM(afs_edit_dir_create_nospc,		"c_nspc") \
320 	EM(afs_edit_dir_delete,			"delete") \
321 	EM(afs_edit_dir_delete_error,		"d_err ") \
322 	EM(afs_edit_dir_delete_inval,		"d_invl") \
323 	E_(afs_edit_dir_delete_noent,		"d_nent")
324 
325 #define afs_edit_dir_reasons				  \
326 	EM(afs_edit_dir_for_create,		"Create") \
327 	EM(afs_edit_dir_for_link,		"Link  ") \
328 	EM(afs_edit_dir_for_mkdir,		"MkDir ") \
329 	EM(afs_edit_dir_for_rename_0,		"Renam0") \
330 	EM(afs_edit_dir_for_rename_1,		"Renam1") \
331 	EM(afs_edit_dir_for_rename_2,		"Renam2") \
332 	EM(afs_edit_dir_for_rmdir,		"RmDir ") \
333 	EM(afs_edit_dir_for_silly_0,		"S_Ren0") \
334 	EM(afs_edit_dir_for_silly_1,		"S_Ren1") \
335 	EM(afs_edit_dir_for_symlink,		"Symlnk") \
336 	E_(afs_edit_dir_for_unlink,		"Unlink")
337 
338 #define afs_eproto_causes			\
339 	EM(afs_eproto_bad_status,	"BadStatus") \
340 	EM(afs_eproto_cb_count,		"CbCount") \
341 	EM(afs_eproto_cb_fid_count,	"CbFidCount") \
342 	EM(afs_eproto_file_type,	"FileTYpe") \
343 	EM(afs_eproto_ibulkst_cb_count,	"IBS.CbCount") \
344 	EM(afs_eproto_ibulkst_count,	"IBS.FidCount") \
345 	EM(afs_eproto_motd_len,		"MotdLen") \
346 	EM(afs_eproto_offline_msg_len,	"OfflineMsgLen") \
347 	EM(afs_eproto_volname_len,	"VolNameLen") \
348 	EM(afs_eproto_yvl_fsendpt4_len,	"YVL.FsEnd4Len") \
349 	EM(afs_eproto_yvl_fsendpt6_len,	"YVL.FsEnd6Len") \
350 	EM(afs_eproto_yvl_fsendpt_num,	"YVL.FsEndCount") \
351 	EM(afs_eproto_yvl_fsendpt_type,	"YVL.FsEndType") \
352 	EM(afs_eproto_yvl_vlendpt4_len,	"YVL.VlEnd4Len") \
353 	EM(afs_eproto_yvl_vlendpt6_len,	"YVL.VlEnd6Len") \
354 	E_(afs_eproto_yvl_vlendpt_type,	"YVL.VlEndType")
355 
356 #define afs_io_errors							\
357 	EM(afs_io_error_cm_reply,		"CM_REPLY")		\
358 	EM(afs_io_error_extract,		"EXTRACT")		\
359 	EM(afs_io_error_fs_probe_fail,		"FS_PROBE_FAIL")	\
360 	EM(afs_io_error_vl_lookup_fail,		"VL_LOOKUP_FAIL")	\
361 	E_(afs_io_error_vl_probe_fail,		"VL_PROBE_FAIL")
362 
363 #define afs_file_errors							\
364 	EM(afs_file_error_dir_bad_magic,	"DIR_BAD_MAGIC")	\
365 	EM(afs_file_error_dir_big,		"DIR_BIG")		\
366 	EM(afs_file_error_dir_missing_page,	"DIR_MISSING_PAGE")	\
367 	EM(afs_file_error_dir_over_end,		"DIR_ENT_OVER_END")	\
368 	EM(afs_file_error_dir_small,		"DIR_SMALL")		\
369 	EM(afs_file_error_dir_unmarked_ext,	"DIR_UNMARKED_EXT")	\
370 	EM(afs_file_error_mntpt,		"MNTPT_READ_FAILED")	\
371 	E_(afs_file_error_writeback_fail,	"WRITEBACK_FAILED")
372 
373 #define afs_flock_types							\
374 	EM(F_RDLCK,				"RDLCK")		\
375 	EM(F_WRLCK,				"WRLCK")		\
376 	E_(F_UNLCK,				"UNLCK")
377 
378 #define afs_flock_states						\
379 	EM(AFS_VNODE_LOCK_NONE,			"NONE")			\
380 	EM(AFS_VNODE_LOCK_WAITING_FOR_CB,	"WAIT_FOR_CB")		\
381 	EM(AFS_VNODE_LOCK_SETTING,		"SETTING")		\
382 	EM(AFS_VNODE_LOCK_GRANTED,		"GRANTED")		\
383 	EM(AFS_VNODE_LOCK_EXTENDING,		"EXTENDING")		\
384 	EM(AFS_VNODE_LOCK_NEED_UNLOCK,		"NEED_UNLOCK")		\
385 	EM(AFS_VNODE_LOCK_UNLOCKING,		"UNLOCKING")		\
386 	E_(AFS_VNODE_LOCK_DELETED,		"DELETED")
387 
388 #define afs_flock_events						\
389 	EM(afs_flock_acquired,			"Acquired")		\
390 	EM(afs_flock_callback_break,		"Callback")		\
391 	EM(afs_flock_defer_unlock,		"D-Unlock")		\
392 	EM(afs_flock_extend_fail,		"Ext_Fail")		\
393 	EM(afs_flock_fail_other,		"ErrOther")		\
394 	EM(afs_flock_fail_perm,			"ErrPerm ")		\
395 	EM(afs_flock_no_lockers,		"NoLocker")		\
396 	EM(afs_flock_release_fail,		"Rel_Fail")		\
397 	EM(afs_flock_silly_delete,		"SillyDel")		\
398 	EM(afs_flock_timestamp,			"Timestmp")		\
399 	EM(afs_flock_try_to_lock,		"TryToLck")		\
400 	EM(afs_flock_vfs_lock,			"VFSLock ")		\
401 	EM(afs_flock_vfs_locking,		"VFSLking")		\
402 	EM(afs_flock_waited,			"Waited  ")		\
403 	EM(afs_flock_waiting,			"Waiting ")		\
404 	EM(afs_flock_work_extending,		"Extendng")		\
405 	EM(afs_flock_work_retry,		"Retry   ")		\
406 	EM(afs_flock_work_unlocking,		"Unlcking")		\
407 	E_(afs_flock_would_block,		"EWOULDBL")
408 
409 #define afs_flock_operations						\
410 	EM(afs_flock_op_copy_lock,		"COPY    ")		\
411 	EM(afs_flock_op_flock,			"->flock ")		\
412 	EM(afs_flock_op_grant,			"GRANT   ")		\
413 	EM(afs_flock_op_lock,			"->lock  ")		\
414 	EM(afs_flock_op_release_lock,		"RELEASE ")		\
415 	EM(afs_flock_op_return_ok,		"<-OK    ")		\
416 	EM(afs_flock_op_return_edeadlk,		"<-EDEADL")		\
417 	EM(afs_flock_op_return_eagain,		"<-EAGAIN")		\
418 	EM(afs_flock_op_return_error,		"<-ERROR ")		\
419 	EM(afs_flock_op_set_lock,		"SET     ")		\
420 	EM(afs_flock_op_unlock,			"UNLOCK  ")		\
421 	E_(afs_flock_op_wake,			"WAKE    ")
422 
423 #define afs_cb_break_reasons						\
424 	EM(afs_cb_break_no_break,		"no-break")		\
425 	EM(afs_cb_break_for_callback,		"break-cb")		\
426 	EM(afs_cb_break_for_deleted,		"break-del")		\
427 	EM(afs_cb_break_for_lapsed,		"break-lapsed")		\
428 	EM(afs_cb_break_for_unlink,		"break-unlink")		\
429 	EM(afs_cb_break_for_vsbreak,		"break-vs")		\
430 	EM(afs_cb_break_for_volume_callback,	"break-v-cb")		\
431 	E_(afs_cb_break_for_zap,		"break-zap")
432 
433 /*
434  * Export enum symbols via userspace.
435  */
436 #undef EM
437 #undef E_
438 #define EM(a, b) TRACE_DEFINE_ENUM(a);
439 #define E_(a, b) TRACE_DEFINE_ENUM(a);
440 
441 afs_call_traces;
442 afs_server_traces;
443 afs_fs_operations;
444 afs_vl_operations;
445 afs_edit_dir_ops;
446 afs_edit_dir_reasons;
447 afs_eproto_causes;
448 afs_io_errors;
449 afs_file_errors;
450 afs_flock_types;
451 afs_flock_operations;
452 afs_cb_break_reasons;
453 
454 /*
455  * Now redefine the EM() and E_() macros to map the enums to the strings that
456  * will be printed in the output.
457  */
458 #undef EM
459 #undef E_
460 #define EM(a, b)	{ a, b },
461 #define E_(a, b)	{ a, b }
462 
463 TRACE_EVENT(afs_receive_data,
464 	    TP_PROTO(struct afs_call *call, struct iov_iter *iter,
465 		     bool want_more, int ret),
466 
467 	    TP_ARGS(call, iter, want_more, ret),
468 
469 	    TP_STRUCT__entry(
470 		    __field(loff_t,			remain		)
471 		    __field(unsigned int,		call		)
472 		    __field(enum afs_call_state,	state		)
473 		    __field(unsigned short,		unmarshall	)
474 		    __field(bool,			want_more	)
475 		    __field(int,			ret		)
476 			     ),
477 
478 	    TP_fast_assign(
479 		    __entry->call	= call->debug_id;
480 		    __entry->state	= call->state;
481 		    __entry->unmarshall	= call->unmarshall;
482 		    __entry->remain	= iov_iter_count(iter);
483 		    __entry->want_more	= want_more;
484 		    __entry->ret	= ret;
485 			   ),
486 
487 	    TP_printk("c=%08x r=%llu u=%u w=%u s=%u ret=%d",
488 		      __entry->call,
489 		      __entry->remain,
490 		      __entry->unmarshall,
491 		      __entry->want_more,
492 		      __entry->state,
493 		      __entry->ret)
494 	    );
495 
496 TRACE_EVENT(afs_notify_call,
497 	    TP_PROTO(struct rxrpc_call *rxcall, struct afs_call *call),
498 
499 	    TP_ARGS(rxcall, call),
500 
501 	    TP_STRUCT__entry(
502 		    __field(unsigned int,		call		)
503 		    __field(enum afs_call_state,	state		)
504 		    __field(unsigned short,		unmarshall	)
505 			     ),
506 
507 	    TP_fast_assign(
508 		    __entry->call	= call->debug_id;
509 		    __entry->state	= call->state;
510 		    __entry->unmarshall	= call->unmarshall;
511 			   ),
512 
513 	    TP_printk("c=%08x s=%u u=%u",
514 		      __entry->call,
515 		      __entry->state, __entry->unmarshall)
516 	    );
517 
518 TRACE_EVENT(afs_cb_call,
519 	    TP_PROTO(struct afs_call *call),
520 
521 	    TP_ARGS(call),
522 
523 	    TP_STRUCT__entry(
524 		    __field(unsigned int,		call		)
525 		    __field(const char *,		name		)
526 		    __field(u32,			op		)
527 			     ),
528 
529 	    TP_fast_assign(
530 		    __entry->call	= call->debug_id;
531 		    __entry->name	= call->type->name;
532 		    __entry->op		= call->operation_ID;
533 			   ),
534 
535 	    TP_printk("c=%08x %s o=%u",
536 		      __entry->call,
537 		      __entry->name,
538 		      __entry->op)
539 	    );
540 
541 TRACE_EVENT(afs_call,
542 	    TP_PROTO(struct afs_call *call, enum afs_call_trace op,
543 		     int usage, int outstanding, const void *where),
544 
545 	    TP_ARGS(call, op, usage, outstanding, where),
546 
547 	    TP_STRUCT__entry(
548 		    __field(unsigned int,		call		)
549 		    __field(int,			op		)
550 		    __field(int,			usage		)
551 		    __field(int,			outstanding	)
552 		    __field(const void *,		where		)
553 			     ),
554 
555 	    TP_fast_assign(
556 		    __entry->call = call->debug_id;
557 		    __entry->op = op;
558 		    __entry->usage = usage;
559 		    __entry->outstanding = outstanding;
560 		    __entry->where = where;
561 			   ),
562 
563 	    TP_printk("c=%08x %s u=%d o=%d sp=%pSR",
564 		      __entry->call,
565 		      __print_symbolic(__entry->op, afs_call_traces),
566 		      __entry->usage,
567 		      __entry->outstanding,
568 		      __entry->where)
569 	    );
570 
571 TRACE_EVENT(afs_make_fs_call,
572 	    TP_PROTO(struct afs_call *call, const struct afs_fid *fid),
573 
574 	    TP_ARGS(call, fid),
575 
576 	    TP_STRUCT__entry(
577 		    __field(unsigned int,		call		)
578 		    __field(enum afs_fs_operation,	op		)
579 		    __field_struct(struct afs_fid,	fid		)
580 			     ),
581 
582 	    TP_fast_assign(
583 		    __entry->call = call->debug_id;
584 		    __entry->op = call->operation_ID;
585 		    if (fid) {
586 			    __entry->fid = *fid;
587 		    } else {
588 			    __entry->fid.vid = 0;
589 			    __entry->fid.vnode = 0;
590 			    __entry->fid.unique = 0;
591 		    }
592 			   ),
593 
594 	    TP_printk("c=%08x %06llx:%06llx:%06x %s",
595 		      __entry->call,
596 		      __entry->fid.vid,
597 		      __entry->fid.vnode,
598 		      __entry->fid.unique,
599 		      __print_symbolic(__entry->op, afs_fs_operations))
600 	    );
601 
602 TRACE_EVENT(afs_make_fs_calli,
603 	    TP_PROTO(struct afs_call *call, const struct afs_fid *fid,
604 		     unsigned int i),
605 
606 	    TP_ARGS(call, fid, i),
607 
608 	    TP_STRUCT__entry(
609 		    __field(unsigned int,		call		)
610 		    __field(unsigned int,		i		)
611 		    __field(enum afs_fs_operation,	op		)
612 		    __field_struct(struct afs_fid,	fid		)
613 			     ),
614 
615 	    TP_fast_assign(
616 		    __entry->call = call->debug_id;
617 		    __entry->i = i;
618 		    __entry->op = call->operation_ID;
619 		    if (fid) {
620 			    __entry->fid = *fid;
621 		    } else {
622 			    __entry->fid.vid = 0;
623 			    __entry->fid.vnode = 0;
624 			    __entry->fid.unique = 0;
625 		    }
626 			   ),
627 
628 	    TP_printk("c=%08x %06llx:%06llx:%06x %s i=%u",
629 		      __entry->call,
630 		      __entry->fid.vid,
631 		      __entry->fid.vnode,
632 		      __entry->fid.unique,
633 		      __print_symbolic(__entry->op, afs_fs_operations),
634 		      __entry->i)
635 	    );
636 
637 TRACE_EVENT(afs_make_fs_call1,
638 	    TP_PROTO(struct afs_call *call, const struct afs_fid *fid,
639 		     const char *name),
640 
641 	    TP_ARGS(call, fid, name),
642 
643 	    TP_STRUCT__entry(
644 		    __field(unsigned int,		call		)
645 		    __field(enum afs_fs_operation,	op		)
646 		    __field_struct(struct afs_fid,	fid		)
647 		    __array(char,			name, 24	)
648 			     ),
649 
650 	    TP_fast_assign(
651 		    int __len = strlen(name);
652 		    __len = min(__len, 23);
653 		    __entry->call = call->debug_id;
654 		    __entry->op = call->operation_ID;
655 		    if (fid) {
656 			    __entry->fid = *fid;
657 		    } else {
658 			    __entry->fid.vid = 0;
659 			    __entry->fid.vnode = 0;
660 			    __entry->fid.unique = 0;
661 		    }
662 		    memcpy(__entry->name, name, __len);
663 		    __entry->name[__len] = 0;
664 			   ),
665 
666 	    TP_printk("c=%08x %06llx:%06llx:%06x %s \"%s\"",
667 		      __entry->call,
668 		      __entry->fid.vid,
669 		      __entry->fid.vnode,
670 		      __entry->fid.unique,
671 		      __print_symbolic(__entry->op, afs_fs_operations),
672 		      __entry->name)
673 	    );
674 
675 TRACE_EVENT(afs_make_fs_call2,
676 	    TP_PROTO(struct afs_call *call, const struct afs_fid *fid,
677 		     const char *name, const char *name2),
678 
679 	    TP_ARGS(call, fid, name, name2),
680 
681 	    TP_STRUCT__entry(
682 		    __field(unsigned int,		call		)
683 		    __field(enum afs_fs_operation,	op		)
684 		    __field_struct(struct afs_fid,	fid		)
685 		    __array(char,			name, 24	)
686 		    __array(char,			name2, 24	)
687 			     ),
688 
689 	    TP_fast_assign(
690 		    int __len = strlen(name);
691 		    int __len2 = strlen(name2);
692 		    __len = min(__len, 23);
693 		    __len2 = min(__len2, 23);
694 		    __entry->call = call->debug_id;
695 		    __entry->op = call->operation_ID;
696 		    if (fid) {
697 			    __entry->fid = *fid;
698 		    } else {
699 			    __entry->fid.vid = 0;
700 			    __entry->fid.vnode = 0;
701 			    __entry->fid.unique = 0;
702 		    }
703 		    memcpy(__entry->name, name, __len);
704 		    __entry->name[__len] = 0;
705 		    memcpy(__entry->name2, name2, __len2);
706 		    __entry->name2[__len2] = 0;
707 			   ),
708 
709 	    TP_printk("c=%08x %06llx:%06llx:%06x %s \"%s\" \"%s\"",
710 		      __entry->call,
711 		      __entry->fid.vid,
712 		      __entry->fid.vnode,
713 		      __entry->fid.unique,
714 		      __print_symbolic(__entry->op, afs_fs_operations),
715 		      __entry->name,
716 		      __entry->name2)
717 	    );
718 
719 TRACE_EVENT(afs_make_vl_call,
720 	    TP_PROTO(struct afs_call *call),
721 
722 	    TP_ARGS(call),
723 
724 	    TP_STRUCT__entry(
725 		    __field(unsigned int,		call		)
726 		    __field(enum afs_vl_operation,	op		)
727 			     ),
728 
729 	    TP_fast_assign(
730 		    __entry->call = call->debug_id;
731 		    __entry->op = call->operation_ID;
732 			   ),
733 
734 	    TP_printk("c=%08x %s",
735 		      __entry->call,
736 		      __print_symbolic(__entry->op, afs_vl_operations))
737 	    );
738 
739 TRACE_EVENT(afs_call_done,
740 	    TP_PROTO(struct afs_call *call),
741 
742 	    TP_ARGS(call),
743 
744 	    TP_STRUCT__entry(
745 		    __field(unsigned int,		call		)
746 		    __field(struct rxrpc_call *,	rx_call		)
747 		    __field(int,			ret		)
748 		    __field(u32,			abort_code	)
749 			     ),
750 
751 	    TP_fast_assign(
752 		    __entry->call = call->debug_id;
753 		    __entry->rx_call = call->rxcall;
754 		    __entry->ret = call->error;
755 		    __entry->abort_code = call->abort_code;
756 			   ),
757 
758 	    TP_printk("   c=%08x ret=%d ab=%d [%p]",
759 		      __entry->call,
760 		      __entry->ret,
761 		      __entry->abort_code,
762 		      __entry->rx_call)
763 	    );
764 
765 TRACE_EVENT(afs_send_pages,
766 	    TP_PROTO(struct afs_call *call, struct msghdr *msg,
767 		     pgoff_t first, pgoff_t last, unsigned int offset),
768 
769 	    TP_ARGS(call, msg, first, last, offset),
770 
771 	    TP_STRUCT__entry(
772 		    __field(unsigned int,		call		)
773 		    __field(pgoff_t,			first		)
774 		    __field(pgoff_t,			last		)
775 		    __field(unsigned int,		nr		)
776 		    __field(unsigned int,		bytes		)
777 		    __field(unsigned int,		offset		)
778 		    __field(unsigned int,		flags		)
779 			     ),
780 
781 	    TP_fast_assign(
782 		    __entry->call = call->debug_id;
783 		    __entry->first = first;
784 		    __entry->last = last;
785 		    __entry->nr = msg->msg_iter.nr_segs;
786 		    __entry->bytes = msg->msg_iter.count;
787 		    __entry->offset = offset;
788 		    __entry->flags = msg->msg_flags;
789 			   ),
790 
791 	    TP_printk(" c=%08x %lx-%lx-%lx b=%x o=%x f=%x",
792 		      __entry->call,
793 		      __entry->first, __entry->first + __entry->nr - 1, __entry->last,
794 		      __entry->bytes, __entry->offset,
795 		      __entry->flags)
796 	    );
797 
798 TRACE_EVENT(afs_sent_pages,
799 	    TP_PROTO(struct afs_call *call, pgoff_t first, pgoff_t last,
800 		     pgoff_t cursor, int ret),
801 
802 	    TP_ARGS(call, first, last, cursor, ret),
803 
804 	    TP_STRUCT__entry(
805 		    __field(unsigned int,		call		)
806 		    __field(pgoff_t,			first		)
807 		    __field(pgoff_t,			last		)
808 		    __field(pgoff_t,			cursor		)
809 		    __field(int,			ret		)
810 			     ),
811 
812 	    TP_fast_assign(
813 		    __entry->call = call->debug_id;
814 		    __entry->first = first;
815 		    __entry->last = last;
816 		    __entry->cursor = cursor;
817 		    __entry->ret = ret;
818 			   ),
819 
820 	    TP_printk(" c=%08x %lx-%lx c=%lx r=%d",
821 		      __entry->call,
822 		      __entry->first, __entry->last,
823 		      __entry->cursor, __entry->ret)
824 	    );
825 
826 TRACE_EVENT(afs_dir_check_failed,
827 	    TP_PROTO(struct afs_vnode *vnode, loff_t off, loff_t i_size),
828 
829 	    TP_ARGS(vnode, off, i_size),
830 
831 	    TP_STRUCT__entry(
832 		    __field(struct afs_vnode *,		vnode		)
833 		    __field(loff_t,			off		)
834 		    __field(loff_t,			i_size		)
835 			     ),
836 
837 	    TP_fast_assign(
838 		    __entry->vnode = vnode;
839 		    __entry->off = off;
840 		    __entry->i_size = i_size;
841 			   ),
842 
843 	    TP_printk("vn=%p %llx/%llx",
844 		      __entry->vnode, __entry->off, __entry->i_size)
845 	    );
846 
847 /*
848  * We use page->private to hold the amount of the page that we've written to,
849  * splitting the field into two parts.  However, we need to represent a range
850  * 0...PAGE_SIZE inclusive, so we can't support 64K pages on a 32-bit system.
851  */
852 #if PAGE_SIZE > 32768
853 #define AFS_PRIV_MAX	0xffffffff
854 #define AFS_PRIV_SHIFT	32
855 #else
856 #define AFS_PRIV_MAX	0xffff
857 #define AFS_PRIV_SHIFT	16
858 #endif
859 
860 TRACE_EVENT(afs_page_dirty,
861 	    TP_PROTO(struct afs_vnode *vnode, const char *where,
862 		     pgoff_t page, unsigned long priv),
863 
864 	    TP_ARGS(vnode, where, page, priv),
865 
866 	    TP_STRUCT__entry(
867 		    __field(struct afs_vnode *,		vnode		)
868 		    __field(const char *,		where		)
869 		    __field(pgoff_t,			page		)
870 		    __field(unsigned long,		priv		)
871 			     ),
872 
873 	    TP_fast_assign(
874 		    __entry->vnode = vnode;
875 		    __entry->where = where;
876 		    __entry->page = page;
877 		    __entry->priv = priv;
878 			   ),
879 
880 	    TP_printk("vn=%p %lx %s %lu-%lu",
881 		      __entry->vnode, __entry->page, __entry->where,
882 		      __entry->priv & AFS_PRIV_MAX,
883 		      __entry->priv >> AFS_PRIV_SHIFT)
884 	    );
885 
886 TRACE_EVENT(afs_call_state,
887 	    TP_PROTO(struct afs_call *call,
888 		     enum afs_call_state from,
889 		     enum afs_call_state to,
890 		     int ret, u32 remote_abort),
891 
892 	    TP_ARGS(call, from, to, ret, remote_abort),
893 
894 	    TP_STRUCT__entry(
895 		    __field(unsigned int,		call		)
896 		    __field(enum afs_call_state,	from		)
897 		    __field(enum afs_call_state,	to		)
898 		    __field(int,			ret		)
899 		    __field(u32,			abort		)
900 			     ),
901 
902 	    TP_fast_assign(
903 		    __entry->call = call->debug_id;
904 		    __entry->from = from;
905 		    __entry->to = to;
906 		    __entry->ret = ret;
907 		    __entry->abort = remote_abort;
908 			   ),
909 
910 	    TP_printk("c=%08x %u->%u r=%d ab=%d",
911 		      __entry->call,
912 		      __entry->from, __entry->to,
913 		      __entry->ret, __entry->abort)
914 	    );
915 
916 TRACE_EVENT(afs_lookup,
917 	    TP_PROTO(struct afs_vnode *dvnode, const struct qstr *name,
918 		     struct afs_fid *fid),
919 
920 	    TP_ARGS(dvnode, name, fid),
921 
922 	    TP_STRUCT__entry(
923 		    __field_struct(struct afs_fid,	dfid		)
924 		    __field_struct(struct afs_fid,	fid		)
925 		    __array(char,			name, 24	)
926 			     ),
927 
928 	    TP_fast_assign(
929 		    int __len = min_t(int, name->len, 23);
930 		    __entry->dfid = dvnode->fid;
931 		    __entry->fid = *fid;
932 		    memcpy(__entry->name, name->name, __len);
933 		    __entry->name[__len] = 0;
934 			   ),
935 
936 	    TP_printk("d=%llx:%llx:%x \"%s\" f=%llx:%x",
937 		      __entry->dfid.vid, __entry->dfid.vnode, __entry->dfid.unique,
938 		      __entry->name,
939 		      __entry->fid.vnode, __entry->fid.unique)
940 	    );
941 
942 TRACE_EVENT(afs_edit_dir,
943 	    TP_PROTO(struct afs_vnode *dvnode,
944 		     enum afs_edit_dir_reason why,
945 		     enum afs_edit_dir_op op,
946 		     unsigned int block,
947 		     unsigned int slot,
948 		     unsigned int f_vnode,
949 		     unsigned int f_unique,
950 		     const char *name),
951 
952 	    TP_ARGS(dvnode, why, op, block, slot, f_vnode, f_unique, name),
953 
954 	    TP_STRUCT__entry(
955 		    __field(unsigned int,		vnode		)
956 		    __field(unsigned int,		unique		)
957 		    __field(enum afs_edit_dir_reason,	why		)
958 		    __field(enum afs_edit_dir_op,	op		)
959 		    __field(unsigned int,		block		)
960 		    __field(unsigned short,		slot		)
961 		    __field(unsigned int,		f_vnode		)
962 		    __field(unsigned int,		f_unique	)
963 		    __array(char,			name, 24	)
964 			     ),
965 
966 	    TP_fast_assign(
967 		    int __len = strlen(name);
968 		    __len = min(__len, 23);
969 		    __entry->vnode	= dvnode->fid.vnode;
970 		    __entry->unique	= dvnode->fid.unique;
971 		    __entry->why	= why;
972 		    __entry->op		= op;
973 		    __entry->block	= block;
974 		    __entry->slot	= slot;
975 		    __entry->f_vnode	= f_vnode;
976 		    __entry->f_unique	= f_unique;
977 		    memcpy(__entry->name, name, __len);
978 		    __entry->name[__len] = 0;
979 			   ),
980 
981 	    TP_printk("d=%x:%x %s %s %u[%u] f=%x:%x \"%s\"",
982 		      __entry->vnode, __entry->unique,
983 		      __print_symbolic(__entry->why, afs_edit_dir_reasons),
984 		      __print_symbolic(__entry->op, afs_edit_dir_ops),
985 		      __entry->block, __entry->slot,
986 		      __entry->f_vnode, __entry->f_unique,
987 		      __entry->name)
988 	    );
989 
990 TRACE_EVENT(afs_protocol_error,
991 	    TP_PROTO(struct afs_call *call, int error, enum afs_eproto_cause cause),
992 
993 	    TP_ARGS(call, error, cause),
994 
995 	    TP_STRUCT__entry(
996 		    __field(unsigned int,		call		)
997 		    __field(int,			error		)
998 		    __field(enum afs_eproto_cause,	cause		)
999 			     ),
1000 
1001 	    TP_fast_assign(
1002 		    __entry->call = call ? call->debug_id : 0;
1003 		    __entry->error = error;
1004 		    __entry->cause = cause;
1005 			   ),
1006 
1007 	    TP_printk("c=%08x r=%d %s",
1008 		      __entry->call, __entry->error,
1009 		      __print_symbolic(__entry->cause, afs_eproto_causes))
1010 	    );
1011 
1012 TRACE_EVENT(afs_io_error,
1013 	    TP_PROTO(unsigned int call, int error, enum afs_io_error where),
1014 
1015 	    TP_ARGS(call, error, where),
1016 
1017 	    TP_STRUCT__entry(
1018 		    __field(unsigned int,	call		)
1019 		    __field(int,		error		)
1020 		    __field(enum afs_io_error,	where		)
1021 			     ),
1022 
1023 	    TP_fast_assign(
1024 		    __entry->call = call;
1025 		    __entry->error = error;
1026 		    __entry->where = where;
1027 			   ),
1028 
1029 	    TP_printk("c=%08x r=%d %s",
1030 		      __entry->call, __entry->error,
1031 		      __print_symbolic(__entry->where, afs_io_errors))
1032 	    );
1033 
1034 TRACE_EVENT(afs_file_error,
1035 	    TP_PROTO(struct afs_vnode *vnode, int error, enum afs_file_error where),
1036 
1037 	    TP_ARGS(vnode, error, where),
1038 
1039 	    TP_STRUCT__entry(
1040 		    __field_struct(struct afs_fid,	fid		)
1041 		    __field(int,			error		)
1042 		    __field(enum afs_file_error,	where		)
1043 			     ),
1044 
1045 	    TP_fast_assign(
1046 		    __entry->fid = vnode->fid;
1047 		    __entry->error = error;
1048 		    __entry->where = where;
1049 			   ),
1050 
1051 	    TP_printk("%llx:%llx:%x r=%d %s",
1052 		      __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1053 		      __entry->error,
1054 		      __print_symbolic(__entry->where, afs_file_errors))
1055 	    );
1056 
1057 TRACE_EVENT(afs_cm_no_server,
1058 	    TP_PROTO(struct afs_call *call, struct sockaddr_rxrpc *srx),
1059 
1060 	    TP_ARGS(call, srx),
1061 
1062 	    TP_STRUCT__entry(
1063 		    __field(unsigned int,			call	)
1064 		    __field(unsigned int,			op_id	)
1065 		    __field_struct(struct sockaddr_rxrpc,	srx	)
1066 			     ),
1067 
1068 	    TP_fast_assign(
1069 		    __entry->call = call->debug_id;
1070 		    __entry->op_id = call->operation_ID;
1071 		    memcpy(&__entry->srx, srx, sizeof(__entry->srx));
1072 			   ),
1073 
1074 	    TP_printk("c=%08x op=%u %pISpc",
1075 		      __entry->call, __entry->op_id, &__entry->srx.transport)
1076 	    );
1077 
1078 TRACE_EVENT(afs_cm_no_server_u,
1079 	    TP_PROTO(struct afs_call *call, const uuid_t *uuid),
1080 
1081 	    TP_ARGS(call, uuid),
1082 
1083 	    TP_STRUCT__entry(
1084 		    __field(unsigned int,			call	)
1085 		    __field(unsigned int,			op_id	)
1086 		    __field_struct(uuid_t,			uuid	)
1087 			     ),
1088 
1089 	    TP_fast_assign(
1090 		    __entry->call = call->debug_id;
1091 		    __entry->op_id = call->operation_ID;
1092 		    memcpy(&__entry->uuid, uuid, sizeof(__entry->uuid));
1093 			   ),
1094 
1095 	    TP_printk("c=%08x op=%u %pU",
1096 		      __entry->call, __entry->op_id, &__entry->uuid)
1097 	    );
1098 
1099 TRACE_EVENT(afs_flock_ev,
1100 	    TP_PROTO(struct afs_vnode *vnode, struct file_lock *fl,
1101 		     enum afs_flock_event event, int error),
1102 
1103 	    TP_ARGS(vnode, fl, event, error),
1104 
1105 	    TP_STRUCT__entry(
1106 		    __field_struct(struct afs_fid,	fid		)
1107 		    __field(enum afs_flock_event,	event		)
1108 		    __field(enum afs_lock_state,	state		)
1109 		    __field(int,			error		)
1110 		    __field(unsigned int,		debug_id	)
1111 			     ),
1112 
1113 	    TP_fast_assign(
1114 		    __entry->fid = vnode->fid;
1115 		    __entry->event = event;
1116 		    __entry->state = vnode->lock_state;
1117 		    __entry->error = error;
1118 		    __entry->debug_id = fl ? fl->fl_u.afs.debug_id : 0;
1119 			   ),
1120 
1121 	    TP_printk("%llx:%llx:%x %04x %s s=%s e=%d",
1122 		      __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1123 		      __entry->debug_id,
1124 		      __print_symbolic(__entry->event, afs_flock_events),
1125 		      __print_symbolic(__entry->state, afs_flock_states),
1126 		      __entry->error)
1127 	    );
1128 
1129 TRACE_EVENT(afs_flock_op,
1130 	    TP_PROTO(struct afs_vnode *vnode, struct file_lock *fl,
1131 		     enum afs_flock_operation op),
1132 
1133 	    TP_ARGS(vnode, fl, op),
1134 
1135 	    TP_STRUCT__entry(
1136 		    __field_struct(struct afs_fid,	fid		)
1137 		    __field(loff_t,			from		)
1138 		    __field(loff_t,			len		)
1139 		    __field(enum afs_flock_operation,	op		)
1140 		    __field(unsigned char,		type		)
1141 		    __field(unsigned int,		flags		)
1142 		    __field(unsigned int,		debug_id	)
1143 			     ),
1144 
1145 	    TP_fast_assign(
1146 		    __entry->fid = vnode->fid;
1147 		    __entry->from = fl->fl_start;
1148 		    __entry->len = fl->fl_end - fl->fl_start + 1;
1149 		    __entry->op = op;
1150 		    __entry->type = fl->fl_type;
1151 		    __entry->flags = fl->fl_flags;
1152 		    __entry->debug_id = fl->fl_u.afs.debug_id;
1153 			   ),
1154 
1155 	    TP_printk("%llx:%llx:%x %04x %s t=%s R=%llx/%llx f=%x",
1156 		      __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1157 		      __entry->debug_id,
1158 		      __print_symbolic(__entry->op, afs_flock_operations),
1159 		      __print_symbolic(__entry->type, afs_flock_types),
1160 		      __entry->from, __entry->len, __entry->flags)
1161 	    );
1162 
1163 TRACE_EVENT(afs_reload_dir,
1164 	    TP_PROTO(struct afs_vnode *vnode),
1165 
1166 	    TP_ARGS(vnode),
1167 
1168 	    TP_STRUCT__entry(
1169 		    __field_struct(struct afs_fid,	fid		)
1170 			     ),
1171 
1172 	    TP_fast_assign(
1173 		    __entry->fid = vnode->fid;
1174 			   ),
1175 
1176 	    TP_printk("%llx:%llx:%x",
1177 		      __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique)
1178 	    );
1179 
1180 TRACE_EVENT(afs_silly_rename,
1181 	    TP_PROTO(struct afs_vnode *vnode, bool done),
1182 
1183 	    TP_ARGS(vnode, done),
1184 
1185 	    TP_STRUCT__entry(
1186 		    __field_struct(struct afs_fid,	fid		)
1187 		    __field(bool,			done		)
1188 			     ),
1189 
1190 	    TP_fast_assign(
1191 		    __entry->fid = vnode->fid;
1192 		    __entry->done = done;
1193 			   ),
1194 
1195 	    TP_printk("%llx:%llx:%x done=%u",
1196 		      __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1197 		      __entry->done)
1198 	    );
1199 
1200 TRACE_EVENT(afs_get_tree,
1201 	    TP_PROTO(struct afs_cell *cell, struct afs_volume *volume),
1202 
1203 	    TP_ARGS(cell, volume),
1204 
1205 	    TP_STRUCT__entry(
1206 		    __field(u64,			vid		)
1207 		    __array(char,			cell, 24	)
1208 		    __array(char,			volume, 24	)
1209 			     ),
1210 
1211 	    TP_fast_assign(
1212 		    int __len;
1213 		    __entry->vid = volume->vid;
1214 		    __len = min_t(int, cell->name_len, 23);
1215 		    memcpy(__entry->cell, cell->name, __len);
1216 		    __entry->cell[__len] = 0;
1217 		    __len = min_t(int, volume->name_len, 23);
1218 		    memcpy(__entry->volume, volume->name, __len);
1219 		    __entry->volume[__len] = 0;
1220 			   ),
1221 
1222 	    TP_printk("--- MOUNT %s:%s %llx",
1223 		      __entry->cell, __entry->volume, __entry->vid)
1224 	    );
1225 
1226 TRACE_EVENT(afs_cb_break,
1227 	    TP_PROTO(struct afs_fid *fid, unsigned int cb_break,
1228 		     enum afs_cb_break_reason reason, bool skipped),
1229 
1230 	    TP_ARGS(fid, cb_break, reason, skipped),
1231 
1232 	    TP_STRUCT__entry(
1233 		    __field_struct(struct afs_fid,	fid		)
1234 		    __field(unsigned int,		cb_break	)
1235 		    __field(enum afs_cb_break_reason,	reason		)
1236 		    __field(bool,			skipped		)
1237 			     ),
1238 
1239 	    TP_fast_assign(
1240 		    __entry->fid	= *fid;
1241 		    __entry->cb_break	= cb_break;
1242 		    __entry->reason	= reason;
1243 		    __entry->skipped	= skipped;
1244 			   ),
1245 
1246 	    TP_printk("%llx:%llx:%x b=%x s=%u %s",
1247 		      __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1248 		      __entry->cb_break,
1249 		      __entry->skipped,
1250 		      __print_symbolic(__entry->reason, afs_cb_break_reasons))
1251 	    );
1252 
1253 TRACE_EVENT(afs_cb_miss,
1254 	    TP_PROTO(struct afs_fid *fid, enum afs_cb_break_reason reason),
1255 
1256 	    TP_ARGS(fid, reason),
1257 
1258 	    TP_STRUCT__entry(
1259 		    __field_struct(struct afs_fid,	fid		)
1260 		    __field(enum afs_cb_break_reason,	reason		)
1261 			     ),
1262 
1263 	    TP_fast_assign(
1264 		    __entry->fid	= *fid;
1265 		    __entry->reason	= reason;
1266 			   ),
1267 
1268 	    TP_printk(" %llx:%llx:%x %s",
1269 		      __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1270 		      __print_symbolic(__entry->reason, afs_cb_break_reasons))
1271 	    );
1272 
1273 TRACE_EVENT(afs_server,
1274 	    TP_PROTO(struct afs_server *server, int usage, enum afs_server_trace reason),
1275 
1276 	    TP_ARGS(server, usage, reason),
1277 
1278 	    TP_STRUCT__entry(
1279 		    __field(unsigned int,		server		)
1280 		    __field(int,			usage		)
1281 		    __field(int,			reason		)
1282 			     ),
1283 
1284 	    TP_fast_assign(
1285 		    __entry->server = server->debug_id;
1286 		    __entry->usage = usage;
1287 		    __entry->reason = reason;
1288 			   ),
1289 
1290 	    TP_printk("s=%08x %s u=%d",
1291 		      __entry->server,
1292 		      __print_symbolic(__entry->reason, afs_server_traces),
1293 		      __entry->usage)
1294 	    );
1295 
1296 #endif /* _TRACE_AFS_H */
1297 
1298 /* This part must be outside protection */
1299 #include <trace/define_trace.h>
1300