1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved.
5 * Written by David Howells (dhowells@redhat.com)
8 #define TRACE_SYSTEM afs
10 #if !defined(_TRACE_AFS_H) || defined(TRACE_HEADER_MULTI_READ)
13 #include <linux/tracepoint.h>
16 * Define enums for tracing information.
18 #ifndef __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY
19 #define __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY
30 enum afs_server_trace {
31 afs_server_trace_alloc,
32 afs_server_trace_callback,
33 afs_server_trace_destroy,
34 afs_server_trace_free,
36 afs_server_trace_get_by_uuid,
37 afs_server_trace_get_caps,
38 afs_server_trace_get_install,
39 afs_server_trace_get_new_cbi,
40 afs_server_trace_give_up_cb,
41 afs_server_trace_put_call,
42 afs_server_trace_put_cbi,
43 afs_server_trace_put_find_rsq,
44 afs_server_trace_put_slist,
45 afs_server_trace_put_slist_isort,
46 afs_server_trace_put_uuid_rsq,
47 afs_server_trace_update,
50 enum afs_fs_operation {
51 afs_FS_FetchData = 130, /* AFS Fetch file data */
52 afs_FS_FetchACL = 131, /* AFS Fetch file ACL */
53 afs_FS_FetchStatus = 132, /* AFS Fetch file status */
54 afs_FS_StoreData = 133, /* AFS Store file data */
55 afs_FS_StoreACL = 134, /* AFS Store file ACL */
56 afs_FS_StoreStatus = 135, /* AFS Store file status */
57 afs_FS_RemoveFile = 136, /* AFS Remove a file */
58 afs_FS_CreateFile = 137, /* AFS Create a file */
59 afs_FS_Rename = 138, /* AFS Rename or move a file or directory */
60 afs_FS_Symlink = 139, /* AFS Create a symbolic link */
61 afs_FS_Link = 140, /* AFS Create a hard link */
62 afs_FS_MakeDir = 141, /* AFS Create a directory */
63 afs_FS_RemoveDir = 142, /* AFS Remove a directory */
64 afs_FS_GetVolumeInfo = 148, /* AFS Get information about a volume */
65 afs_FS_GetVolumeStatus = 149, /* AFS Get volume status information */
66 afs_FS_GetRootVolume = 151, /* AFS Get root volume name */
67 afs_FS_SetLock = 156, /* AFS Request a file lock */
68 afs_FS_ExtendLock = 157, /* AFS Extend a file lock */
69 afs_FS_ReleaseLock = 158, /* AFS Release a file lock */
70 afs_FS_Lookup = 161, /* AFS lookup file in directory */
71 afs_FS_InlineBulkStatus = 65536, /* AFS Fetch multiple file statuses with errors */
72 afs_FS_FetchData64 = 65537, /* AFS Fetch file data */
73 afs_FS_StoreData64 = 65538, /* AFS Store file data */
74 afs_FS_GiveUpAllCallBacks = 65539, /* AFS Give up all our callbacks on a server */
75 afs_FS_GetCapabilities = 65540, /* AFS Get FS server capabilities */
77 yfs_FS_FetchData = 130, /* YFS Fetch file data */
78 yfs_FS_FetchACL = 64131, /* YFS Fetch file ACL */
79 yfs_FS_FetchStatus = 64132, /* YFS Fetch file status */
80 yfs_FS_StoreACL = 64134, /* YFS Store file ACL */
81 yfs_FS_StoreStatus = 64135, /* YFS Store file status */
82 yfs_FS_RemoveFile = 64136, /* YFS Remove a file */
83 yfs_FS_CreateFile = 64137, /* YFS Create a file */
84 yfs_FS_Rename = 64138, /* YFS Rename or move a file or directory */
85 yfs_FS_Symlink = 64139, /* YFS Create a symbolic link */
86 yfs_FS_Link = 64140, /* YFS Create a hard link */
87 yfs_FS_MakeDir = 64141, /* YFS Create a directory */
88 yfs_FS_RemoveDir = 64142, /* YFS Remove a directory */
89 yfs_FS_GetVolumeStatus = 64149, /* YFS Get volume status information */
90 yfs_FS_SetVolumeStatus = 64150, /* YFS Set volume status information */
91 yfs_FS_SetLock = 64156, /* YFS Request a file lock */
92 yfs_FS_ExtendLock = 64157, /* YFS Extend a file lock */
93 yfs_FS_ReleaseLock = 64158, /* YFS Release a file lock */
94 yfs_FS_Lookup = 64161, /* YFS lookup file in directory */
95 yfs_FS_FlushCPS = 64165,
96 yfs_FS_FetchOpaqueACL = 64168,
97 yfs_FS_WhoAmI = 64170,
98 yfs_FS_RemoveACL = 64171,
99 yfs_FS_RemoveFile2 = 64173,
100 yfs_FS_StoreOpaqueACL2 = 64174,
101 yfs_FS_InlineBulkStatus = 64536, /* YFS Fetch multiple file statuses with errors */
102 yfs_FS_FetchData64 = 64537, /* YFS Fetch file data */
103 yfs_FS_StoreData64 = 64538, /* YFS Store file data */
104 yfs_FS_UpdateSymlink = 64540,
107 enum afs_vl_operation {
108 afs_VL_GetEntryByNameU = 527, /* AFS Get Vol Entry By Name operation ID */
109 afs_VL_GetAddrsU = 533, /* AFS Get FS server addresses */
110 afs_YFSVL_GetEndpoints = 64002, /* YFS Get FS & Vol server addresses */
111 afs_VL_GetCapabilities = 65537, /* AFS Get VL server capabilities */
114 enum afs_cm_operation {
115 afs_CB_CallBack = 204, /* AFS break callback promises */
116 afs_CB_InitCallBackState = 205, /* AFS initialise callback state */
117 afs_CB_Probe = 206, /* AFS probe client */
118 afs_CB_GetLock = 207, /* AFS get contents of CM lock table */
119 afs_CB_GetCE = 208, /* AFS get cache file description */
120 afs_CB_GetXStatsVersion = 209, /* AFS get version of extended statistics */
121 afs_CB_GetXStats = 210, /* AFS get contents of extended statistics data */
122 afs_CB_InitCallBackState3 = 213, /* AFS initialise callback state, version 3 */
123 afs_CB_ProbeUuid = 214, /* AFS check the client hasn't rebooted */
126 enum yfs_cm_operation {
127 yfs_CB_Probe = 206, /* YFS probe client */
128 yfs_CB_GetLock = 207, /* YFS get contents of CM lock table */
129 yfs_CB_XStatsVersion = 209, /* YFS get version of extended statistics */
130 yfs_CB_GetXStats = 210, /* YFS get contents of extended statistics data */
131 yfs_CB_InitCallBackState3 = 213, /* YFS initialise callback state, version 3 */
132 yfs_CB_ProbeUuid = 214, /* YFS check the client hasn't rebooted */
133 yfs_CB_GetServerPrefs = 215,
134 yfs_CB_GetCellServDV = 216,
135 yfs_CB_GetLocalCell = 217,
136 yfs_CB_GetCacheConfig = 218,
137 yfs_CB_GetCellByNum = 65537,
138 yfs_CB_TellMeAboutYourself = 65538, /* get client capabilities */
139 yfs_CB_CallBack = 64204,
142 enum afs_edit_dir_op {
144 afs_edit_dir_create_error,
145 afs_edit_dir_create_inval,
146 afs_edit_dir_create_nospc,
148 afs_edit_dir_delete_error,
149 afs_edit_dir_delete_inval,
150 afs_edit_dir_delete_noent,
153 enum afs_edit_dir_reason {
154 afs_edit_dir_for_create,
155 afs_edit_dir_for_link,
156 afs_edit_dir_for_mkdir,
157 afs_edit_dir_for_rename_0,
158 afs_edit_dir_for_rename_1,
159 afs_edit_dir_for_rename_2,
160 afs_edit_dir_for_rmdir,
161 afs_edit_dir_for_silly_0,
162 afs_edit_dir_for_silly_1,
163 afs_edit_dir_for_symlink,
164 afs_edit_dir_for_unlink,
167 enum afs_eproto_cause {
168 afs_eproto_bad_status,
170 afs_eproto_cb_fid_count,
171 afs_eproto_file_type,
172 afs_eproto_ibulkst_cb_count,
173 afs_eproto_ibulkst_count,
175 afs_eproto_offline_msg_len,
176 afs_eproto_volname_len,
177 afs_eproto_yvl_fsendpt4_len,
178 afs_eproto_yvl_fsendpt6_len,
179 afs_eproto_yvl_fsendpt_num,
180 afs_eproto_yvl_fsendpt_type,
181 afs_eproto_yvl_vlendpt4_len,
182 afs_eproto_yvl_vlendpt6_len,
183 afs_eproto_yvl_vlendpt_type,
187 afs_io_error_cm_reply,
188 afs_io_error_extract,
189 afs_io_error_fs_probe_fail,
190 afs_io_error_vl_lookup_fail,
191 afs_io_error_vl_probe_fail,
194 enum afs_file_error {
195 afs_file_error_dir_bad_magic,
196 afs_file_error_dir_big,
197 afs_file_error_dir_missing_page,
198 afs_file_error_dir_over_end,
199 afs_file_error_dir_small,
200 afs_file_error_dir_unmarked_ext,
201 afs_file_error_mntpt,
202 afs_file_error_writeback_fail,
205 enum afs_flock_event {
207 afs_flock_callback_break,
208 afs_flock_defer_unlock,
209 afs_flock_extend_fail,
210 afs_flock_fail_other,
212 afs_flock_no_lockers,
213 afs_flock_release_fail,
214 afs_flock_silly_delete,
216 afs_flock_try_to_lock,
218 afs_flock_vfs_locking,
221 afs_flock_work_extending,
222 afs_flock_work_retry,
223 afs_flock_work_unlocking,
224 afs_flock_would_block,
227 enum afs_flock_operation {
228 afs_flock_op_copy_lock,
232 afs_flock_op_release_lock,
233 afs_flock_op_return_ok,
234 afs_flock_op_return_eagain,
235 afs_flock_op_return_edeadlk,
236 afs_flock_op_return_error,
237 afs_flock_op_set_lock,
242 enum afs_cb_break_reason {
243 afs_cb_break_no_break,
244 afs_cb_break_for_callback,
245 afs_cb_break_for_deleted,
246 afs_cb_break_for_lapsed,
247 afs_cb_break_for_unlink,
248 afs_cb_break_for_vsbreak,
249 afs_cb_break_for_volume_callback,
250 afs_cb_break_for_zap,
253 #endif /* end __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY */
256 * Declare tracing information enums and their string mappings for display.
258 #define afs_call_traces \
259 EM(afs_call_trace_alloc, "ALLOC") \
260 EM(afs_call_trace_free, "FREE ") \
261 EM(afs_call_trace_get, "GET ") \
262 EM(afs_call_trace_put, "PUT ") \
263 EM(afs_call_trace_wake, "WAKE ") \
264 E_(afs_call_trace_work, "QUEUE")
266 #define afs_server_traces \
267 EM(afs_server_trace_alloc, "ALLOC ") \
268 EM(afs_server_trace_callback, "CALLBACK ") \
269 EM(afs_server_trace_destroy, "DESTROY ") \
270 EM(afs_server_trace_free, "FREE ") \
271 EM(afs_server_trace_gc, "GC ") \
272 EM(afs_server_trace_get_by_uuid, "GET uuid ") \
273 EM(afs_server_trace_get_caps, "GET caps ") \
274 EM(afs_server_trace_get_install, "GET inst ") \
275 EM(afs_server_trace_get_new_cbi, "GET cbi ") \
276 EM(afs_server_trace_give_up_cb, "giveup-cb") \
277 EM(afs_server_trace_put_call, "PUT call ") \
278 EM(afs_server_trace_put_cbi, "PUT cbi ") \
279 EM(afs_server_trace_put_find_rsq, "PUT f-rsq") \
280 EM(afs_server_trace_put_slist, "PUT slist") \
281 EM(afs_server_trace_put_slist_isort, "PUT isort") \
282 EM(afs_server_trace_put_uuid_rsq, "PUT u-req") \
283 E_(afs_server_trace_update, "UPDATE")
285 #define afs_fs_operations \
286 EM(afs_FS_FetchData, "FS.FetchData") \
287 EM(afs_FS_FetchStatus, "FS.FetchStatus") \
288 EM(afs_FS_StoreData, "FS.StoreData") \
289 EM(afs_FS_StoreStatus, "FS.StoreStatus") \
290 EM(afs_FS_RemoveFile, "FS.RemoveFile") \
291 EM(afs_FS_CreateFile, "FS.CreateFile") \
292 EM(afs_FS_Rename, "FS.Rename") \
293 EM(afs_FS_Symlink, "FS.Symlink") \
294 EM(afs_FS_Link, "FS.Link") \
295 EM(afs_FS_MakeDir, "FS.MakeDir") \
296 EM(afs_FS_RemoveDir, "FS.RemoveDir") \
297 EM(afs_FS_GetVolumeInfo, "FS.GetVolumeInfo") \
298 EM(afs_FS_GetVolumeStatus, "FS.GetVolumeStatus") \
299 EM(afs_FS_GetRootVolume, "FS.GetRootVolume") \
300 EM(afs_FS_SetLock, "FS.SetLock") \
301 EM(afs_FS_ExtendLock, "FS.ExtendLock") \
302 EM(afs_FS_ReleaseLock, "FS.ReleaseLock") \
303 EM(afs_FS_Lookup, "FS.Lookup") \
304 EM(afs_FS_InlineBulkStatus, "FS.InlineBulkStatus") \
305 EM(afs_FS_FetchData64, "FS.FetchData64") \
306 EM(afs_FS_StoreData64, "FS.StoreData64") \
307 EM(afs_FS_GiveUpAllCallBacks, "FS.GiveUpAllCallBacks") \
308 EM(afs_FS_GetCapabilities, "FS.GetCapabilities") \
309 EM(yfs_FS_FetchACL, "YFS.FetchACL") \
310 EM(yfs_FS_FetchStatus, "YFS.FetchStatus") \
311 EM(yfs_FS_StoreACL, "YFS.StoreACL") \
312 EM(yfs_FS_StoreStatus, "YFS.StoreStatus") \
313 EM(yfs_FS_RemoveFile, "YFS.RemoveFile") \
314 EM(yfs_FS_CreateFile, "YFS.CreateFile") \
315 EM(yfs_FS_Rename, "YFS.Rename") \
316 EM(yfs_FS_Symlink, "YFS.Symlink") \
317 EM(yfs_FS_Link, "YFS.Link") \
318 EM(yfs_FS_MakeDir, "YFS.MakeDir") \
319 EM(yfs_FS_RemoveDir, "YFS.RemoveDir") \
320 EM(yfs_FS_GetVolumeStatus, "YFS.GetVolumeStatus") \
321 EM(yfs_FS_SetVolumeStatus, "YFS.SetVolumeStatus") \
322 EM(yfs_FS_SetLock, "YFS.SetLock") \
323 EM(yfs_FS_ExtendLock, "YFS.ExtendLock") \
324 EM(yfs_FS_ReleaseLock, "YFS.ReleaseLock") \
325 EM(yfs_FS_Lookup, "YFS.Lookup") \
326 EM(yfs_FS_FlushCPS, "YFS.FlushCPS") \
327 EM(yfs_FS_FetchOpaqueACL, "YFS.FetchOpaqueACL") \
328 EM(yfs_FS_WhoAmI, "YFS.WhoAmI") \
329 EM(yfs_FS_RemoveACL, "YFS.RemoveACL") \
330 EM(yfs_FS_RemoveFile2, "YFS.RemoveFile2") \
331 EM(yfs_FS_StoreOpaqueACL2, "YFS.StoreOpaqueACL2") \
332 EM(yfs_FS_InlineBulkStatus, "YFS.InlineBulkStatus") \
333 EM(yfs_FS_FetchData64, "YFS.FetchData64") \
334 EM(yfs_FS_StoreData64, "YFS.StoreData64") \
335 E_(yfs_FS_UpdateSymlink, "YFS.UpdateSymlink")
337 #define afs_vl_operations \
338 EM(afs_VL_GetEntryByNameU, "VL.GetEntryByNameU") \
339 EM(afs_VL_GetAddrsU, "VL.GetAddrsU") \
340 EM(afs_YFSVL_GetEndpoints, "YFSVL.GetEndpoints") \
341 E_(afs_VL_GetCapabilities, "VL.GetCapabilities")
343 #define afs_cm_operations \
344 EM(afs_CB_CallBack, "CB.CallBack") \
345 EM(afs_CB_InitCallBackState, "CB.InitCallBackState") \
346 EM(afs_CB_Probe, "CB.Probe") \
347 EM(afs_CB_GetLock, "CB.GetLock") \
348 EM(afs_CB_GetCE, "CB.GetCE") \
349 EM(afs_CB_GetXStatsVersion, "CB.GetXStatsVersion") \
350 EM(afs_CB_GetXStats, "CB.GetXStats") \
351 EM(afs_CB_InitCallBackState3, "CB.InitCallBackState3") \
352 E_(afs_CB_ProbeUuid, "CB.ProbeUuid")
354 #define yfs_cm_operations \
355 EM(yfs_CB_Probe, "YFSCB.Probe") \
356 EM(yfs_CB_GetLock, "YFSCB.GetLock") \
357 EM(yfs_CB_XStatsVersion, "YFSCB.XStatsVersion") \
358 EM(yfs_CB_GetXStats, "YFSCB.GetXStats") \
359 EM(yfs_CB_InitCallBackState3, "YFSCB.InitCallBackState3") \
360 EM(yfs_CB_ProbeUuid, "YFSCB.ProbeUuid") \
361 EM(yfs_CB_GetServerPrefs, "YFSCB.GetServerPrefs") \
362 EM(yfs_CB_GetCellServDV, "YFSCB.GetCellServDV") \
363 EM(yfs_CB_GetLocalCell, "YFSCB.GetLocalCell") \
364 EM(yfs_CB_GetCacheConfig, "YFSCB.GetCacheConfig") \
365 EM(yfs_CB_GetCellByNum, "YFSCB.GetCellByNum") \
366 EM(yfs_CB_TellMeAboutYourself, "YFSCB.TellMeAboutYourself") \
367 E_(yfs_CB_CallBack, "YFSCB.CallBack")
369 #define afs_edit_dir_ops \
370 EM(afs_edit_dir_create, "create") \
371 EM(afs_edit_dir_create_error, "c_fail") \
372 EM(afs_edit_dir_create_inval, "c_invl") \
373 EM(afs_edit_dir_create_nospc, "c_nspc") \
374 EM(afs_edit_dir_delete, "delete") \
375 EM(afs_edit_dir_delete_error, "d_err ") \
376 EM(afs_edit_dir_delete_inval, "d_invl") \
377 E_(afs_edit_dir_delete_noent, "d_nent")
379 #define afs_edit_dir_reasons \
380 EM(afs_edit_dir_for_create, "Create") \
381 EM(afs_edit_dir_for_link, "Link ") \
382 EM(afs_edit_dir_for_mkdir, "MkDir ") \
383 EM(afs_edit_dir_for_rename_0, "Renam0") \
384 EM(afs_edit_dir_for_rename_1, "Renam1") \
385 EM(afs_edit_dir_for_rename_2, "Renam2") \
386 EM(afs_edit_dir_for_rmdir, "RmDir ") \
387 EM(afs_edit_dir_for_silly_0, "S_Ren0") \
388 EM(afs_edit_dir_for_silly_1, "S_Ren1") \
389 EM(afs_edit_dir_for_symlink, "Symlnk") \
390 E_(afs_edit_dir_for_unlink, "Unlink")
392 #define afs_eproto_causes \
393 EM(afs_eproto_bad_status, "BadStatus") \
394 EM(afs_eproto_cb_count, "CbCount") \
395 EM(afs_eproto_cb_fid_count, "CbFidCount") \
396 EM(afs_eproto_file_type, "FileTYpe") \
397 EM(afs_eproto_ibulkst_cb_count, "IBS.CbCount") \
398 EM(afs_eproto_ibulkst_count, "IBS.FidCount") \
399 EM(afs_eproto_motd_len, "MotdLen") \
400 EM(afs_eproto_offline_msg_len, "OfflineMsgLen") \
401 EM(afs_eproto_volname_len, "VolNameLen") \
402 EM(afs_eproto_yvl_fsendpt4_len, "YVL.FsEnd4Len") \
403 EM(afs_eproto_yvl_fsendpt6_len, "YVL.FsEnd6Len") \
404 EM(afs_eproto_yvl_fsendpt_num, "YVL.FsEndCount") \
405 EM(afs_eproto_yvl_fsendpt_type, "YVL.FsEndType") \
406 EM(afs_eproto_yvl_vlendpt4_len, "YVL.VlEnd4Len") \
407 EM(afs_eproto_yvl_vlendpt6_len, "YVL.VlEnd6Len") \
408 E_(afs_eproto_yvl_vlendpt_type, "YVL.VlEndType")
410 #define afs_io_errors \
411 EM(afs_io_error_cm_reply, "CM_REPLY") \
412 EM(afs_io_error_extract, "EXTRACT") \
413 EM(afs_io_error_fs_probe_fail, "FS_PROBE_FAIL") \
414 EM(afs_io_error_vl_lookup_fail, "VL_LOOKUP_FAIL") \
415 E_(afs_io_error_vl_probe_fail, "VL_PROBE_FAIL")
417 #define afs_file_errors \
418 EM(afs_file_error_dir_bad_magic, "DIR_BAD_MAGIC") \
419 EM(afs_file_error_dir_big, "DIR_BIG") \
420 EM(afs_file_error_dir_missing_page, "DIR_MISSING_PAGE") \
421 EM(afs_file_error_dir_over_end, "DIR_ENT_OVER_END") \
422 EM(afs_file_error_dir_small, "DIR_SMALL") \
423 EM(afs_file_error_dir_unmarked_ext, "DIR_UNMARKED_EXT") \
424 EM(afs_file_error_mntpt, "MNTPT_READ_FAILED") \
425 E_(afs_file_error_writeback_fail, "WRITEBACK_FAILED")
427 #define afs_flock_types \
428 EM(F_RDLCK, "RDLCK") \
429 EM(F_WRLCK, "WRLCK") \
432 #define afs_flock_states \
433 EM(AFS_VNODE_LOCK_NONE, "NONE") \
434 EM(AFS_VNODE_LOCK_WAITING_FOR_CB, "WAIT_FOR_CB") \
435 EM(AFS_VNODE_LOCK_SETTING, "SETTING") \
436 EM(AFS_VNODE_LOCK_GRANTED, "GRANTED") \
437 EM(AFS_VNODE_LOCK_EXTENDING, "EXTENDING") \
438 EM(AFS_VNODE_LOCK_NEED_UNLOCK, "NEED_UNLOCK") \
439 EM(AFS_VNODE_LOCK_UNLOCKING, "UNLOCKING") \
440 E_(AFS_VNODE_LOCK_DELETED, "DELETED")
442 #define afs_flock_events \
443 EM(afs_flock_acquired, "Acquired") \
444 EM(afs_flock_callback_break, "Callback") \
445 EM(afs_flock_defer_unlock, "D-Unlock") \
446 EM(afs_flock_extend_fail, "Ext_Fail") \
447 EM(afs_flock_fail_other, "ErrOther") \
448 EM(afs_flock_fail_perm, "ErrPerm ") \
449 EM(afs_flock_no_lockers, "NoLocker") \
450 EM(afs_flock_release_fail, "Rel_Fail") \
451 EM(afs_flock_silly_delete, "SillyDel") \
452 EM(afs_flock_timestamp, "Timestmp") \
453 EM(afs_flock_try_to_lock, "TryToLck") \
454 EM(afs_flock_vfs_lock, "VFSLock ") \
455 EM(afs_flock_vfs_locking, "VFSLking") \
456 EM(afs_flock_waited, "Waited ") \
457 EM(afs_flock_waiting, "Waiting ") \
458 EM(afs_flock_work_extending, "Extendng") \
459 EM(afs_flock_work_retry, "Retry ") \
460 EM(afs_flock_work_unlocking, "Unlcking") \
461 E_(afs_flock_would_block, "EWOULDBL")
463 #define afs_flock_operations \
464 EM(afs_flock_op_copy_lock, "COPY ") \
465 EM(afs_flock_op_flock, "->flock ") \
466 EM(afs_flock_op_grant, "GRANT ") \
467 EM(afs_flock_op_lock, "->lock ") \
468 EM(afs_flock_op_release_lock, "RELEASE ") \
469 EM(afs_flock_op_return_ok, "<-OK ") \
470 EM(afs_flock_op_return_edeadlk, "<-EDEADL") \
471 EM(afs_flock_op_return_eagain, "<-EAGAIN") \
472 EM(afs_flock_op_return_error, "<-ERROR ") \
473 EM(afs_flock_op_set_lock, "SET ") \
474 EM(afs_flock_op_unlock, "UNLOCK ") \
475 E_(afs_flock_op_wake, "WAKE ")
477 #define afs_cb_break_reasons \
478 EM(afs_cb_break_no_break, "no-break") \
479 EM(afs_cb_break_for_callback, "break-cb") \
480 EM(afs_cb_break_for_deleted, "break-del") \
481 EM(afs_cb_break_for_lapsed, "break-lapsed") \
482 EM(afs_cb_break_for_unlink, "break-unlink") \
483 EM(afs_cb_break_for_vsbreak, "break-vs") \
484 EM(afs_cb_break_for_volume_callback, "break-v-cb") \
485 E_(afs_cb_break_for_zap, "break-zap")
488 * Export enum symbols via userspace.
492 #define EM(a, b) TRACE_DEFINE_ENUM(a);
493 #define E_(a, b) TRACE_DEFINE_ENUM(a);
502 afs_edit_dir_reasons;
507 afs_flock_operations;
508 afs_cb_break_reasons;
511 * Now redefine the EM() and E_() macros to map the enums to the strings that
512 * will be printed in the output.
516 #define EM(a, b) { a, b },
517 #define E_(a, b) { a, b }
519 TRACE_EVENT(afs_receive_data,
520 TP_PROTO(struct afs_call *call, struct iov_iter *iter,
521 bool want_more, int ret),
523 TP_ARGS(call, iter, want_more, ret),
526 __field(loff_t, remain )
527 __field(unsigned int, call )
528 __field(enum afs_call_state, state )
529 __field(unsigned short, unmarshall )
530 __field(bool, want_more )
535 __entry->call = call->debug_id;
536 __entry->state = call->state;
537 __entry->unmarshall = call->unmarshall;
538 __entry->remain = iov_iter_count(iter);
539 __entry->want_more = want_more;
543 TP_printk("c=%08x r=%llu u=%u w=%u s=%u ret=%d",
552 TRACE_EVENT(afs_notify_call,
553 TP_PROTO(struct rxrpc_call *rxcall, struct afs_call *call),
555 TP_ARGS(rxcall, call),
558 __field(unsigned int, call )
559 __field(enum afs_call_state, state )
560 __field(unsigned short, unmarshall )
564 __entry->call = call->debug_id;
565 __entry->state = call->state;
566 __entry->unmarshall = call->unmarshall;
569 TP_printk("c=%08x s=%u u=%u",
571 __entry->state, __entry->unmarshall)
574 TRACE_EVENT(afs_cb_call,
575 TP_PROTO(struct afs_call *call),
580 __field(unsigned int, call )
582 __field(u16, service_id )
586 __entry->call = call->debug_id;
587 __entry->op = call->operation_ID;
588 __entry->service_id = call->service_id;
591 TP_printk("c=%08x %s",
593 __entry->service_id == 2501 ?
594 __print_symbolic(__entry->op, yfs_cm_operations) :
595 __print_symbolic(__entry->op, afs_cm_operations))
598 TRACE_EVENT(afs_call,
599 TP_PROTO(struct afs_call *call, enum afs_call_trace op,
600 int usage, int outstanding, const void *where),
602 TP_ARGS(call, op, usage, outstanding, where),
605 __field(unsigned int, call )
608 __field(int, outstanding )
609 __field(const void *, where )
613 __entry->call = call->debug_id;
615 __entry->usage = usage;
616 __entry->outstanding = outstanding;
617 __entry->where = where;
620 TP_printk("c=%08x %s u=%d o=%d sp=%pSR",
622 __print_symbolic(__entry->op, afs_call_traces),
624 __entry->outstanding,
628 TRACE_EVENT(afs_make_fs_call,
629 TP_PROTO(struct afs_call *call, const struct afs_fid *fid),
634 __field(unsigned int, call )
635 __field(enum afs_fs_operation, op )
636 __field_struct(struct afs_fid, fid )
640 __entry->call = call->debug_id;
641 __entry->op = call->operation_ID;
645 __entry->fid.vid = 0;
646 __entry->fid.vnode = 0;
647 __entry->fid.unique = 0;
651 TP_printk("c=%08x %06llx:%06llx:%06x %s",
656 __print_symbolic(__entry->op, afs_fs_operations))
659 TRACE_EVENT(afs_make_fs_calli,
660 TP_PROTO(struct afs_call *call, const struct afs_fid *fid,
663 TP_ARGS(call, fid, i),
666 __field(unsigned int, call )
667 __field(unsigned int, i )
668 __field(enum afs_fs_operation, op )
669 __field_struct(struct afs_fid, fid )
673 __entry->call = call->debug_id;
675 __entry->op = call->operation_ID;
679 __entry->fid.vid = 0;
680 __entry->fid.vnode = 0;
681 __entry->fid.unique = 0;
685 TP_printk("c=%08x %06llx:%06llx:%06x %s i=%u",
690 __print_symbolic(__entry->op, afs_fs_operations),
694 TRACE_EVENT(afs_make_fs_call1,
695 TP_PROTO(struct afs_call *call, const struct afs_fid *fid,
698 TP_ARGS(call, fid, name),
701 __field(unsigned int, call )
702 __field(enum afs_fs_operation, op )
703 __field_struct(struct afs_fid, fid )
704 __array(char, name, 24 )
708 int __len = strlen(name);
709 __len = min(__len, 23);
710 __entry->call = call->debug_id;
711 __entry->op = call->operation_ID;
715 __entry->fid.vid = 0;
716 __entry->fid.vnode = 0;
717 __entry->fid.unique = 0;
719 memcpy(__entry->name, name, __len);
720 __entry->name[__len] = 0;
723 TP_printk("c=%08x %06llx:%06llx:%06x %s \"%s\"",
728 __print_symbolic(__entry->op, afs_fs_operations),
732 TRACE_EVENT(afs_make_fs_call2,
733 TP_PROTO(struct afs_call *call, const struct afs_fid *fid,
734 const char *name, const char *name2),
736 TP_ARGS(call, fid, name, name2),
739 __field(unsigned int, call )
740 __field(enum afs_fs_operation, op )
741 __field_struct(struct afs_fid, fid )
742 __array(char, name, 24 )
743 __array(char, name2, 24 )
747 int __len = strlen(name);
748 int __len2 = strlen(name2);
749 __len = min(__len, 23);
750 __len2 = min(__len2, 23);
751 __entry->call = call->debug_id;
752 __entry->op = call->operation_ID;
756 __entry->fid.vid = 0;
757 __entry->fid.vnode = 0;
758 __entry->fid.unique = 0;
760 memcpy(__entry->name, name, __len);
761 __entry->name[__len] = 0;
762 memcpy(__entry->name2, name2, __len2);
763 __entry->name2[__len2] = 0;
766 TP_printk("c=%08x %06llx:%06llx:%06x %s \"%s\" \"%s\"",
771 __print_symbolic(__entry->op, afs_fs_operations),
776 TRACE_EVENT(afs_make_vl_call,
777 TP_PROTO(struct afs_call *call),
782 __field(unsigned int, call )
783 __field(enum afs_vl_operation, op )
787 __entry->call = call->debug_id;
788 __entry->op = call->operation_ID;
791 TP_printk("c=%08x %s",
793 __print_symbolic(__entry->op, afs_vl_operations))
796 TRACE_EVENT(afs_call_done,
797 TP_PROTO(struct afs_call *call),
802 __field(unsigned int, call )
803 __field(struct rxrpc_call *, rx_call )
805 __field(u32, abort_code )
809 __entry->call = call->debug_id;
810 __entry->rx_call = call->rxcall;
811 __entry->ret = call->error;
812 __entry->abort_code = call->abort_code;
815 TP_printk(" c=%08x ret=%d ab=%d [%p]",
822 TRACE_EVENT(afs_send_pages,
823 TP_PROTO(struct afs_call *call, struct msghdr *msg,
824 pgoff_t first, pgoff_t last, unsigned int offset),
826 TP_ARGS(call, msg, first, last, offset),
829 __field(unsigned int, call )
830 __field(pgoff_t, first )
831 __field(pgoff_t, last )
832 __field(unsigned int, nr )
833 __field(unsigned int, bytes )
834 __field(unsigned int, offset )
835 __field(unsigned int, flags )
839 __entry->call = call->debug_id;
840 __entry->first = first;
841 __entry->last = last;
842 __entry->nr = msg->msg_iter.nr_segs;
843 __entry->bytes = msg->msg_iter.count;
844 __entry->offset = offset;
845 __entry->flags = msg->msg_flags;
848 TP_printk(" c=%08x %lx-%lx-%lx b=%x o=%x f=%x",
850 __entry->first, __entry->first + __entry->nr - 1, __entry->last,
851 __entry->bytes, __entry->offset,
855 TRACE_EVENT(afs_sent_pages,
856 TP_PROTO(struct afs_call *call, pgoff_t first, pgoff_t last,
857 pgoff_t cursor, int ret),
859 TP_ARGS(call, first, last, cursor, ret),
862 __field(unsigned int, call )
863 __field(pgoff_t, first )
864 __field(pgoff_t, last )
865 __field(pgoff_t, cursor )
870 __entry->call = call->debug_id;
871 __entry->first = first;
872 __entry->last = last;
873 __entry->cursor = cursor;
877 TP_printk(" c=%08x %lx-%lx c=%lx r=%d",
879 __entry->first, __entry->last,
880 __entry->cursor, __entry->ret)
883 TRACE_EVENT(afs_dir_check_failed,
884 TP_PROTO(struct afs_vnode *vnode, loff_t off, loff_t i_size),
886 TP_ARGS(vnode, off, i_size),
889 __field(struct afs_vnode *, vnode )
890 __field(loff_t, off )
891 __field(loff_t, i_size )
895 __entry->vnode = vnode;
897 __entry->i_size = i_size;
900 TP_printk("vn=%p %llx/%llx",
901 __entry->vnode, __entry->off, __entry->i_size)
905 * We use page->private to hold the amount of the page that we've written to,
906 * splitting the field into two parts. However, we need to represent a range
907 * 0...PAGE_SIZE inclusive, so we can't support 64K pages on a 32-bit system.
909 #if PAGE_SIZE > 32768
910 #define AFS_PRIV_MAX 0xffffffff
911 #define AFS_PRIV_SHIFT 32
913 #define AFS_PRIV_MAX 0xffff
914 #define AFS_PRIV_SHIFT 16
917 TRACE_EVENT(afs_page_dirty,
918 TP_PROTO(struct afs_vnode *vnode, const char *where,
919 pgoff_t page, unsigned long priv),
921 TP_ARGS(vnode, where, page, priv),
924 __field(struct afs_vnode *, vnode )
925 __field(const char *, where )
926 __field(pgoff_t, page )
927 __field(unsigned long, priv )
931 __entry->vnode = vnode;
932 __entry->where = where;
933 __entry->page = page;
934 __entry->priv = priv;
937 TP_printk("vn=%p %lx %s %lu-%lu",
938 __entry->vnode, __entry->page, __entry->where,
939 __entry->priv & AFS_PRIV_MAX,
940 __entry->priv >> AFS_PRIV_SHIFT)
943 TRACE_EVENT(afs_call_state,
944 TP_PROTO(struct afs_call *call,
945 enum afs_call_state from,
946 enum afs_call_state to,
947 int ret, u32 remote_abort),
949 TP_ARGS(call, from, to, ret, remote_abort),
952 __field(unsigned int, call )
953 __field(enum afs_call_state, from )
954 __field(enum afs_call_state, to )
960 __entry->call = call->debug_id;
961 __entry->from = from;
964 __entry->abort = remote_abort;
967 TP_printk("c=%08x %u->%u r=%d ab=%d",
969 __entry->from, __entry->to,
970 __entry->ret, __entry->abort)
973 TRACE_EVENT(afs_lookup,
974 TP_PROTO(struct afs_vnode *dvnode, const struct qstr *name,
975 struct afs_fid *fid),
977 TP_ARGS(dvnode, name, fid),
980 __field_struct(struct afs_fid, dfid )
981 __field_struct(struct afs_fid, fid )
982 __array(char, name, 24 )
986 int __len = min_t(int, name->len, 23);
987 __entry->dfid = dvnode->fid;
989 memcpy(__entry->name, name->name, __len);
990 __entry->name[__len] = 0;
993 TP_printk("d=%llx:%llx:%x \"%s\" f=%llx:%x",
994 __entry->dfid.vid, __entry->dfid.vnode, __entry->dfid.unique,
996 __entry->fid.vnode, __entry->fid.unique)
999 TRACE_EVENT(afs_edit_dir,
1000 TP_PROTO(struct afs_vnode *dvnode,
1001 enum afs_edit_dir_reason why,
1002 enum afs_edit_dir_op op,
1005 unsigned int f_vnode,
1006 unsigned int f_unique,
1009 TP_ARGS(dvnode, why, op, block, slot, f_vnode, f_unique, name),
1012 __field(unsigned int, vnode )
1013 __field(unsigned int, unique )
1014 __field(enum afs_edit_dir_reason, why )
1015 __field(enum afs_edit_dir_op, op )
1016 __field(unsigned int, block )
1017 __field(unsigned short, slot )
1018 __field(unsigned int, f_vnode )
1019 __field(unsigned int, f_unique )
1020 __array(char, name, 24 )
1024 int __len = strlen(name);
1025 __len = min(__len, 23);
1026 __entry->vnode = dvnode->fid.vnode;
1027 __entry->unique = dvnode->fid.unique;
1030 __entry->block = block;
1031 __entry->slot = slot;
1032 __entry->f_vnode = f_vnode;
1033 __entry->f_unique = f_unique;
1034 memcpy(__entry->name, name, __len);
1035 __entry->name[__len] = 0;
1038 TP_printk("d=%x:%x %s %s %u[%u] f=%x:%x \"%s\"",
1039 __entry->vnode, __entry->unique,
1040 __print_symbolic(__entry->why, afs_edit_dir_reasons),
1041 __print_symbolic(__entry->op, afs_edit_dir_ops),
1042 __entry->block, __entry->slot,
1043 __entry->f_vnode, __entry->f_unique,
1047 TRACE_EVENT(afs_protocol_error,
1048 TP_PROTO(struct afs_call *call, int error, enum afs_eproto_cause cause),
1050 TP_ARGS(call, error, cause),
1053 __field(unsigned int, call )
1054 __field(int, error )
1055 __field(enum afs_eproto_cause, cause )
1059 __entry->call = call ? call->debug_id : 0;
1060 __entry->error = error;
1061 __entry->cause = cause;
1064 TP_printk("c=%08x r=%d %s",
1065 __entry->call, __entry->error,
1066 __print_symbolic(__entry->cause, afs_eproto_causes))
1069 TRACE_EVENT(afs_io_error,
1070 TP_PROTO(unsigned int call, int error, enum afs_io_error where),
1072 TP_ARGS(call, error, where),
1075 __field(unsigned int, call )
1076 __field(int, error )
1077 __field(enum afs_io_error, where )
1081 __entry->call = call;
1082 __entry->error = error;
1083 __entry->where = where;
1086 TP_printk("c=%08x r=%d %s",
1087 __entry->call, __entry->error,
1088 __print_symbolic(__entry->where, afs_io_errors))
1091 TRACE_EVENT(afs_file_error,
1092 TP_PROTO(struct afs_vnode *vnode, int error, enum afs_file_error where),
1094 TP_ARGS(vnode, error, where),
1097 __field_struct(struct afs_fid, fid )
1098 __field(int, error )
1099 __field(enum afs_file_error, where )
1103 __entry->fid = vnode->fid;
1104 __entry->error = error;
1105 __entry->where = where;
1108 TP_printk("%llx:%llx:%x r=%d %s",
1109 __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1111 __print_symbolic(__entry->where, afs_file_errors))
1114 TRACE_EVENT(afs_cm_no_server,
1115 TP_PROTO(struct afs_call *call, struct sockaddr_rxrpc *srx),
1120 __field(unsigned int, call )
1121 __field(unsigned int, op_id )
1122 __field_struct(struct sockaddr_rxrpc, srx )
1126 __entry->call = call->debug_id;
1127 __entry->op_id = call->operation_ID;
1128 memcpy(&__entry->srx, srx, sizeof(__entry->srx));
1131 TP_printk("c=%08x op=%u %pISpc",
1132 __entry->call, __entry->op_id, &__entry->srx.transport)
1135 TRACE_EVENT(afs_cm_no_server_u,
1136 TP_PROTO(struct afs_call *call, const uuid_t *uuid),
1138 TP_ARGS(call, uuid),
1141 __field(unsigned int, call )
1142 __field(unsigned int, op_id )
1143 __field_struct(uuid_t, uuid )
1147 __entry->call = call->debug_id;
1148 __entry->op_id = call->operation_ID;
1149 memcpy(&__entry->uuid, uuid, sizeof(__entry->uuid));
1152 TP_printk("c=%08x op=%u %pU",
1153 __entry->call, __entry->op_id, &__entry->uuid)
1156 TRACE_EVENT(afs_flock_ev,
1157 TP_PROTO(struct afs_vnode *vnode, struct file_lock *fl,
1158 enum afs_flock_event event, int error),
1160 TP_ARGS(vnode, fl, event, error),
1163 __field_struct(struct afs_fid, fid )
1164 __field(enum afs_flock_event, event )
1165 __field(enum afs_lock_state, state )
1166 __field(int, error )
1167 __field(unsigned int, debug_id )
1171 __entry->fid = vnode->fid;
1172 __entry->event = event;
1173 __entry->state = vnode->lock_state;
1174 __entry->error = error;
1175 __entry->debug_id = fl ? fl->fl_u.afs.debug_id : 0;
1178 TP_printk("%llx:%llx:%x %04x %s s=%s e=%d",
1179 __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1181 __print_symbolic(__entry->event, afs_flock_events),
1182 __print_symbolic(__entry->state, afs_flock_states),
1186 TRACE_EVENT(afs_flock_op,
1187 TP_PROTO(struct afs_vnode *vnode, struct file_lock *fl,
1188 enum afs_flock_operation op),
1190 TP_ARGS(vnode, fl, op),
1193 __field_struct(struct afs_fid, fid )
1194 __field(loff_t, from )
1195 __field(loff_t, len )
1196 __field(enum afs_flock_operation, op )
1197 __field(unsigned char, type )
1198 __field(unsigned int, flags )
1199 __field(unsigned int, debug_id )
1203 __entry->fid = vnode->fid;
1204 __entry->from = fl->fl_start;
1205 __entry->len = fl->fl_end - fl->fl_start + 1;
1207 __entry->type = fl->fl_type;
1208 __entry->flags = fl->fl_flags;
1209 __entry->debug_id = fl->fl_u.afs.debug_id;
1212 TP_printk("%llx:%llx:%x %04x %s t=%s R=%llx/%llx f=%x",
1213 __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1215 __print_symbolic(__entry->op, afs_flock_operations),
1216 __print_symbolic(__entry->type, afs_flock_types),
1217 __entry->from, __entry->len, __entry->flags)
1220 TRACE_EVENT(afs_reload_dir,
1221 TP_PROTO(struct afs_vnode *vnode),
1226 __field_struct(struct afs_fid, fid )
1230 __entry->fid = vnode->fid;
1233 TP_printk("%llx:%llx:%x",
1234 __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique)
1237 TRACE_EVENT(afs_silly_rename,
1238 TP_PROTO(struct afs_vnode *vnode, bool done),
1240 TP_ARGS(vnode, done),
1243 __field_struct(struct afs_fid, fid )
1244 __field(bool, done )
1248 __entry->fid = vnode->fid;
1249 __entry->done = done;
1252 TP_printk("%llx:%llx:%x done=%u",
1253 __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1257 TRACE_EVENT(afs_get_tree,
1258 TP_PROTO(struct afs_cell *cell, struct afs_volume *volume),
1260 TP_ARGS(cell, volume),
1264 __array(char, cell, 24 )
1265 __array(char, volume, 24 )
1270 __entry->vid = volume->vid;
1271 __len = min_t(int, cell->name_len, 23);
1272 memcpy(__entry->cell, cell->name, __len);
1273 __entry->cell[__len] = 0;
1274 __len = min_t(int, volume->name_len, 23);
1275 memcpy(__entry->volume, volume->name, __len);
1276 __entry->volume[__len] = 0;
1279 TP_printk("--- MOUNT %s:%s %llx",
1280 __entry->cell, __entry->volume, __entry->vid)
1283 TRACE_EVENT(afs_cb_break,
1284 TP_PROTO(struct afs_fid *fid, unsigned int cb_break,
1285 enum afs_cb_break_reason reason, bool skipped),
1287 TP_ARGS(fid, cb_break, reason, skipped),
1290 __field_struct(struct afs_fid, fid )
1291 __field(unsigned int, cb_break )
1292 __field(enum afs_cb_break_reason, reason )
1293 __field(bool, skipped )
1297 __entry->fid = *fid;
1298 __entry->cb_break = cb_break;
1299 __entry->reason = reason;
1300 __entry->skipped = skipped;
1303 TP_printk("%llx:%llx:%x b=%x s=%u %s",
1304 __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1307 __print_symbolic(__entry->reason, afs_cb_break_reasons))
1310 TRACE_EVENT(afs_cb_miss,
1311 TP_PROTO(struct afs_fid *fid, enum afs_cb_break_reason reason),
1313 TP_ARGS(fid, reason),
1316 __field_struct(struct afs_fid, fid )
1317 __field(enum afs_cb_break_reason, reason )
1321 __entry->fid = *fid;
1322 __entry->reason = reason;
1325 TP_printk(" %llx:%llx:%x %s",
1326 __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1327 __print_symbolic(__entry->reason, afs_cb_break_reasons))
1330 TRACE_EVENT(afs_server,
1331 TP_PROTO(struct afs_server *server, int usage, enum afs_server_trace reason),
1333 TP_ARGS(server, usage, reason),
1336 __field(unsigned int, server )
1337 __field(int, usage )
1338 __field(int, reason )
1342 __entry->server = server->debug_id;
1343 __entry->usage = usage;
1344 __entry->reason = reason;
1347 TP_printk("s=%08x %s u=%d",
1349 __print_symbolic(__entry->reason, afs_server_traces),
1353 #endif /* _TRACE_AFS_H */
1355 /* This part must be outside protection */
1356 #include <trace/define_trace.h>