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