xref: /linux/include/trace/events/afs.h (revision 1cbfb828e05171ca2dd77b5988d068e6872480fe)
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_async_abort,		"ASYAB") \
122 	EM(afs_call_trace_async_kill,		"ASYKL") \
123 	EM(afs_call_trace_free,			"FREE ") \
124 	EM(afs_call_trace_get,			"GET  ") \
125 	EM(afs_call_trace_put,			"PUT  ") \
126 	EM(afs_call_trace_wake,			"WAKE ") \
127 	E_(afs_call_trace_work,			"QUEUE")
128 
129 #define afs_server_traces \
130 	EM(afs_server_trace_alloc,		"ALLOC    ") \
131 	EM(afs_server_trace_callback,		"CALLBACK ") \
132 	EM(afs_server_trace_destroy,		"DESTROY  ") \
133 	EM(afs_server_trace_free,		"FREE     ") \
134 	EM(afs_server_trace_gc,			"GC       ") \
135 	EM(afs_server_trace_get_by_addr,	"GET addr ") \
136 	EM(afs_server_trace_get_by_uuid,	"GET uuid ") \
137 	EM(afs_server_trace_get_caps,		"GET caps ") \
138 	EM(afs_server_trace_get_install,	"GET inst ") \
139 	EM(afs_server_trace_get_new_cbi,	"GET cbi  ") \
140 	EM(afs_server_trace_get_probe,		"GET probe") \
141 	EM(afs_server_trace_give_up_cb,		"giveup-cb") \
142 	EM(afs_server_trace_purging,		"PURGE    ") \
143 	EM(afs_server_trace_put_call,		"PUT call ") \
144 	EM(afs_server_trace_put_cbi,		"PUT cbi  ") \
145 	EM(afs_server_trace_put_find_rsq,	"PUT f-rsq") \
146 	EM(afs_server_trace_put_probe,		"PUT probe") \
147 	EM(afs_server_trace_put_slist,		"PUT slist") \
148 	EM(afs_server_trace_put_slist_isort,	"PUT isort") \
149 	EM(afs_server_trace_put_uuid_rsq,	"PUT u-req") \
150 	E_(afs_server_trace_update,		"UPDATE")
151 
152 #define afs_volume_traces \
153 	EM(afs_volume_trace_alloc,		"ALLOC         ") \
154 	EM(afs_volume_trace_free,		"FREE          ") \
155 	EM(afs_volume_trace_get_alloc_sbi,	"GET sbi-alloc ") \
156 	EM(afs_volume_trace_get_callback,	"GET callback  ") \
157 	EM(afs_volume_trace_get_cell_insert,	"GET cell-insrt") \
158 	EM(afs_volume_trace_get_new_op,		"GET op-new    ") \
159 	EM(afs_volume_trace_get_query_alias,	"GET cell-alias") \
160 	EM(afs_volume_trace_put_callback,	"PUT callback  ") \
161 	EM(afs_volume_trace_put_cell_dup,	"PUT cell-dup  ") \
162 	EM(afs_volume_trace_put_cell_root,	"PUT cell-root ") \
163 	EM(afs_volume_trace_put_destroy_sbi,	"PUT sbi-destry") \
164 	EM(afs_volume_trace_put_free_fc,	"PUT fc-free   ") \
165 	EM(afs_volume_trace_put_put_op,		"PUT op-put    ") \
166 	EM(afs_volume_trace_put_query_alias,	"PUT cell-alias") \
167 	EM(afs_volume_trace_put_validate_fc,	"PUT fc-validat") \
168 	E_(afs_volume_trace_remove,		"REMOVE        ")
169 
170 #define afs_cell_traces \
171 	EM(afs_cell_trace_alloc,		"ALLOC     ") \
172 	EM(afs_cell_trace_free,			"FREE      ") \
173 	EM(afs_cell_trace_get_atcell,		"GET atcell") \
174 	EM(afs_cell_trace_get_queue_dns,	"GET q-dns ") \
175 	EM(afs_cell_trace_get_queue_manage,	"GET q-mng ") \
176 	EM(afs_cell_trace_get_queue_new,	"GET q-new ") \
177 	EM(afs_cell_trace_get_vol,		"GET vol   ") \
178 	EM(afs_cell_trace_insert,		"INSERT    ") \
179 	EM(afs_cell_trace_manage,		"MANAGE    ") \
180 	EM(afs_cell_trace_put_atcell,		"PUT atcell") \
181 	EM(afs_cell_trace_put_candidate,	"PUT candid") \
182 	EM(afs_cell_trace_put_destroy,		"PUT destry") \
183 	EM(afs_cell_trace_put_queue_work,	"PUT q-work") \
184 	EM(afs_cell_trace_put_queue_fail,	"PUT q-fail") \
185 	EM(afs_cell_trace_put_vol,		"PUT vol   ") \
186 	EM(afs_cell_trace_see_source,		"SEE source") \
187 	EM(afs_cell_trace_see_ws,		"SEE ws    ") \
188 	EM(afs_cell_trace_unuse_alias,		"UNU alias ") \
189 	EM(afs_cell_trace_unuse_check_alias,	"UNU chk-al") \
190 	EM(afs_cell_trace_unuse_delete,		"UNU delete") \
191 	EM(afs_cell_trace_unuse_fc,		"UNU fc    ") \
192 	EM(afs_cell_trace_unuse_lookup,		"UNU lookup") \
193 	EM(afs_cell_trace_unuse_mntpt,		"UNU mntpt ") \
194 	EM(afs_cell_trace_unuse_no_pin,		"UNU no-pin") \
195 	EM(afs_cell_trace_unuse_parse,		"UNU parse ") \
196 	EM(afs_cell_trace_unuse_pin,		"UNU pin   ") \
197 	EM(afs_cell_trace_unuse_probe,		"UNU probe ") \
198 	EM(afs_cell_trace_unuse_sbi,		"UNU sbi   ") \
199 	EM(afs_cell_trace_unuse_ws,		"UNU ws    ") \
200 	EM(afs_cell_trace_use_alias,		"USE alias ") \
201 	EM(afs_cell_trace_use_check_alias,	"USE chk-al") \
202 	EM(afs_cell_trace_use_fc,		"USE fc    ") \
203 	EM(afs_cell_trace_use_fc_alias,		"USE fc-al ") \
204 	EM(afs_cell_trace_use_lookup,		"USE lookup") \
205 	EM(afs_cell_trace_use_mntpt,		"USE mntpt ") \
206 	EM(afs_cell_trace_use_pin,		"USE pin   ") \
207 	EM(afs_cell_trace_use_probe,		"USE probe ") \
208 	EM(afs_cell_trace_use_sbi,		"USE sbi   ") \
209 	E_(afs_cell_trace_wait,			"WAIT      ")
210 
211 #define afs_alist_traces \
212 	EM(afs_alist_trace_alloc,		"ALLOC     ") \
213 	EM(afs_alist_trace_get_estate,		"GET estate") \
214 	EM(afs_alist_trace_get_vlgetcaps,	"GET vgtcap") \
215 	EM(afs_alist_trace_get_vlprobe,		"GET vprobe") \
216 	EM(afs_alist_trace_get_vlrotate_set,	"GET vl-rot") \
217 	EM(afs_alist_trace_put_estate,		"PUT estate") \
218 	EM(afs_alist_trace_put_getaddru,	"PUT GtAdrU") \
219 	EM(afs_alist_trace_put_parse_empty,	"PUT p-empt") \
220 	EM(afs_alist_trace_put_parse_error,	"PUT p-err ") \
221 	EM(afs_alist_trace_put_server_dup,	"PUT sv-dup") \
222 	EM(afs_alist_trace_put_server_oom,	"PUT sv-oom") \
223 	EM(afs_alist_trace_put_server_update,	"PUT sv-upd") \
224 	EM(afs_alist_trace_put_vlgetcaps,	"PUT vgtcap") \
225 	EM(afs_alist_trace_put_vlprobe,		"PUT vprobe") \
226 	EM(afs_alist_trace_put_vlrotate_end,	"PUT vr-end") \
227 	EM(afs_alist_trace_put_vlrotate_fail,	"PUT vr-fai") \
228 	EM(afs_alist_trace_put_vlrotate_next,	"PUT vr-nxt") \
229 	EM(afs_alist_trace_put_vlrotate_restart,"PUT vr-rst") \
230 	EM(afs_alist_trace_put_vlserver,	"PUT vlsrvr") \
231 	EM(afs_alist_trace_put_vlserver_old,	"PUT vs-old") \
232 	E_(afs_alist_trace_free,		"FREE      ")
233 
234 #define afs_estate_traces \
235 	EM(afs_estate_trace_alloc_probe,	"ALLOC prob") \
236 	EM(afs_estate_trace_alloc_server,	"ALLOC srvr") \
237 	EM(afs_estate_trace_get_server_state,	"GET srv-st") \
238 	EM(afs_estate_trace_get_getcaps,	"GET getcap") \
239 	EM(afs_estate_trace_put_getcaps,	"PUT getcap") \
240 	EM(afs_estate_trace_put_probe,		"PUT probe ") \
241 	EM(afs_estate_trace_put_server,		"PUT server") \
242 	EM(afs_estate_trace_put_server_state,	"PUT srv-st") \
243 	E_(afs_estate_trace_free,		"FREE      ")
244 
245 #define afs_fs_operations \
246 	EM(afs_FS_FetchData,			"FS.FetchData") \
247 	EM(afs_FS_FetchStatus,			"FS.FetchStatus") \
248 	EM(afs_FS_StoreData,			"FS.StoreData") \
249 	EM(afs_FS_StoreStatus,			"FS.StoreStatus") \
250 	EM(afs_FS_RemoveFile,			"FS.RemoveFile") \
251 	EM(afs_FS_CreateFile,			"FS.CreateFile") \
252 	EM(afs_FS_Rename,			"FS.Rename") \
253 	EM(afs_FS_Symlink,			"FS.Symlink") \
254 	EM(afs_FS_Link,				"FS.Link") \
255 	EM(afs_FS_MakeDir,			"FS.MakeDir") \
256 	EM(afs_FS_RemoveDir,			"FS.RemoveDir") \
257 	EM(afs_FS_GetVolumeInfo,		"FS.GetVolumeInfo") \
258 	EM(afs_FS_GetVolumeStatus,		"FS.GetVolumeStatus") \
259 	EM(afs_FS_GetRootVolume,		"FS.GetRootVolume") \
260 	EM(afs_FS_SetLock,			"FS.SetLock") \
261 	EM(afs_FS_ExtendLock,			"FS.ExtendLock") \
262 	EM(afs_FS_ReleaseLock,			"FS.ReleaseLock") \
263 	EM(afs_FS_Lookup,			"FS.Lookup") \
264 	EM(afs_FS_InlineBulkStatus,		"FS.InlineBulkStatus") \
265 	EM(afs_FS_FetchData64,			"FS.FetchData64") \
266 	EM(afs_FS_StoreData64,			"FS.StoreData64") \
267 	EM(afs_FS_GiveUpAllCallBacks,		"FS.GiveUpAllCallBacks") \
268 	EM(afs_FS_GetCapabilities,		"FS.GetCapabilities") \
269 	EM(yfs_FS_FetchACL,			"YFS.FetchACL") \
270 	EM(yfs_FS_FetchStatus,			"YFS.FetchStatus") \
271 	EM(yfs_FS_StoreACL,			"YFS.StoreACL") \
272 	EM(yfs_FS_StoreStatus,			"YFS.StoreStatus") \
273 	EM(yfs_FS_RemoveFile,			"YFS.RemoveFile") \
274 	EM(yfs_FS_CreateFile,			"YFS.CreateFile") \
275 	EM(yfs_FS_Rename,			"YFS.Rename") \
276 	EM(yfs_FS_Symlink,			"YFS.Symlink") \
277 	EM(yfs_FS_Link,				"YFS.Link") \
278 	EM(yfs_FS_MakeDir,			"YFS.MakeDir") \
279 	EM(yfs_FS_RemoveDir,			"YFS.RemoveDir") \
280 	EM(yfs_FS_GetVolumeStatus,		"YFS.GetVolumeStatus") \
281 	EM(yfs_FS_SetVolumeStatus,		"YFS.SetVolumeStatus") \
282 	EM(yfs_FS_SetLock,			"YFS.SetLock") \
283 	EM(yfs_FS_ExtendLock,			"YFS.ExtendLock") \
284 	EM(yfs_FS_ReleaseLock,			"YFS.ReleaseLock") \
285 	EM(yfs_FS_Lookup,			"YFS.Lookup") \
286 	EM(yfs_FS_FlushCPS,			"YFS.FlushCPS") \
287 	EM(yfs_FS_FetchOpaqueACL,		"YFS.FetchOpaqueACL") \
288 	EM(yfs_FS_WhoAmI,			"YFS.WhoAmI") \
289 	EM(yfs_FS_RemoveACL,			"YFS.RemoveACL") \
290 	EM(yfs_FS_RemoveFile2,			"YFS.RemoveFile2") \
291 	EM(yfs_FS_StoreOpaqueACL2,		"YFS.StoreOpaqueACL2") \
292 	EM(yfs_FS_InlineBulkStatus,		"YFS.InlineBulkStatus") \
293 	EM(yfs_FS_FetchData64,			"YFS.FetchData64") \
294 	EM(yfs_FS_StoreData64,			"YFS.StoreData64") \
295 	E_(yfs_FS_UpdateSymlink,		"YFS.UpdateSymlink")
296 
297 #define afs_vl_operations \
298 	EM(afs_VL_GetEntryByNameU,		"VL.GetEntryByNameU") \
299 	EM(afs_VL_GetAddrsU,			"VL.GetAddrsU") \
300 	EM(afs_YFSVL_GetEndpoints,		"YFSVL.GetEndpoints") \
301 	EM(afs_YFSVL_GetCellName,		"YFSVL.GetCellName") \
302 	E_(afs_VL_GetCapabilities,		"VL.GetCapabilities")
303 
304 #define afs_cm_operations \
305 	EM(afs_CB_CallBack,			"CB.CallBack") \
306 	EM(afs_CB_InitCallBackState,		"CB.InitCallBackState") \
307 	EM(afs_CB_Probe,			"CB.Probe") \
308 	EM(afs_CB_GetLock,			"CB.GetLock") \
309 	EM(afs_CB_GetCE,			"CB.GetCE") \
310 	EM(afs_CB_GetXStatsVersion,		"CB.GetXStatsVersion") \
311 	EM(afs_CB_GetXStats,			"CB.GetXStats") \
312 	EM(afs_CB_InitCallBackState3,		"CB.InitCallBackState3") \
313 	E_(afs_CB_ProbeUuid,			"CB.ProbeUuid")
314 
315 #define yfs_cm_operations \
316 	EM(yfs_CB_Probe,			"YFSCB.Probe") \
317 	EM(yfs_CB_GetLock,			"YFSCB.GetLock") \
318 	EM(yfs_CB_XStatsVersion,		"YFSCB.XStatsVersion") \
319 	EM(yfs_CB_GetXStats,			"YFSCB.GetXStats") \
320 	EM(yfs_CB_InitCallBackState3,		"YFSCB.InitCallBackState3") \
321 	EM(yfs_CB_ProbeUuid,			"YFSCB.ProbeUuid") \
322 	EM(yfs_CB_GetServerPrefs,		"YFSCB.GetServerPrefs") \
323 	EM(yfs_CB_GetCellServDV,		"YFSCB.GetCellServDV") \
324 	EM(yfs_CB_GetLocalCell,			"YFSCB.GetLocalCell") \
325 	EM(yfs_CB_GetCacheConfig,		"YFSCB.GetCacheConfig") \
326 	EM(yfs_CB_GetCellByNum,			"YFSCB.GetCellByNum") \
327 	EM(yfs_CB_TellMeAboutYourself,		"YFSCB.TellMeAboutYourself") \
328 	E_(yfs_CB_CallBack,			"YFSCB.CallBack")
329 
330 #define afs_cb_promise_traces \
331 	EM(afs_cb_promise_clear_cb_break,	"CLEAR cb-break") \
332 	EM(afs_cb_promise_clear_rmdir,		"CLEAR rmdir") \
333 	EM(afs_cb_promise_clear_rotate_server,	"CLEAR rot-srv") \
334 	EM(afs_cb_promise_clear_server_change,	"CLEAR srv-chg") \
335 	EM(afs_cb_promise_clear_vol_init_cb,	"CLEAR vol-init-cb") \
336 	EM(afs_cb_promise_set_apply_cb,		"SET apply-cb") \
337 	EM(afs_cb_promise_set_new_inode,	"SET new-inode") \
338 	E_(afs_cb_promise_set_new_symlink,	"SET new-symlink")
339 
340 #define afs_vnode_invalid_traces \
341 	EM(afs_vnode_invalid_trace_cb_ro_snapshot, "cb-ro-snapshot") \
342 	EM(afs_vnode_invalid_trace_cb_scrub,	"cb-scrub") \
343 	EM(afs_vnode_invalid_trace_cb_v_break,	"cb-v-break") \
344 	EM(afs_vnode_invalid_trace_expired,	"expired") \
345 	EM(afs_vnode_invalid_trace_no_cb_promise, "no-cb-promise") \
346 	EM(afs_vnode_invalid_trace_vol_expired,	"vol-expired") \
347 	EM(afs_vnode_invalid_trace_zap_data,	"zap-data") \
348 	E_(afs_vnode_valid_trace,		"valid")
349 
350 #define afs_dir_invalid_traces			\
351 	EM(afs_dir_invalid_edit_add_bad_size,	"edit-add-bad-size") \
352 	EM(afs_dir_invalid_edit_add_no_slots,	"edit-add-no-slots") \
353 	EM(afs_dir_invalid_edit_add_too_many_blocks, "edit-add-too-many-blocks") \
354 	EM(afs_dir_invalid_edit_get_block,	"edit-get-block") \
355 	EM(afs_dir_invalid_edit_mkdir,		"edit-mkdir") \
356 	EM(afs_dir_invalid_edit_rem_bad_size,	"edit-rem-bad-size") \
357 	EM(afs_dir_invalid_edit_rem_wrong_name,	"edit-rem-wrong_name") \
358 	EM(afs_dir_invalid_edit_upd_bad_size,	"edit-upd-bad-size") \
359 	EM(afs_dir_invalid_edit_upd_no_dd,	"edit-upd-no-dotdot") \
360 	EM(afs_dir_invalid_dv_mismatch,		"dv-mismatch") \
361 	EM(afs_dir_invalid_inval_folio,		"inv-folio") \
362 	EM(afs_dir_invalid_iter_stale,		"iter-stale") \
363 	EM(afs_dir_invalid_reclaimed_folio,	"reclaimed-folio") \
364 	EM(afs_dir_invalid_release_folio,	"rel-folio") \
365 	EM(afs_dir_invalid_remote,		"remote") \
366 	E_(afs_dir_invalid_subdir_removed,	"subdir-removed")
367 
368 #define afs_edit_dir_ops				  \
369 	EM(afs_edit_dir_create,			"create") \
370 	EM(afs_edit_dir_create_error,		"c_fail") \
371 	EM(afs_edit_dir_create_inval,		"c_invl") \
372 	EM(afs_edit_dir_create_nospc,		"c_nspc") \
373 	EM(afs_edit_dir_delete,			"delete") \
374 	EM(afs_edit_dir_delete_error,		"d_err ") \
375 	EM(afs_edit_dir_delete_inval,		"d_invl") \
376 	EM(afs_edit_dir_delete_noent,		"d_nent") \
377 	EM(afs_edit_dir_mkdir,			"mk_ent") \
378 	EM(afs_edit_dir_update_dd,		"u_ddot") \
379 	EM(afs_edit_dir_update_error,		"u_fail") \
380 	EM(afs_edit_dir_update_inval,		"u_invl") \
381 	E_(afs_edit_dir_update_nodd,		"u_nodd")
382 
383 #define afs_edit_dir_reasons				  \
384 	EM(afs_edit_dir_for_create,		"Create") \
385 	EM(afs_edit_dir_for_link,		"Link  ") \
386 	EM(afs_edit_dir_for_mkdir,		"MkDir ") \
387 	EM(afs_edit_dir_for_rename_0,		"Renam0") \
388 	EM(afs_edit_dir_for_rename_1,		"Renam1") \
389 	EM(afs_edit_dir_for_rename_2,		"Renam2") \
390 	EM(afs_edit_dir_for_rename_sub,		"RnmSub") \
391 	EM(afs_edit_dir_for_rmdir,		"RmDir ") \
392 	EM(afs_edit_dir_for_silly_0,		"S_Ren0") \
393 	EM(afs_edit_dir_for_silly_1,		"S_Ren1") \
394 	EM(afs_edit_dir_for_symlink,		"Symlnk") \
395 	E_(afs_edit_dir_for_unlink,		"Unlink")
396 
397 #define afs_eproto_causes			\
398 	EM(afs_eproto_bad_status,	"BadStatus") \
399 	EM(afs_eproto_cb_count,		"CbCount") \
400 	EM(afs_eproto_cb_fid_count,	"CbFidCount") \
401 	EM(afs_eproto_cellname_len,	"CellNameLen") \
402 	EM(afs_eproto_file_type,	"FileTYpe") \
403 	EM(afs_eproto_ibulkst_cb_count,	"IBS.CbCount") \
404 	EM(afs_eproto_ibulkst_count,	"IBS.FidCount") \
405 	EM(afs_eproto_motd_len,		"MotdLen") \
406 	EM(afs_eproto_offline_msg_len,	"OfflineMsgLen") \
407 	EM(afs_eproto_volname_len,	"VolNameLen") \
408 	EM(afs_eproto_yvl_fsendpt4_len,	"YVL.FsEnd4Len") \
409 	EM(afs_eproto_yvl_fsendpt6_len,	"YVL.FsEnd6Len") \
410 	EM(afs_eproto_yvl_fsendpt_num,	"YVL.FsEndCount") \
411 	EM(afs_eproto_yvl_fsendpt_type,	"YVL.FsEndType") \
412 	EM(afs_eproto_yvl_vlendpt4_len,	"YVL.VlEnd4Len") \
413 	EM(afs_eproto_yvl_vlendpt6_len,	"YVL.VlEnd6Len") \
414 	E_(afs_eproto_yvl_vlendpt_type,	"YVL.VlEndType")
415 
416 #define afs_io_errors							\
417 	EM(afs_io_error_cm_reply,		"CM_REPLY")		\
418 	EM(afs_io_error_extract,		"EXTRACT")		\
419 	EM(afs_io_error_fs_probe_fail,		"FS_PROBE_FAIL")	\
420 	EM(afs_io_error_vl_lookup_fail,		"VL_LOOKUP_FAIL")	\
421 	E_(afs_io_error_vl_probe_fail,		"VL_PROBE_FAIL")
422 
423 #define afs_file_errors							\
424 	EM(afs_file_error_dir_bad_magic,	"DIR_BAD_MAGIC")	\
425 	EM(afs_file_error_dir_big,		"DIR_BIG")		\
426 	EM(afs_file_error_dir_missing_page,	"DIR_MISSING_PAGE")	\
427 	EM(afs_file_error_dir_name_too_long,	"DIR_NAME_TOO_LONG")	\
428 	EM(afs_file_error_dir_over_end,		"DIR_ENT_OVER_END")	\
429 	EM(afs_file_error_dir_small,		"DIR_SMALL")		\
430 	EM(afs_file_error_dir_unmarked_ext,	"DIR_UNMARKED_EXT")	\
431 	EM(afs_file_error_symlink_big,		"SYM_BIG")		\
432 	EM(afs_file_error_mntpt,		"MNTPT_READ_FAILED")	\
433 	E_(afs_file_error_writeback_fail,	"WRITEBACK_FAILED")
434 
435 #define afs_flock_types							\
436 	EM(F_RDLCK,				"RDLCK")		\
437 	EM(F_WRLCK,				"WRLCK")		\
438 	E_(F_UNLCK,				"UNLCK")
439 
440 #define afs_flock_states						\
441 	EM(AFS_VNODE_LOCK_NONE,			"NONE")			\
442 	EM(AFS_VNODE_LOCK_WAITING_FOR_CB,	"WAIT_FOR_CB")		\
443 	EM(AFS_VNODE_LOCK_SETTING,		"SETTING")		\
444 	EM(AFS_VNODE_LOCK_GRANTED,		"GRANTED")		\
445 	EM(AFS_VNODE_LOCK_EXTENDING,		"EXTENDING")		\
446 	EM(AFS_VNODE_LOCK_NEED_UNLOCK,		"NEED_UNLOCK")		\
447 	EM(AFS_VNODE_LOCK_UNLOCKING,		"UNLOCKING")		\
448 	E_(AFS_VNODE_LOCK_DELETED,		"DELETED")
449 
450 #define afs_flock_events						\
451 	EM(afs_flock_acquired,			"Acquired")		\
452 	EM(afs_flock_callback_break,		"Callback")		\
453 	EM(afs_flock_defer_unlock,		"D-Unlock")		\
454 	EM(afs_flock_extend_fail,		"Ext_Fail")		\
455 	EM(afs_flock_fail_other,		"ErrOther")		\
456 	EM(afs_flock_fail_perm,			"ErrPerm ")		\
457 	EM(afs_flock_no_lockers,		"NoLocker")		\
458 	EM(afs_flock_release_fail,		"Rel_Fail")		\
459 	EM(afs_flock_silly_delete,		"SillyDel")		\
460 	EM(afs_flock_timestamp,			"Timestmp")		\
461 	EM(afs_flock_try_to_lock,		"TryToLck")		\
462 	EM(afs_flock_vfs_lock,			"VFSLock ")		\
463 	EM(afs_flock_vfs_locking,		"VFSLking")		\
464 	EM(afs_flock_waited,			"Waited  ")		\
465 	EM(afs_flock_waiting,			"Waiting ")		\
466 	EM(afs_flock_work_extending,		"Extendng")		\
467 	EM(afs_flock_work_retry,		"Retry   ")		\
468 	EM(afs_flock_work_unlocking,		"Unlcking")		\
469 	E_(afs_flock_would_block,		"EWOULDBL")
470 
471 #define afs_flock_operations						\
472 	EM(afs_flock_op_copy_lock,		"COPY    ")		\
473 	EM(afs_flock_op_flock,			"->flock ")		\
474 	EM(afs_flock_op_grant,			"GRANT   ")		\
475 	EM(afs_flock_op_lock,			"->lock  ")		\
476 	EM(afs_flock_op_release_lock,		"RELEASE ")		\
477 	EM(afs_flock_op_return_ok,		"<-OK    ")		\
478 	EM(afs_flock_op_return_edeadlk,		"<-EDEADL")		\
479 	EM(afs_flock_op_return_eagain,		"<-EAGAIN")		\
480 	EM(afs_flock_op_return_error,		"<-ERROR ")		\
481 	EM(afs_flock_op_set_lock,		"SET     ")		\
482 	EM(afs_flock_op_unlock,			"UNLOCK  ")		\
483 	E_(afs_flock_op_wake,			"WAKE    ")
484 
485 #define afs_cb_break_reasons						\
486 	EM(afs_cb_break_no_break,		"no-break")		\
487 	EM(afs_cb_break_for_callback,		"break-cb")		\
488 	EM(afs_cb_break_for_creation_regress,	"creation-regress")	\
489 	EM(afs_cb_break_for_deleted,		"break-del")		\
490 	EM(afs_cb_break_for_s_reinit,		"s-reinit")		\
491 	EM(afs_cb_break_for_unlink,		"break-unlink")		\
492 	EM(afs_cb_break_for_update_regress,	"update-regress")	\
493 	EM(afs_cb_break_for_volume_callback,	"break-v-cb")		\
494 	EM(afs_cb_break_for_vos_release,	"break-vos-release")	\
495 	E_(afs_cb_break_volume_excluded,	"vol-excluded")
496 
497 #define afs_rotate_traces						\
498 	EM(afs_rotate_trace_aborted,		"Abortd")		\
499 	EM(afs_rotate_trace_busy_sleep,		"BsySlp")		\
500 	EM(afs_rotate_trace_check_vol_status,	"VolStt")		\
501 	EM(afs_rotate_trace_failed,		"Failed")		\
502 	EM(afs_rotate_trace_iter,		"Iter  ")		\
503 	EM(afs_rotate_trace_iterate_addr,	"ItAddr")		\
504 	EM(afs_rotate_trace_next_server,	"NextSv")		\
505 	EM(afs_rotate_trace_no_more_servers,	"NoMore")		\
506 	EM(afs_rotate_trace_nomem,		"Nomem ")		\
507 	EM(afs_rotate_trace_probe_error,	"PrbErr")		\
508 	EM(afs_rotate_trace_probe_fileserver,	"PrbFsv")		\
509 	EM(afs_rotate_trace_probe_none,		"PrbNon")		\
510 	EM(afs_rotate_trace_probe_response,	"PrbRsp")		\
511 	EM(afs_rotate_trace_probe_superseded,	"PrbSup")		\
512 	EM(afs_rotate_trace_restart,		"Rstart")		\
513 	EM(afs_rotate_trace_retry_server,	"RtrySv")		\
514 	EM(afs_rotate_trace_selected_server,	"SlctSv")		\
515 	EM(afs_rotate_trace_stale_lock,		"StlLck")		\
516 	EM(afs_rotate_trace_start,		"Start ")		\
517 	EM(afs_rotate_trace_stop,		"Stop  ")		\
518 	E_(afs_rotate_trace_stopped,		"Stoppd")
519 
520 /*
521  * Generate enums for tracing information.
522  */
523 #ifndef __AFS_GENERATE_TRACE_ENUMS_ONCE_ONLY
524 #define __AFS_GENERATE_TRACE_ENUMS_ONCE_ONLY
525 
526 #undef EM
527 #undef E_
528 #define EM(a, b) a,
529 #define E_(a, b) a
530 
531 enum afs_alist_trace		{ afs_alist_traces } __mode(byte);
532 enum afs_call_trace		{ afs_call_traces } __mode(byte);
533 enum afs_cb_break_reason	{ afs_cb_break_reasons } __mode(byte);
534 enum afs_cb_promise_trace	{ afs_cb_promise_traces } __mode(byte);
535 enum afs_cell_trace		{ afs_cell_traces } __mode(byte);
536 enum afs_dir_invalid_trace	{ afs_dir_invalid_traces} __mode(byte);
537 enum afs_edit_dir_op		{ afs_edit_dir_ops } __mode(byte);
538 enum afs_edit_dir_reason	{ afs_edit_dir_reasons } __mode(byte);
539 enum afs_eproto_cause		{ afs_eproto_causes } __mode(byte);
540 enum afs_estate_trace		{ afs_estate_traces } __mode(byte);
541 enum afs_file_error		{ afs_file_errors } __mode(byte);
542 enum afs_flock_event		{ afs_flock_events } __mode(byte);
543 enum afs_flock_operation	{ afs_flock_operations } __mode(byte);
544 enum afs_io_error		{ afs_io_errors } __mode(byte);
545 enum afs_rotate_trace		{ afs_rotate_traces } __mode(byte);
546 enum afs_server_trace		{ afs_server_traces } __mode(byte);
547 enum afs_vnode_invalid_trace	{ afs_vnode_invalid_traces} __mode(byte);
548 enum afs_volume_trace		{ afs_volume_traces } __mode(byte);
549 
550 #endif /* end __AFS_GENERATE_TRACE_ENUMS_ONCE_ONLY */
551 
552 /*
553  * Export enum symbols via userspace.
554  */
555 #undef EM
556 #undef E_
557 #define EM(a, b) TRACE_DEFINE_ENUM(a);
558 #define E_(a, b) TRACE_DEFINE_ENUM(a);
559 
560 afs_alist_traces;
561 afs_call_traces;
562 afs_cb_break_reasons;
563 afs_cb_promise_traces;
564 afs_cell_traces;
565 afs_cm_operations;
566 afs_dir_invalid_traces;
567 afs_edit_dir_ops;
568 afs_edit_dir_reasons;
569 afs_eproto_causes;
570 afs_estate_traces;
571 afs_file_errors;
572 afs_flock_operations;
573 afs_flock_types;
574 afs_fs_operations;
575 afs_io_errors;
576 afs_rotate_traces;
577 afs_server_traces;
578 afs_vnode_invalid_traces;
579 afs_vl_operations;
580 yfs_cm_operations;
581 
582 /*
583  * Now redefine the EM() and E_() macros to map the enums to the strings that
584  * will be printed in the output.
585  */
586 #undef EM
587 #undef E_
588 #define EM(a, b)	{ a, b },
589 #define E_(a, b)	{ a, b }
590 
591 TRACE_EVENT(afs_receive_data,
592 	    TP_PROTO(struct afs_call *call, struct iov_iter *iter,
593 		     bool want_more, int ret),
594 
595 	    TP_ARGS(call, iter, want_more, ret),
596 
597 	    TP_STRUCT__entry(
598 		    __field(loff_t,			remain)
599 		    __field(unsigned int,		call)
600 		    __field(enum afs_call_state,	state)
601 		    __field(unsigned short,		unmarshall)
602 		    __field(bool,			want_more)
603 		    __field(int,			ret)
604 			     ),
605 
606 	    TP_fast_assign(
607 		    __entry->call	= call->debug_id;
608 		    __entry->state	= call->state;
609 		    __entry->unmarshall	= call->unmarshall;
610 		    __entry->remain	= iov_iter_count(iter);
611 		    __entry->want_more	= want_more;
612 		    __entry->ret	= ret;
613 			   ),
614 
615 	    TP_printk("c=%08x r=%llu u=%u w=%u s=%u ret=%d",
616 		      __entry->call,
617 		      __entry->remain,
618 		      __entry->unmarshall,
619 		      __entry->want_more,
620 		      __entry->state,
621 		      __entry->ret)
622 	    );
623 
624 TRACE_EVENT(afs_notify_call,
625 	    TP_PROTO(struct rxrpc_call *rxcall, struct afs_call *call),
626 
627 	    TP_ARGS(rxcall, call),
628 
629 	    TP_STRUCT__entry(
630 		    __field(unsigned int,		call)
631 		    __field(enum afs_call_state,	state)
632 		    __field(unsigned short,		unmarshall)
633 			     ),
634 
635 	    TP_fast_assign(
636 		    __entry->call	= call->debug_id;
637 		    __entry->state	= call->state;
638 		    __entry->unmarshall	= call->unmarshall;
639 			   ),
640 
641 	    TP_printk("c=%08x s=%u u=%u",
642 		      __entry->call,
643 		      __entry->state, __entry->unmarshall)
644 	    );
645 
646 TRACE_EVENT(afs_cb_call,
647 	    TP_PROTO(struct afs_call *call),
648 
649 	    TP_ARGS(call),
650 
651 	    TP_STRUCT__entry(
652 		    __field(unsigned int,		call)
653 		    __field(u32,			op)
654 		    __field(u16,			service_id)
655 			     ),
656 
657 	    TP_fast_assign(
658 		    __entry->call	= call->debug_id;
659 		    __entry->op		= call->operation_ID;
660 		    __entry->service_id	= call->service_id;
661 			   ),
662 
663 	    TP_printk("c=%08x %s",
664 		      __entry->call,
665 		      __entry->service_id == 2501 ?
666 		      __print_symbolic(__entry->op, yfs_cm_operations) :
667 		      __print_symbolic(__entry->op, afs_cm_operations))
668 	    );
669 
670 TRACE_EVENT(afs_call,
671 	    TP_PROTO(unsigned int call_debug_id, enum afs_call_trace op,
672 		     int ref, int outstanding, const void *where),
673 
674 	    TP_ARGS(call_debug_id, op, ref, outstanding, where),
675 
676 	    TP_STRUCT__entry(
677 		    __field(unsigned int,		call)
678 		    __field(int,			op)
679 		    __field(int,			ref)
680 		    __field(int,			outstanding)
681 		    __field(const void *,		where)
682 			     ),
683 
684 	    TP_fast_assign(
685 		    __entry->call = call_debug_id;
686 		    __entry->op = op;
687 		    __entry->ref = ref;
688 		    __entry->outstanding = outstanding;
689 		    __entry->where = where;
690 			   ),
691 
692 	    TP_printk("c=%08x %s r=%d o=%d sp=%pSR",
693 		      __entry->call,
694 		      __print_symbolic(__entry->op, afs_call_traces),
695 		      __entry->ref,
696 		      __entry->outstanding,
697 		      __entry->where)
698 	    );
699 
700 TRACE_EVENT(afs_make_fs_call,
701 	    TP_PROTO(struct afs_call *call, const struct afs_fid *fid),
702 
703 	    TP_ARGS(call, fid),
704 
705 	    TP_STRUCT__entry(
706 		    __field(unsigned int,		call)
707 		    __field(enum afs_fs_operation,	op)
708 		    __field_struct(struct afs_fid,	fid)
709 			     ),
710 
711 	    TP_fast_assign(
712 		    __entry->call = call->debug_id;
713 		    __entry->op = call->operation_ID;
714 		    if (fid) {
715 			    __entry->fid = *fid;
716 		    } else {
717 			    __entry->fid.vid = 0;
718 			    __entry->fid.vnode = 0;
719 			    __entry->fid.unique = 0;
720 		    }
721 			   ),
722 
723 	    TP_printk("c=%08x V=%llx i=%llx:%x %s",
724 		      __entry->call,
725 		      __entry->fid.vid,
726 		      __entry->fid.vnode,
727 		      __entry->fid.unique,
728 		      __print_symbolic(__entry->op, afs_fs_operations))
729 	    );
730 
731 TRACE_EVENT(afs_make_fs_calli,
732 	    TP_PROTO(struct afs_call *call, const struct afs_fid *fid,
733 		     unsigned int i),
734 
735 	    TP_ARGS(call, fid, i),
736 
737 	    TP_STRUCT__entry(
738 		    __field(unsigned int,		call)
739 		    __field(unsigned int,		i)
740 		    __field(enum afs_fs_operation,	op)
741 		    __field_struct(struct afs_fid,	fid)
742 			     ),
743 
744 	    TP_fast_assign(
745 		    __entry->call = call->debug_id;
746 		    __entry->i = i;
747 		    __entry->op = call->operation_ID;
748 		    if (fid) {
749 			    __entry->fid = *fid;
750 		    } else {
751 			    __entry->fid.vid = 0;
752 			    __entry->fid.vnode = 0;
753 			    __entry->fid.unique = 0;
754 		    }
755 			   ),
756 
757 	    TP_printk("c=%08x V=%llx i=%llx:%x %s i=%u",
758 		      __entry->call,
759 		      __entry->fid.vid,
760 		      __entry->fid.vnode,
761 		      __entry->fid.unique,
762 		      __print_symbolic(__entry->op, afs_fs_operations),
763 		      __entry->i)
764 	    );
765 
766 TRACE_EVENT(afs_make_fs_call1,
767 	    TP_PROTO(struct afs_call *call, const struct afs_fid *fid,
768 		     const struct qstr *name),
769 
770 	    TP_ARGS(call, fid, name),
771 
772 	    TP_STRUCT__entry(
773 		    __field(unsigned int,		call)
774 		    __field(enum afs_fs_operation,	op)
775 		    __field_struct(struct afs_fid,	fid)
776 		    __array(char,			name, 24)
777 			     ),
778 
779 	    TP_fast_assign(
780 		    unsigned int __len = min_t(unsigned int, name->len, 23);
781 		    __entry->call = call->debug_id;
782 		    __entry->op = call->operation_ID;
783 		    if (fid) {
784 			    __entry->fid = *fid;
785 		    } else {
786 			    __entry->fid.vid = 0;
787 			    __entry->fid.vnode = 0;
788 			    __entry->fid.unique = 0;
789 		    }
790 		    memcpy(__entry->name, name->name, __len);
791 		    __entry->name[__len] = 0;
792 			   ),
793 
794 	    TP_printk("c=%08x V=%llx i=%llx:%x %s \"%s\"",
795 		      __entry->call,
796 		      __entry->fid.vid,
797 		      __entry->fid.vnode,
798 		      __entry->fid.unique,
799 		      __print_symbolic(__entry->op, afs_fs_operations),
800 		      __entry->name)
801 	    );
802 
803 TRACE_EVENT(afs_make_fs_call2,
804 	    TP_PROTO(struct afs_call *call, const struct afs_fid *fid,
805 		     const struct qstr *name, const struct qstr *name2),
806 
807 	    TP_ARGS(call, fid, name, name2),
808 
809 	    TP_STRUCT__entry(
810 		    __field(unsigned int,		call)
811 		    __field(enum afs_fs_operation,	op)
812 		    __field_struct(struct afs_fid,	fid)
813 		    __array(char,			name, 24)
814 		    __array(char,			name2, 24)
815 			     ),
816 
817 	    TP_fast_assign(
818 		    unsigned int __len = min_t(unsigned int, name->len, 23);
819 		    unsigned int __len2 = min_t(unsigned int, name2->len, 23);
820 		    __entry->call = call->debug_id;
821 		    __entry->op = call->operation_ID;
822 		    if (fid) {
823 			    __entry->fid = *fid;
824 		    } else {
825 			    __entry->fid.vid = 0;
826 			    __entry->fid.vnode = 0;
827 			    __entry->fid.unique = 0;
828 		    }
829 		    memcpy(__entry->name, name->name, __len);
830 		    __entry->name[__len] = 0;
831 		    memcpy(__entry->name2, name2->name, __len2);
832 		    __entry->name2[__len2] = 0;
833 			   ),
834 
835 	    TP_printk("c=%08x V=%llx i=%llx:%x %s \"%s\" \"%s\"",
836 		      __entry->call,
837 		      __entry->fid.vid,
838 		      __entry->fid.vnode,
839 		      __entry->fid.unique,
840 		      __print_symbolic(__entry->op, afs_fs_operations),
841 		      __entry->name,
842 		      __entry->name2)
843 	    );
844 
845 TRACE_EVENT(afs_make_vl_call,
846 	    TP_PROTO(struct afs_call *call),
847 
848 	    TP_ARGS(call),
849 
850 	    TP_STRUCT__entry(
851 		    __field(unsigned int,		call)
852 		    __field(enum afs_vl_operation,	op)
853 			     ),
854 
855 	    TP_fast_assign(
856 		    __entry->call = call->debug_id;
857 		    __entry->op = call->operation_ID;
858 			   ),
859 
860 	    TP_printk("c=%08x %s",
861 		      __entry->call,
862 		      __print_symbolic(__entry->op, afs_vl_operations))
863 	    );
864 
865 TRACE_EVENT(afs_call_done,
866 	    TP_PROTO(struct afs_call *call),
867 
868 	    TP_ARGS(call),
869 
870 	    TP_STRUCT__entry(
871 		    __field(unsigned int,		call)
872 		    __field(struct rxrpc_call *,	rx_call)
873 		    __field(int,			ret)
874 		    __field(u32,			abort_code)
875 			     ),
876 
877 	    TP_fast_assign(
878 		    __entry->call = call->debug_id;
879 		    __entry->rx_call = call->rxcall;
880 		    __entry->ret = call->error;
881 		    __entry->abort_code = call->abort_code;
882 			   ),
883 
884 	    TP_printk("   c=%08x ret=%d ab=%d [%p]",
885 		      __entry->call,
886 		      __entry->ret,
887 		      __entry->abort_code,
888 		      __entry->rx_call)
889 	    );
890 
891 TRACE_EVENT(afs_send_data,
892 	    TP_PROTO(struct afs_call *call, struct msghdr *msg),
893 
894 	    TP_ARGS(call, msg),
895 
896 	    TP_STRUCT__entry(
897 		    __field(unsigned int,		call)
898 		    __field(unsigned int,		flags)
899 		    __field(loff_t,			offset)
900 		    __field(loff_t,			count)
901 			     ),
902 
903 	    TP_fast_assign(
904 		    __entry->call = call->debug_id;
905 		    __entry->flags = msg->msg_flags;
906 		    __entry->offset = msg->msg_iter.xarray_start + msg->msg_iter.iov_offset;
907 		    __entry->count = iov_iter_count(&msg->msg_iter);
908 			   ),
909 
910 	    TP_printk(" c=%08x o=%llx n=%llx f=%x",
911 		      __entry->call, __entry->offset, __entry->count,
912 		      __entry->flags)
913 	    );
914 
915 TRACE_EVENT(afs_sent_data,
916 	    TP_PROTO(struct afs_call *call, struct msghdr *msg, int ret),
917 
918 	    TP_ARGS(call, msg, ret),
919 
920 	    TP_STRUCT__entry(
921 		    __field(unsigned int,		call)
922 		    __field(int,			ret)
923 		    __field(loff_t,			offset)
924 		    __field(loff_t,			count)
925 			     ),
926 
927 	    TP_fast_assign(
928 		    __entry->call = call->debug_id;
929 		    __entry->ret = ret;
930 		    __entry->offset = msg->msg_iter.xarray_start + msg->msg_iter.iov_offset;
931 		    __entry->count = iov_iter_count(&msg->msg_iter);
932 			   ),
933 
934 	    TP_printk(" c=%08x o=%llx n=%llx r=%x",
935 		      __entry->call, __entry->offset, __entry->count,
936 		      __entry->ret)
937 	    );
938 
939 TRACE_EVENT(afs_dir_check_failed,
940 	    TP_PROTO(struct afs_vnode *vnode, loff_t off),
941 
942 	    TP_ARGS(vnode, off),
943 
944 	    TP_STRUCT__entry(
945 		    __field(struct afs_vnode *,		vnode)
946 		    __field(loff_t,			off)
947 		    __field(loff_t,			i_size)
948 			     ),
949 
950 	    TP_fast_assign(
951 		    __entry->vnode = vnode;
952 		    __entry->off = off;
953 		    __entry->i_size = i_size_read(&vnode->netfs.inode);
954 			   ),
955 
956 	    TP_printk("vn=%p %llx/%llx",
957 		      __entry->vnode, __entry->off, __entry->i_size)
958 	    );
959 
960 TRACE_EVENT(afs_call_state,
961 	    TP_PROTO(struct afs_call *call,
962 		     enum afs_call_state from,
963 		     enum afs_call_state to,
964 		     int ret, u32 remote_abort),
965 
966 	    TP_ARGS(call, from, to, ret, remote_abort),
967 
968 	    TP_STRUCT__entry(
969 		    __field(unsigned int,		call)
970 		    __field(enum afs_call_state,	from)
971 		    __field(enum afs_call_state,	to)
972 		    __field(int,			ret)
973 		    __field(u32,			abort)
974 			     ),
975 
976 	    TP_fast_assign(
977 		    __entry->call = call->debug_id;
978 		    __entry->from = from;
979 		    __entry->to = to;
980 		    __entry->ret = ret;
981 		    __entry->abort = remote_abort;
982 			   ),
983 
984 	    TP_printk("c=%08x %u->%u r=%d ab=%d",
985 		      __entry->call,
986 		      __entry->from, __entry->to,
987 		      __entry->ret, __entry->abort)
988 	    );
989 
990 TRACE_EVENT(afs_lookup,
991 	    TP_PROTO(struct afs_vnode *dvnode, const struct qstr *name,
992 		     struct afs_fid *fid),
993 
994 	    TP_ARGS(dvnode, name, fid),
995 
996 	    TP_STRUCT__entry(
997 		    __field_struct(struct afs_fid,	dfid)
998 		    __field_struct(struct afs_fid,	fid)
999 		    __array(char,			name, 24)
1000 			     ),
1001 
1002 	    TP_fast_assign(
1003 		    int __len = min_t(int, name->len, 23);
1004 		    __entry->dfid = dvnode->fid;
1005 		    __entry->fid = *fid;
1006 		    memcpy(__entry->name, name->name, __len);
1007 		    __entry->name[__len] = 0;
1008 			   ),
1009 
1010 	    TP_printk("d=%llx:%llx:%x \"%s\" f=%llx:%x",
1011 		      __entry->dfid.vid, __entry->dfid.vnode, __entry->dfid.unique,
1012 		      __entry->name,
1013 		      __entry->fid.vnode, __entry->fid.unique)
1014 	    );
1015 
1016 TRACE_EVENT(afs_edit_dir,
1017 	    TP_PROTO(struct afs_vnode *dvnode,
1018 		     enum afs_edit_dir_reason why,
1019 		     enum afs_edit_dir_op op,
1020 		     unsigned int block,
1021 		     unsigned int slot,
1022 		     unsigned int f_vnode,
1023 		     unsigned int f_unique,
1024 		     const char *name),
1025 
1026 	    TP_ARGS(dvnode, why, op, block, slot, f_vnode, f_unique, name),
1027 
1028 	    TP_STRUCT__entry(
1029 		    __field(unsigned int,		vnode)
1030 		    __field(unsigned int,		unique)
1031 		    __field(enum afs_edit_dir_reason,	why)
1032 		    __field(enum afs_edit_dir_op,	op)
1033 		    __field(unsigned int,		block)
1034 		    __field(unsigned short,		slot)
1035 		    __field(unsigned int,		f_vnode)
1036 		    __field(unsigned int,		f_unique)
1037 		    __array(char,			name, 24)
1038 			     ),
1039 
1040 	    TP_fast_assign(
1041 		    int __len = strlen(name);
1042 		    __len = min(__len, 23);
1043 		    __entry->vnode	= dvnode->fid.vnode;
1044 		    __entry->unique	= dvnode->fid.unique;
1045 		    __entry->why	= why;
1046 		    __entry->op		= op;
1047 		    __entry->block	= block;
1048 		    __entry->slot	= slot;
1049 		    __entry->f_vnode	= f_vnode;
1050 		    __entry->f_unique	= f_unique;
1051 		    memcpy(__entry->name, name, __len);
1052 		    __entry->name[__len] = 0;
1053 			   ),
1054 
1055 	    TP_printk("di=%x:%x %s %s %u[%u] fi=%x:%x \"%s\"",
1056 		      __entry->vnode, __entry->unique,
1057 		      __print_symbolic(__entry->why, afs_edit_dir_reasons),
1058 		      __print_symbolic(__entry->op, afs_edit_dir_ops),
1059 		      __entry->block, __entry->slot,
1060 		      __entry->f_vnode, __entry->f_unique,
1061 		      __entry->name)
1062 	    );
1063 
1064 TRACE_EVENT(afs_dir_invalid,
1065 	    TP_PROTO(const struct afs_vnode *dvnode, enum afs_dir_invalid_trace trace),
1066 
1067 	    TP_ARGS(dvnode, trace),
1068 
1069 	    TP_STRUCT__entry(
1070 		    __field(unsigned int,		vnode)
1071 		    __field(unsigned int,		unique)
1072 		    __field(enum afs_dir_invalid_trace,	trace)
1073 			     ),
1074 
1075 	    TP_fast_assign(
1076 		    __entry->vnode	= dvnode->fid.vnode;
1077 		    __entry->unique	= dvnode->fid.unique;
1078 		    __entry->trace	= trace;
1079 			   ),
1080 
1081 	    TP_printk("di=%x:%x %s",
1082 		      __entry->vnode, __entry->unique,
1083 		      __print_symbolic(__entry->trace, afs_dir_invalid_traces))
1084 	    );
1085 
1086 TRACE_EVENT(afs_cb_promise,
1087 	    TP_PROTO(const struct afs_vnode *vnode, enum afs_cb_promise_trace trace),
1088 
1089 	    TP_ARGS(vnode, trace),
1090 
1091 	    TP_STRUCT__entry(
1092 		    __field(unsigned int,		vnode)
1093 		    __field(unsigned int,		unique)
1094 		    __field(enum afs_cb_promise_trace,	trace)
1095 			     ),
1096 
1097 	    TP_fast_assign(
1098 		    __entry->vnode	= vnode->fid.vnode;
1099 		    __entry->unique	= vnode->fid.unique;
1100 		    __entry->trace	= trace;
1101 			   ),
1102 
1103 	    TP_printk("di=%x:%x %s",
1104 		      __entry->vnode, __entry->unique,
1105 		      __print_symbolic(__entry->trace, afs_cb_promise_traces))
1106 	    );
1107 
1108 TRACE_EVENT(afs_vnode_invalid,
1109 	    TP_PROTO(const struct afs_vnode *vnode, enum afs_vnode_invalid_trace trace),
1110 
1111 	    TP_ARGS(vnode, trace),
1112 
1113 	    TP_STRUCT__entry(
1114 		    __field(unsigned int,		vnode)
1115 		    __field(unsigned int,		unique)
1116 		    __field(enum afs_vnode_invalid_trace, trace)
1117 			     ),
1118 
1119 	    TP_fast_assign(
1120 		    __entry->vnode	= vnode->fid.vnode;
1121 		    __entry->unique	= vnode->fid.unique;
1122 		    __entry->trace	= trace;
1123 			   ),
1124 
1125 	    TP_printk("di=%x:%x %s",
1126 		      __entry->vnode, __entry->unique,
1127 		      __print_symbolic(__entry->trace, afs_vnode_invalid_traces))
1128 	    );
1129 
1130 TRACE_EVENT(afs_set_dv,
1131 	    TP_PROTO(const struct afs_vnode *dvnode, u64 new_dv),
1132 
1133 	    TP_ARGS(dvnode, new_dv),
1134 
1135 	    TP_STRUCT__entry(
1136 		    __field(unsigned int,		vnode)
1137 		    __field(unsigned int,		unique)
1138 		    __field(u64,			old_dv)
1139 		    __field(u64,			new_dv)
1140 			     ),
1141 
1142 	    TP_fast_assign(
1143 		    __entry->vnode	= dvnode->fid.vnode;
1144 		    __entry->unique	= dvnode->fid.unique;
1145 		    __entry->old_dv	= dvnode->status.data_version;
1146 		    __entry->new_dv	= new_dv;
1147 			   ),
1148 
1149 	    TP_printk("di=%x:%x dv=%llx -> dv=%llx",
1150 		      __entry->vnode, __entry->unique,
1151 		      __entry->old_dv, __entry->new_dv)
1152 	    );
1153 
1154 TRACE_EVENT(afs_dv_mismatch,
1155 	    TP_PROTO(const struct afs_vnode *dvnode, u64 before_dv, int delta, u64 new_dv),
1156 
1157 	    TP_ARGS(dvnode, before_dv, delta, new_dv),
1158 
1159 	    TP_STRUCT__entry(
1160 		    __field(unsigned int,		vnode)
1161 		    __field(unsigned int,		unique)
1162 		    __field(int,			delta)
1163 		    __field(u64,			before_dv)
1164 		    __field(u64,			new_dv)
1165 			     ),
1166 
1167 	    TP_fast_assign(
1168 		    __entry->vnode	= dvnode->fid.vnode;
1169 		    __entry->unique	= dvnode->fid.unique;
1170 		    __entry->delta	= delta;
1171 		    __entry->before_dv	= before_dv;
1172 		    __entry->new_dv	= new_dv;
1173 			   ),
1174 
1175 	    TP_printk("di=%x:%x xdv=%llx+%d dv=%llx",
1176 		      __entry->vnode, __entry->unique,
1177 		      __entry->before_dv, __entry->delta, __entry->new_dv)
1178 	    );
1179 
1180 TRACE_EVENT(afs_protocol_error,
1181 	    TP_PROTO(struct afs_call *call, enum afs_eproto_cause cause),
1182 
1183 	    TP_ARGS(call, cause),
1184 
1185 	    TP_STRUCT__entry(
1186 		    __field(unsigned int,		call)
1187 		    __field(enum afs_eproto_cause,	cause)
1188 			     ),
1189 
1190 	    TP_fast_assign(
1191 		    __entry->call = call ? call->debug_id : 0;
1192 		    __entry->cause = cause;
1193 			   ),
1194 
1195 	    TP_printk("c=%08x %s",
1196 		      __entry->call,
1197 		      __print_symbolic(__entry->cause, afs_eproto_causes))
1198 	    );
1199 
1200 TRACE_EVENT(afs_io_error,
1201 	    TP_PROTO(unsigned int call, int error, enum afs_io_error where),
1202 
1203 	    TP_ARGS(call, error, where),
1204 
1205 	    TP_STRUCT__entry(
1206 		    __field(unsigned int,	call)
1207 		    __field(int,		error)
1208 		    __field(enum afs_io_error,	where)
1209 			     ),
1210 
1211 	    TP_fast_assign(
1212 		    __entry->call = call;
1213 		    __entry->error = error;
1214 		    __entry->where = where;
1215 			   ),
1216 
1217 	    TP_printk("c=%08x r=%d %s",
1218 		      __entry->call, __entry->error,
1219 		      __print_symbolic(__entry->where, afs_io_errors))
1220 	    );
1221 
1222 TRACE_EVENT(afs_file_error,
1223 	    TP_PROTO(struct afs_vnode *vnode, int error, enum afs_file_error where),
1224 
1225 	    TP_ARGS(vnode, error, where),
1226 
1227 	    TP_STRUCT__entry(
1228 		    __field_struct(struct afs_fid,	fid)
1229 		    __field(int,			error)
1230 		    __field(enum afs_file_error,	where)
1231 			     ),
1232 
1233 	    TP_fast_assign(
1234 		    __entry->fid = vnode->fid;
1235 		    __entry->error = error;
1236 		    __entry->where = where;
1237 			   ),
1238 
1239 	    TP_printk("%llx:%llx:%x r=%d %s",
1240 		      __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1241 		      __entry->error,
1242 		      __print_symbolic(__entry->where, afs_file_errors))
1243 	    );
1244 
1245 TRACE_EVENT(afs_bulkstat_error,
1246 	    TP_PROTO(struct afs_operation *op, struct afs_fid *fid, unsigned int index, s32 abort),
1247 
1248 	    TP_ARGS(op, fid, index, abort),
1249 
1250 	    TP_STRUCT__entry(
1251 		    __field_struct(struct afs_fid,	fid)
1252 		    __field(unsigned int,		op)
1253 		    __field(unsigned int,		index)
1254 		    __field(s32,			abort)
1255 			     ),
1256 
1257 	    TP_fast_assign(
1258 		    __entry->op = op->debug_id;
1259 		    __entry->fid = *fid;
1260 		    __entry->index = index;
1261 		    __entry->abort = abort;
1262 			   ),
1263 
1264 	    TP_printk("OP=%08x[%02x] %llx:%llx:%x a=%d",
1265 		      __entry->op, __entry->index,
1266 		      __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1267 		      __entry->abort)
1268 	    );
1269 
1270 TRACE_EVENT(afs_cm_no_server,
1271 	    TP_PROTO(struct afs_call *call, struct sockaddr_rxrpc *srx),
1272 
1273 	    TP_ARGS(call, srx),
1274 
1275 	    TP_STRUCT__entry(
1276 		    __field(unsigned int,			call)
1277 		    __field(unsigned int,			op_id)
1278 		    __field_struct(struct sockaddr_rxrpc,	srx)
1279 			     ),
1280 
1281 	    TP_fast_assign(
1282 		    __entry->call = call->debug_id;
1283 		    __entry->op_id = call->operation_ID;
1284 		    memcpy(&__entry->srx, srx, sizeof(__entry->srx));
1285 			   ),
1286 
1287 	    TP_printk("c=%08x op=%u %pISpc",
1288 		      __entry->call, __entry->op_id, &__entry->srx.transport)
1289 	    );
1290 
1291 TRACE_EVENT(afs_cm_no_server_u,
1292 	    TP_PROTO(struct afs_call *call, const uuid_t *uuid),
1293 
1294 	    TP_ARGS(call, uuid),
1295 
1296 	    TP_STRUCT__entry(
1297 		    __field(unsigned int,			call)
1298 		    __field(unsigned int,			op_id)
1299 		    __field_struct(uuid_t,			uuid)
1300 			     ),
1301 
1302 	    TP_fast_assign(
1303 		    __entry->call = call->debug_id;
1304 		    __entry->op_id = call->operation_ID;
1305 		    memcpy(&__entry->uuid, uuid, sizeof(__entry->uuid));
1306 			   ),
1307 
1308 	    TP_printk("c=%08x op=%u %pU",
1309 		      __entry->call, __entry->op_id, &__entry->uuid)
1310 	    );
1311 
1312 TRACE_EVENT(afs_flock_ev,
1313 	    TP_PROTO(struct afs_vnode *vnode, struct file_lock *fl,
1314 		     enum afs_flock_event event, int error),
1315 
1316 	    TP_ARGS(vnode, fl, event, error),
1317 
1318 	    TP_STRUCT__entry(
1319 		    __field_struct(struct afs_fid,	fid)
1320 		    __field(enum afs_flock_event,	event)
1321 		    __field(enum afs_lock_state,	state)
1322 		    __field(int,			error)
1323 		    __field(unsigned int,		debug_id)
1324 			     ),
1325 
1326 	    TP_fast_assign(
1327 		    __entry->fid = vnode->fid;
1328 		    __entry->event = event;
1329 		    __entry->state = vnode->lock_state;
1330 		    __entry->error = error;
1331 		    __entry->debug_id = fl ? fl->fl_u.afs.debug_id : 0;
1332 			   ),
1333 
1334 	    TP_printk("%llx:%llx:%x %04x %s s=%s e=%d",
1335 		      __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1336 		      __entry->debug_id,
1337 		      __print_symbolic(__entry->event, afs_flock_events),
1338 		      __print_symbolic(__entry->state, afs_flock_states),
1339 		      __entry->error)
1340 	    );
1341 
1342 TRACE_EVENT(afs_flock_op,
1343 	    TP_PROTO(struct afs_vnode *vnode, struct file_lock *fl,
1344 		     enum afs_flock_operation op),
1345 
1346 	    TP_ARGS(vnode, fl, op),
1347 
1348 	    TP_STRUCT__entry(
1349 		    __field_struct(struct afs_fid,	fid)
1350 		    __field(loff_t,			from)
1351 		    __field(loff_t,			len)
1352 		    __field(enum afs_flock_operation,	op)
1353 		    __field(unsigned char,		type)
1354 		    __field(unsigned int,		flags)
1355 		    __field(unsigned int,		debug_id)
1356 			     ),
1357 
1358 	    TP_fast_assign(
1359 		    __entry->fid = vnode->fid;
1360 		    __entry->from = fl->fl_start;
1361 		    __entry->len = fl->fl_end - fl->fl_start + 1;
1362 		    __entry->op = op;
1363 		    __entry->type = fl->c.flc_type;
1364 		    __entry->flags = fl->c.flc_flags;
1365 		    __entry->debug_id = fl->fl_u.afs.debug_id;
1366 			   ),
1367 
1368 	    TP_printk("%llx:%llx:%x %04x %s t=%s R=%llx/%llx f=%x",
1369 		      __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1370 		      __entry->debug_id,
1371 		      __print_symbolic(__entry->op, afs_flock_operations),
1372 		      __print_symbolic(__entry->type, afs_flock_types),
1373 		      __entry->from, __entry->len, __entry->flags)
1374 	    );
1375 
1376 TRACE_EVENT(afs_reload_dir,
1377 	    TP_PROTO(struct afs_vnode *vnode),
1378 
1379 	    TP_ARGS(vnode),
1380 
1381 	    TP_STRUCT__entry(
1382 		    __field_struct(struct afs_fid,	fid)
1383 			     ),
1384 
1385 	    TP_fast_assign(
1386 		    __entry->fid = vnode->fid;
1387 			   ),
1388 
1389 	    TP_printk("%llx:%llx:%x",
1390 		      __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique)
1391 	    );
1392 
1393 TRACE_EVENT(afs_silly_rename,
1394 	    TP_PROTO(struct afs_vnode *vnode, bool done),
1395 
1396 	    TP_ARGS(vnode, done),
1397 
1398 	    TP_STRUCT__entry(
1399 		    __field_struct(struct afs_fid,	fid)
1400 		    __field(bool,			done)
1401 			     ),
1402 
1403 	    TP_fast_assign(
1404 		    __entry->fid = vnode->fid;
1405 		    __entry->done = done;
1406 			   ),
1407 
1408 	    TP_printk("%llx:%llx:%x done=%u",
1409 		      __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1410 		      __entry->done)
1411 	    );
1412 
1413 TRACE_EVENT(afs_get_tree,
1414 	    TP_PROTO(struct afs_cell *cell, struct afs_volume *volume),
1415 
1416 	    TP_ARGS(cell, volume),
1417 
1418 	    TP_STRUCT__entry(
1419 		    __field(u64,			vid)
1420 		    __array(char,			cell, 24)
1421 		    __array(char,			volume, 24)
1422 			     ),
1423 
1424 	    TP_fast_assign(
1425 		    int __len;
1426 		    __entry->vid = volume->vid;
1427 		    __len = min_t(int, cell->name_len, 23);
1428 		    memcpy(__entry->cell, cell->name, __len);
1429 		    __entry->cell[__len] = 0;
1430 		    __len = min_t(int, volume->name_len, 23);
1431 		    memcpy(__entry->volume, volume->name, __len);
1432 		    __entry->volume[__len] = 0;
1433 			   ),
1434 
1435 	    TP_printk("--- MOUNT %s:%s %llx",
1436 		      __entry->cell, __entry->volume, __entry->vid)
1437 	    );
1438 
1439 TRACE_EVENT(afs_cb_v_break,
1440 	    TP_PROTO(afs_volid_t vid, unsigned int cb_v_break,
1441 		     enum afs_cb_break_reason reason),
1442 
1443 	    TP_ARGS(vid, cb_v_break, reason),
1444 
1445 	    TP_STRUCT__entry(
1446 		    __field(afs_volid_t,		vid)
1447 		    __field(unsigned int,		cb_v_break)
1448 		    __field(enum afs_cb_break_reason,	reason)
1449 			     ),
1450 
1451 	    TP_fast_assign(
1452 		    __entry->vid	= vid;
1453 		    __entry->cb_v_break	= cb_v_break;
1454 		    __entry->reason	= reason;
1455 			   ),
1456 
1457 	    TP_printk("%llx vb=%x %s",
1458 		      __entry->vid,
1459 		      __entry->cb_v_break,
1460 		      __print_symbolic(__entry->reason, afs_cb_break_reasons))
1461 	    );
1462 
1463 TRACE_EVENT(afs_cb_break,
1464 	    TP_PROTO(struct afs_fid *fid, unsigned int cb_break,
1465 		     enum afs_cb_break_reason reason, bool skipped),
1466 
1467 	    TP_ARGS(fid, cb_break, reason, skipped),
1468 
1469 	    TP_STRUCT__entry(
1470 		    __field_struct(struct afs_fid,	fid)
1471 		    __field(unsigned int,		cb_break)
1472 		    __field(enum afs_cb_break_reason,	reason)
1473 		    __field(bool,			skipped)
1474 			     ),
1475 
1476 	    TP_fast_assign(
1477 		    __entry->fid	= *fid;
1478 		    __entry->cb_break	= cb_break;
1479 		    __entry->reason	= reason;
1480 		    __entry->skipped	= skipped;
1481 			   ),
1482 
1483 	    TP_printk("%llx:%llx:%x b=%x s=%u %s",
1484 		      __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1485 		      __entry->cb_break,
1486 		      __entry->skipped,
1487 		      __print_symbolic(__entry->reason, afs_cb_break_reasons))
1488 	    );
1489 
1490 TRACE_EVENT(afs_cb_miss,
1491 	    TP_PROTO(struct afs_fid *fid, enum afs_cb_break_reason reason),
1492 
1493 	    TP_ARGS(fid, reason),
1494 
1495 	    TP_STRUCT__entry(
1496 		    __field_struct(struct afs_fid,	fid)
1497 		    __field(enum afs_cb_break_reason,	reason)
1498 			     ),
1499 
1500 	    TP_fast_assign(
1501 		    __entry->fid	= *fid;
1502 		    __entry->reason	= reason;
1503 			   ),
1504 
1505 	    TP_printk(" %llx:%llx:%x %s",
1506 		      __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1507 		      __print_symbolic(__entry->reason, afs_cb_break_reasons))
1508 	    );
1509 
1510 TRACE_EVENT(afs_server,
1511 	    TP_PROTO(unsigned int server_debug_id, int ref, int active,
1512 		     enum afs_server_trace reason),
1513 
1514 	    TP_ARGS(server_debug_id, ref, active, reason),
1515 
1516 	    TP_STRUCT__entry(
1517 		    __field(unsigned int,		server)
1518 		    __field(int,			ref)
1519 		    __field(int,			active)
1520 		    __field(int,			reason)
1521 			     ),
1522 
1523 	    TP_fast_assign(
1524 		    __entry->server = server_debug_id;
1525 		    __entry->ref = ref;
1526 		    __entry->active = active;
1527 		    __entry->reason = reason;
1528 			   ),
1529 
1530 	    TP_printk("s=%08x %s u=%d a=%d",
1531 		      __entry->server,
1532 		      __print_symbolic(__entry->reason, afs_server_traces),
1533 		      __entry->ref,
1534 		      __entry->active)
1535 	    );
1536 
1537 TRACE_EVENT(afs_volume,
1538 	    TP_PROTO(afs_volid_t vid, int ref, enum afs_volume_trace reason),
1539 
1540 	    TP_ARGS(vid, ref, reason),
1541 
1542 	    TP_STRUCT__entry(
1543 		    __field(afs_volid_t,		vid)
1544 		    __field(int,			ref)
1545 		    __field(enum afs_volume_trace,	reason)
1546 			     ),
1547 
1548 	    TP_fast_assign(
1549 		    __entry->vid = vid;
1550 		    __entry->ref = ref;
1551 		    __entry->reason = reason;
1552 			   ),
1553 
1554 	    TP_printk("V=%llx %s ur=%d",
1555 		      __entry->vid,
1556 		      __print_symbolic(__entry->reason, afs_volume_traces),
1557 		      __entry->ref)
1558 	    );
1559 
1560 TRACE_EVENT(afs_cell,
1561 	    TP_PROTO(unsigned int cell_debug_id, int ref, int active,
1562 		     enum afs_cell_trace reason),
1563 
1564 	    TP_ARGS(cell_debug_id, ref, active, reason),
1565 
1566 	    TP_STRUCT__entry(
1567 		    __field(unsigned int,		cell)
1568 		    __field(int,			ref)
1569 		    __field(int,			active)
1570 		    __field(int,			reason)
1571 			     ),
1572 
1573 	    TP_fast_assign(
1574 		    __entry->cell = cell_debug_id;
1575 		    __entry->ref = ref;
1576 		    __entry->active = active;
1577 		    __entry->reason = reason;
1578 			   ),
1579 
1580 	    TP_printk("L=%08x %s r=%d a=%d",
1581 		      __entry->cell,
1582 		      __print_symbolic(__entry->reason, afs_cell_traces),
1583 		      __entry->ref,
1584 		      __entry->active)
1585 	    );
1586 
1587 TRACE_EVENT(afs_alist,
1588 	    TP_PROTO(unsigned int alist_debug_id, int ref, enum afs_alist_trace reason),
1589 
1590 	    TP_ARGS(alist_debug_id, ref, reason),
1591 
1592 	    TP_STRUCT__entry(
1593 		    __field(unsigned int,		alist)
1594 		    __field(int,			ref)
1595 		    __field(int,			active)
1596 		    __field(int,			reason)
1597 			     ),
1598 
1599 	    TP_fast_assign(
1600 		    __entry->alist = alist_debug_id;
1601 		    __entry->ref = ref;
1602 		    __entry->reason = reason;
1603 			   ),
1604 
1605 	    TP_printk("AL=%08x %s r=%d",
1606 		      __entry->alist,
1607 		      __print_symbolic(__entry->reason, afs_alist_traces),
1608 		      __entry->ref)
1609 	    );
1610 
1611 TRACE_EVENT(afs_estate,
1612 	    TP_PROTO(unsigned int server_debug_id, unsigned int estate_debug_id,
1613 		     int ref, enum afs_estate_trace reason),
1614 
1615 	    TP_ARGS(server_debug_id, estate_debug_id, ref, reason),
1616 
1617 	    TP_STRUCT__entry(
1618 		    __field(unsigned int,		server)
1619 		    __field(unsigned int,		estate)
1620 		    __field(int,			ref)
1621 		    __field(int,			active)
1622 		    __field(int,			reason)
1623 			     ),
1624 
1625 	    TP_fast_assign(
1626 		    __entry->server = server_debug_id;
1627 		    __entry->estate = estate_debug_id;
1628 		    __entry->ref = ref;
1629 		    __entry->reason = reason;
1630 			   ),
1631 
1632 	    TP_printk("ES=%08x[%x] %s r=%d",
1633 		      __entry->server,
1634 		      __entry->estate,
1635 		      __print_symbolic(__entry->reason, afs_estate_traces),
1636 		      __entry->ref)
1637 	    );
1638 
1639 TRACE_EVENT(afs_fs_probe,
1640 	    TP_PROTO(struct afs_server *server, bool tx, struct afs_endpoint_state *estate,
1641 		     unsigned int addr_index, int error, s32 abort_code, unsigned int rtt_us),
1642 
1643 	    TP_ARGS(server, tx, estate, addr_index, error, abort_code, rtt_us),
1644 
1645 	    TP_STRUCT__entry(
1646 		    __field(unsigned int,		server)
1647 		    __field(unsigned int,		estate)
1648 		    __field(bool,			tx)
1649 		    __field(u16,			addr_index)
1650 		    __field(short,			error)
1651 		    __field(s32,			abort_code)
1652 		    __field(unsigned int,		rtt_us)
1653 		    __field_struct(struct sockaddr_rxrpc, srx)
1654 			     ),
1655 
1656 	    TP_fast_assign(
1657 		    struct afs_addr_list *alist = estate->addresses;
1658 		    __entry->server = server->debug_id;
1659 		    __entry->estate = estate->probe_seq;
1660 		    __entry->tx = tx;
1661 		    __entry->addr_index = addr_index;
1662 		    __entry->error = error;
1663 		    __entry->abort_code = abort_code;
1664 		    __entry->rtt_us = rtt_us;
1665 		    memcpy(&__entry->srx, rxrpc_kernel_remote_srx(alist->addrs[addr_index].peer),
1666 			   sizeof(__entry->srx));
1667 			   ),
1668 
1669 	    TP_printk("s=%08x %s pq=%x ax=%u e=%d ac=%d rtt=%d %pISpc",
1670 		      __entry->server, __entry->tx ? "tx" : "rx", __entry->estate,
1671 		      __entry->addr_index, __entry->error, __entry->abort_code, __entry->rtt_us,
1672 		      &__entry->srx.transport)
1673 	    );
1674 
1675 TRACE_EVENT(afs_vl_probe,
1676 	    TP_PROTO(struct afs_vlserver *server, bool tx, struct afs_addr_list *alist,
1677 		     unsigned int addr_index, int error, s32 abort_code, unsigned int rtt_us),
1678 
1679 	    TP_ARGS(server, tx, alist, addr_index, error, abort_code, rtt_us),
1680 
1681 	    TP_STRUCT__entry(
1682 		    __field(unsigned int,		server)
1683 		    __field(bool,			tx)
1684 		    __field(unsigned short,		flags)
1685 		    __field(u16,			addr_index)
1686 		    __field(short,			error)
1687 		    __field(s32,			abort_code)
1688 		    __field(unsigned int,		rtt_us)
1689 		    __field_struct(struct sockaddr_rxrpc, srx)
1690 			     ),
1691 
1692 	    TP_fast_assign(
1693 		    __entry->server = server->debug_id;
1694 		    __entry->tx = tx;
1695 		    __entry->addr_index = addr_index;
1696 		    __entry->error = error;
1697 		    __entry->abort_code = abort_code;
1698 		    __entry->rtt_us = rtt_us;
1699 		    memcpy(&__entry->srx, rxrpc_kernel_remote_srx(alist->addrs[addr_index].peer),
1700 			   sizeof(__entry->srx));
1701 			   ),
1702 
1703 	    TP_printk("vl=%08x %s ax=%u e=%d ac=%d rtt=%d %pISpc",
1704 		      __entry->server, __entry->tx ? "tx" : "rx", __entry->addr_index,
1705 		      __entry->error, __entry->abort_code, __entry->rtt_us,
1706 		      &__entry->srx.transport)
1707 	    );
1708 
1709 TRACE_EVENT(afs_rotate,
1710 	    TP_PROTO(struct afs_operation *op, enum afs_rotate_trace reason, unsigned int extra),
1711 
1712 	    TP_ARGS(op, reason, extra),
1713 
1714 	    TP_STRUCT__entry(
1715 		    __field(unsigned int,		op)
1716 		    __field(unsigned int,		flags)
1717 		    __field(unsigned int,		extra)
1718 		    __field(unsigned short,		iteration)
1719 		    __field(short,			server_index)
1720 		    __field(short,			addr_index)
1721 		    __field(enum afs_rotate_trace,	reason)
1722 			     ),
1723 
1724 	    TP_fast_assign(
1725 		    __entry->op = op->debug_id;
1726 		    __entry->flags = op->flags;
1727 		    __entry->iteration = op->nr_iterations;
1728 		    __entry->server_index = op->server_index;
1729 		    __entry->addr_index = op->addr_index;
1730 		    __entry->reason = reason;
1731 		    __entry->extra = extra;
1732 			   ),
1733 
1734 	    TP_printk("OP=%08x it=%02x %s fl=%x sx=%d ax=%d ext=%d",
1735 		      __entry->op,
1736 		      __entry->iteration,
1737 		      __print_symbolic(__entry->reason, afs_rotate_traces),
1738 		      __entry->flags,
1739 		      __entry->server_index,
1740 		      __entry->addr_index,
1741 		      __entry->extra)
1742 	    );
1743 
1744 TRACE_EVENT(afs_make_call,
1745 	    TP_PROTO(struct afs_call *call),
1746 
1747 	    TP_ARGS(call),
1748 
1749 	    TP_STRUCT__entry(
1750 		    __field(unsigned int,		call)
1751 		    __field(bool,			is_vl)
1752 		    __field(enum afs_fs_operation,	op)
1753 		    __field_struct(struct afs_fid,	fid)
1754 		    __field_struct(struct sockaddr_rxrpc, srx)
1755 			     ),
1756 
1757 	    TP_fast_assign(
1758 		    __entry->call = call->debug_id;
1759 		    __entry->op = call->operation_ID;
1760 		    __entry->fid = call->fid;
1761 		    memcpy(&__entry->srx, rxrpc_kernel_remote_srx(call->peer),
1762 			   sizeof(__entry->srx));
1763 		    __entry->srx.srx_service = call->service_id;
1764 		    __entry->is_vl = (__entry->srx.srx_service == VL_SERVICE ||
1765 				      __entry->srx.srx_service == YFS_VL_SERVICE);
1766 			   ),
1767 
1768 	    TP_printk("c=%08x %pISpc+%u %s %llx:%llx:%x",
1769 		      __entry->call,
1770 		      &__entry->srx.transport,
1771 		      __entry->srx.srx_service,
1772 		      __entry->is_vl ?
1773 		      __print_symbolic(__entry->op, afs_vl_operations) :
1774 		      __print_symbolic(__entry->op, afs_fs_operations),
1775 		      __entry->fid.vid,
1776 		      __entry->fid.vnode,
1777 		      __entry->fid.unique)
1778 	    );
1779 
1780 TRACE_EVENT(afs_read_recv,
1781 	    TP_PROTO(const struct afs_operation *op, const struct afs_call *call),
1782 
1783 	    TP_ARGS(op, call),
1784 
1785 	    TP_STRUCT__entry(
1786 		    __field(unsigned int,		rreq)
1787 		    __field(unsigned int,		sreq)
1788 		    __field(unsigned int,		op)
1789 		    __field(unsigned int,		op_flags)
1790 		    __field(unsigned int,		call)
1791 		    __field(enum afs_call_state,	call_state)
1792 			     ),
1793 
1794 	    TP_fast_assign(
1795 		    __entry->op = op->debug_id;
1796 		    __entry->sreq = op->fetch.subreq->debug_index;
1797 		    __entry->rreq = op->fetch.subreq->rreq->debug_id;
1798 		    __entry->op_flags = op->flags;
1799 		    __entry->call = call->debug_id;
1800 		    __entry->call_state = call->state;
1801 			   ),
1802 
1803 	    TP_printk("R=%08x[%x] OP=%08x c=%08x cs=%x of=%x",
1804 		      __entry->rreq, __entry->sreq,
1805 		      __entry->op,
1806 		      __entry->call, __entry->call_state,
1807 		      __entry->op_flags)
1808 	    );
1809 
1810 #endif /* _TRACE_AFS_H */
1811 
1812 /* This part must be outside protection */
1813 #include <trace/define_trace.h>
1814