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