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