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_edit_dir_op
{
116 afs_edit_dir_create_error
,
117 afs_edit_dir_create_inval
,
118 afs_edit_dir_create_nospc
,
120 afs_edit_dir_delete_error
,
121 afs_edit_dir_delete_inval
,
122 afs_edit_dir_delete_noent
,
125 enum afs_edit_dir_reason
{
126 afs_edit_dir_for_create
,
127 afs_edit_dir_for_link
,
128 afs_edit_dir_for_mkdir
,
129 afs_edit_dir_for_rename_0
,
130 afs_edit_dir_for_rename_1
,
131 afs_edit_dir_for_rename_2
,
132 afs_edit_dir_for_rmdir
,
133 afs_edit_dir_for_silly_0
,
134 afs_edit_dir_for_silly_1
,
135 afs_edit_dir_for_symlink
,
136 afs_edit_dir_for_unlink
,
139 enum afs_eproto_cause
{
140 afs_eproto_bad_status
,
142 afs_eproto_cb_fid_count
,
143 afs_eproto_file_type
,
144 afs_eproto_ibulkst_cb_count
,
145 afs_eproto_ibulkst_count
,
147 afs_eproto_offline_msg_len
,
148 afs_eproto_volname_len
,
149 afs_eproto_yvl_fsendpt4_len
,
150 afs_eproto_yvl_fsendpt6_len
,
151 afs_eproto_yvl_fsendpt_num
,
152 afs_eproto_yvl_fsendpt_type
,
153 afs_eproto_yvl_vlendpt4_len
,
154 afs_eproto_yvl_vlendpt6_len
,
155 afs_eproto_yvl_vlendpt_type
,
159 afs_io_error_cm_reply
,
160 afs_io_error_extract
,
161 afs_io_error_fs_probe_fail
,
162 afs_io_error_vl_lookup_fail
,
163 afs_io_error_vl_probe_fail
,
166 enum afs_file_error
{
167 afs_file_error_dir_bad_magic
,
168 afs_file_error_dir_big
,
169 afs_file_error_dir_missing_page
,
170 afs_file_error_dir_over_end
,
171 afs_file_error_dir_small
,
172 afs_file_error_dir_unmarked_ext
,
173 afs_file_error_mntpt
,
174 afs_file_error_writeback_fail
,
177 enum afs_flock_event
{
179 afs_flock_callback_break
,
180 afs_flock_defer_unlock
,
181 afs_flock_extend_fail
,
182 afs_flock_fail_other
,
184 afs_flock_no_lockers
,
185 afs_flock_release_fail
,
186 afs_flock_silly_delete
,
188 afs_flock_try_to_lock
,
190 afs_flock_vfs_locking
,
193 afs_flock_work_extending
,
194 afs_flock_work_retry
,
195 afs_flock_work_unlocking
,
196 afs_flock_would_block
,
199 enum afs_flock_operation
{
200 afs_flock_op_copy_lock
,
204 afs_flock_op_release_lock
,
205 afs_flock_op_return_ok
,
206 afs_flock_op_return_eagain
,
207 afs_flock_op_return_edeadlk
,
208 afs_flock_op_return_error
,
209 afs_flock_op_set_lock
,
214 enum afs_cb_break_reason
{
215 afs_cb_break_no_break
,
216 afs_cb_break_for_callback
,
217 afs_cb_break_for_deleted
,
218 afs_cb_break_for_lapsed
,
219 afs_cb_break_for_unlink
,
220 afs_cb_break_for_vsbreak
,
221 afs_cb_break_for_volume_callback
,
222 afs_cb_break_for_zap
,
225 #endif /* end __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY */
228 * Declare tracing information enums and their string mappings for display.
230 #define afs_call_traces \
231 EM(afs_call_trace_alloc, "ALLOC") \
232 EM(afs_call_trace_free, "FREE ") \
233 EM(afs_call_trace_get, "GET ") \
234 EM(afs_call_trace_put, "PUT ") \
235 EM(afs_call_trace_wake, "WAKE ") \
236 E_(afs_call_trace_work, "WORK ")
238 #define afs_server_traces \
239 EM(afs_server_trace_alloc, "ALLOC ") \
240 EM(afs_server_trace_callback, "CALLBACK ") \
241 EM(afs_server_trace_destroy, "DESTROY ") \
242 EM(afs_server_trace_free, "FREE ") \
243 EM(afs_server_trace_gc, "GC ") \
244 EM(afs_server_trace_get_by_uuid, "GET uuid ") \
245 EM(afs_server_trace_get_caps, "GET caps ") \
246 EM(afs_server_trace_get_install, "GET inst ") \
247 EM(afs_server_trace_get_new_cbi, "GET cbi ") \
248 EM(afs_server_trace_give_up_cb, "giveup-cb") \
249 EM(afs_server_trace_put_call, "PUT call ") \
250 EM(afs_server_trace_put_cbi, "PUT cbi ") \
251 EM(afs_server_trace_put_find_rsq, "PUT f-rsq") \
252 EM(afs_server_trace_put_slist, "PUT slist") \
253 EM(afs_server_trace_put_slist_isort, "PUT isort") \
254 EM(afs_server_trace_put_uuid_rsq, "PUT u-req") \
255 E_(afs_server_trace_update, "UPDATE")
257 #define afs_fs_operations \
258 EM(afs_FS_FetchData, "FS.FetchData") \
259 EM(afs_FS_FetchStatus, "FS.FetchStatus") \
260 EM(afs_FS_StoreData, "FS.StoreData") \
261 EM(afs_FS_StoreStatus, "FS.StoreStatus") \
262 EM(afs_FS_RemoveFile, "FS.RemoveFile") \
263 EM(afs_FS_CreateFile, "FS.CreateFile") \
264 EM(afs_FS_Rename, "FS.Rename") \
265 EM(afs_FS_Symlink, "FS.Symlink") \
266 EM(afs_FS_Link, "FS.Link") \
267 EM(afs_FS_MakeDir, "FS.MakeDir") \
268 EM(afs_FS_RemoveDir, "FS.RemoveDir") \
269 EM(afs_FS_GetVolumeInfo, "FS.GetVolumeInfo") \
270 EM(afs_FS_GetVolumeStatus, "FS.GetVolumeStatus") \
271 EM(afs_FS_GetRootVolume, "FS.GetRootVolume") \
272 EM(afs_FS_SetLock, "FS.SetLock") \
273 EM(afs_FS_ExtendLock, "FS.ExtendLock") \
274 EM(afs_FS_ReleaseLock, "FS.ReleaseLock") \
275 EM(afs_FS_Lookup, "FS.Lookup") \
276 EM(afs_FS_InlineBulkStatus, "FS.InlineBulkStatus") \
277 EM(afs_FS_FetchData64, "FS.FetchData64") \
278 EM(afs_FS_StoreData64, "FS.StoreData64") \
279 EM(afs_FS_GiveUpAllCallBacks, "FS.GiveUpAllCallBacks") \
280 EM(afs_FS_GetCapabilities, "FS.GetCapabilities") \
281 EM(yfs_FS_FetchACL, "YFS.FetchACL") \
282 EM(yfs_FS_FetchStatus, "YFS.FetchStatus") \
283 EM(yfs_FS_StoreACL, "YFS.StoreACL") \
284 EM(yfs_FS_StoreStatus, "YFS.StoreStatus") \
285 EM(yfs_FS_RemoveFile, "YFS.RemoveFile") \
286 EM(yfs_FS_CreateFile, "YFS.CreateFile") \
287 EM(yfs_FS_Rename, "YFS.Rename") \
288 EM(yfs_FS_Symlink, "YFS.Symlink") \
289 EM(yfs_FS_Link, "YFS.Link") \
290 EM(yfs_FS_MakeDir, "YFS.MakeDir") \
291 EM(yfs_FS_RemoveDir, "YFS.RemoveDir") \
292 EM(yfs_FS_GetVolumeStatus, "YFS.GetVolumeStatus") \
293 EM(yfs_FS_SetVolumeStatus, "YFS.SetVolumeStatus") \
294 EM(yfs_FS_SetLock, "YFS.SetLock") \
295 EM(yfs_FS_ExtendLock, "YFS.ExtendLock") \
296 EM(yfs_FS_ReleaseLock, "YFS.ReleaseLock") \
297 EM(yfs_FS_Lookup, "YFS.Lookup") \
298 EM(yfs_FS_FlushCPS, "YFS.FlushCPS") \
299 EM(yfs_FS_FetchOpaqueACL, "YFS.FetchOpaqueACL") \
300 EM(yfs_FS_WhoAmI, "YFS.WhoAmI") \
301 EM(yfs_FS_RemoveACL, "YFS.RemoveACL") \
302 EM(yfs_FS_RemoveFile2, "YFS.RemoveFile2") \
303 EM(yfs_FS_StoreOpaqueACL2, "YFS.StoreOpaqueACL2") \
304 EM(yfs_FS_InlineBulkStatus, "YFS.InlineBulkStatus") \
305 EM(yfs_FS_FetchData64, "YFS.FetchData64") \
306 EM(yfs_FS_StoreData64, "YFS.StoreData64") \
307 E_(yfs_FS_UpdateSymlink, "YFS.UpdateSymlink")
309 #define afs_vl_operations \
310 EM(afs_VL_GetEntryByNameU, "VL.GetEntryByNameU") \
311 EM(afs_VL_GetAddrsU, "VL.GetAddrsU") \
312 EM(afs_YFSVL_GetEndpoints, "YFSVL.GetEndpoints") \
313 E_(afs_VL_GetCapabilities, "VL.GetCapabilities")
315 #define afs_edit_dir_ops \
316 EM(afs_edit_dir_create, "create") \
317 EM(afs_edit_dir_create_error, "c_fail") \
318 EM(afs_edit_dir_create_inval, "c_invl") \
319 EM(afs_edit_dir_create_nospc, "c_nspc") \
320 EM(afs_edit_dir_delete, "delete") \
321 EM(afs_edit_dir_delete_error, "d_err ") \
322 EM(afs_edit_dir_delete_inval, "d_invl") \
323 E_(afs_edit_dir_delete_noent, "d_nent")
325 #define afs_edit_dir_reasons \
326 EM(afs_edit_dir_for_create, "Create") \
327 EM(afs_edit_dir_for_link, "Link ") \
328 EM(afs_edit_dir_for_mkdir, "MkDir ") \
329 EM(afs_edit_dir_for_rename_0, "Renam0") \
330 EM(afs_edit_dir_for_rename_1, "Renam1") \
331 EM(afs_edit_dir_for_rename_2, "Renam2") \
332 EM(afs_edit_dir_for_rmdir, "RmDir ") \
333 EM(afs_edit_dir_for_silly_0, "S_Ren0") \
334 EM(afs_edit_dir_for_silly_1, "S_Ren1") \
335 EM(afs_edit_dir_for_symlink, "Symlnk") \
336 E_(afs_edit_dir_for_unlink, "Unlink")
338 #define afs_eproto_causes \
339 EM(afs_eproto_bad_status, "BadStatus") \
340 EM(afs_eproto_cb_count, "CbCount") \
341 EM(afs_eproto_cb_fid_count, "CbFidCount") \
342 EM(afs_eproto_file_type, "FileTYpe") \
343 EM(afs_eproto_ibulkst_cb_count, "IBS.CbCount") \
344 EM(afs_eproto_ibulkst_count, "IBS.FidCount") \
345 EM(afs_eproto_motd_len, "MotdLen") \
346 EM(afs_eproto_offline_msg_len, "OfflineMsgLen") \
347 EM(afs_eproto_volname_len, "VolNameLen") \
348 EM(afs_eproto_yvl_fsendpt4_len, "YVL.FsEnd4Len") \
349 EM(afs_eproto_yvl_fsendpt6_len, "YVL.FsEnd6Len") \
350 EM(afs_eproto_yvl_fsendpt_num, "YVL.FsEndCount") \
351 EM(afs_eproto_yvl_fsendpt_type, "YVL.FsEndType") \
352 EM(afs_eproto_yvl_vlendpt4_len, "YVL.VlEnd4Len") \
353 EM(afs_eproto_yvl_vlendpt6_len, "YVL.VlEnd6Len") \
354 E_(afs_eproto_yvl_vlendpt_type, "YVL.VlEndType")
356 #define afs_io_errors \
357 EM(afs_io_error_cm_reply, "CM_REPLY") \
358 EM(afs_io_error_extract, "EXTRACT") \
359 EM(afs_io_error_fs_probe_fail, "FS_PROBE_FAIL") \
360 EM(afs_io_error_vl_lookup_fail, "VL_LOOKUP_FAIL") \
361 E_(afs_io_error_vl_probe_fail, "VL_PROBE_FAIL")
363 #define afs_file_errors \
364 EM(afs_file_error_dir_bad_magic, "DIR_BAD_MAGIC") \
365 EM(afs_file_error_dir_big, "DIR_BIG") \
366 EM(afs_file_error_dir_missing_page, "DIR_MISSING_PAGE") \
367 EM(afs_file_error_dir_over_end, "DIR_ENT_OVER_END") \
368 EM(afs_file_error_dir_small, "DIR_SMALL") \
369 EM(afs_file_error_dir_unmarked_ext, "DIR_UNMARKED_EXT") \
370 EM(afs_file_error_mntpt, "MNTPT_READ_FAILED") \
371 E_(afs_file_error_writeback_fail, "WRITEBACK_FAILED")
373 #define afs_flock_types \
374 EM(F_RDLCK, "RDLCK") \
375 EM(F_WRLCK, "WRLCK") \
378 #define afs_flock_states \
379 EM(AFS_VNODE_LOCK_NONE, "NONE") \
380 EM(AFS_VNODE_LOCK_WAITING_FOR_CB, "WAIT_FOR_CB") \
381 EM(AFS_VNODE_LOCK_SETTING, "SETTING") \
382 EM(AFS_VNODE_LOCK_GRANTED, "GRANTED") \
383 EM(AFS_VNODE_LOCK_EXTENDING, "EXTENDING") \
384 EM(AFS_VNODE_LOCK_NEED_UNLOCK, "NEED_UNLOCK") \
385 EM(AFS_VNODE_LOCK_UNLOCKING, "UNLOCKING") \
386 E_(AFS_VNODE_LOCK_DELETED, "DELETED")
388 #define afs_flock_events \
389 EM(afs_flock_acquired, "Acquired") \
390 EM(afs_flock_callback_break, "Callback") \
391 EM(afs_flock_defer_unlock, "D-Unlock") \
392 EM(afs_flock_extend_fail, "Ext_Fail") \
393 EM(afs_flock_fail_other, "ErrOther") \
394 EM(afs_flock_fail_perm, "ErrPerm ") \
395 EM(afs_flock_no_lockers, "NoLocker") \
396 EM(afs_flock_release_fail, "Rel_Fail") \
397 EM(afs_flock_silly_delete, "SillyDel") \
398 EM(afs_flock_timestamp, "Timestmp") \
399 EM(afs_flock_try_to_lock, "TryToLck") \
400 EM(afs_flock_vfs_lock, "VFSLock ") \
401 EM(afs_flock_vfs_locking, "VFSLking") \
402 EM(afs_flock_waited, "Waited ") \
403 EM(afs_flock_waiting, "Waiting ") \
404 EM(afs_flock_work_extending, "Extendng") \
405 EM(afs_flock_work_retry, "Retry ") \
406 EM(afs_flock_work_unlocking, "Unlcking") \
407 E_(afs_flock_would_block, "EWOULDBL")
409 #define afs_flock_operations \
410 EM(afs_flock_op_copy_lock, "COPY ") \
411 EM(afs_flock_op_flock, "->flock ") \
412 EM(afs_flock_op_grant, "GRANT ") \
413 EM(afs_flock_op_lock, "->lock ") \
414 EM(afs_flock_op_release_lock, "RELEASE ") \
415 EM(afs_flock_op_return_ok, "<-OK ") \
416 EM(afs_flock_op_return_edeadlk, "<-EDEADL") \
417 EM(afs_flock_op_return_eagain, "<-EAGAIN") \
418 EM(afs_flock_op_return_error, "<-ERROR ") \
419 EM(afs_flock_op_set_lock, "SET ") \
420 EM(afs_flock_op_unlock, "UNLOCK ") \
421 E_(afs_flock_op_wake, "WAKE ")
423 #define afs_cb_break_reasons \
424 EM(afs_cb_break_no_break, "no-break") \
425 EM(afs_cb_break_for_callback, "break-cb") \
426 EM(afs_cb_break_for_deleted, "break-del") \
427 EM(afs_cb_break_for_lapsed, "break-lapsed") \
428 EM(afs_cb_break_for_unlink, "break-unlink") \
429 EM(afs_cb_break_for_vsbreak, "break-vs") \
430 EM(afs_cb_break_for_volume_callback, "break-v-cb") \
431 E_(afs_cb_break_for_zap, "break-zap")
434 * Export enum symbols via userspace.
438 #define EM(a, b) TRACE_DEFINE_ENUM(a);
439 #define E_(a, b) TRACE_DEFINE_ENUM(a);
446 afs_edit_dir_reasons
;
451 afs_flock_operations
;
452 afs_cb_break_reasons
;
455 * Now redefine the EM() and E_() macros to map the enums to the strings that
456 * will be printed in the output.
460 #define EM(a, b) { a, b },
461 #define E_(a, b) { a, b }
463 TRACE_EVENT(afs_receive_data
,
464 TP_PROTO(struct afs_call
*call
, struct iov_iter
*iter
,
465 bool want_more
, int ret
),
467 TP_ARGS(call
, iter
, want_more
, ret
),
470 __field(loff_t
, remain
)
471 __field(unsigned int, call
)
472 __field(enum afs_call_state
, state
)
473 __field(unsigned short, unmarshall
)
474 __field(bool, want_more
)
479 __entry
->call
= call
->debug_id
;
480 __entry
->state
= call
->state
;
481 __entry
->unmarshall
= call
->unmarshall
;
482 __entry
->remain
= iov_iter_count(iter
);
483 __entry
->want_more
= want_more
;
487 TP_printk("c=%08x r=%llu u=%u w=%u s=%u ret=%d",
496 TRACE_EVENT(afs_notify_call
,
497 TP_PROTO(struct rxrpc_call
*rxcall
, struct afs_call
*call
),
499 TP_ARGS(rxcall
, call
),
502 __field(unsigned int, call
)
503 __field(enum afs_call_state
, state
)
504 __field(unsigned short, unmarshall
)
508 __entry
->call
= call
->debug_id
;
509 __entry
->state
= call
->state
;
510 __entry
->unmarshall
= call
->unmarshall
;
513 TP_printk("c=%08x s=%u u=%u",
515 __entry
->state
, __entry
->unmarshall
)
518 TRACE_EVENT(afs_cb_call
,
519 TP_PROTO(struct afs_call
*call
),
524 __field(unsigned int, call
)
525 __field(const char *, name
)
530 __entry
->call
= call
->debug_id
;
531 __entry
->name
= call
->type
->name
;
532 __entry
->op
= call
->operation_ID
;
535 TP_printk("c=%08x %s o=%u",
541 TRACE_EVENT(afs_call
,
542 TP_PROTO(struct afs_call
*call
, enum afs_call_trace op
,
543 int usage
, int outstanding
, const void *where
),
545 TP_ARGS(call
, op
, usage
, outstanding
, where
),
548 __field(unsigned int, call
)
551 __field(int, outstanding
)
552 __field(const void *, where
)
556 __entry
->call
= call
->debug_id
;
558 __entry
->usage
= usage
;
559 __entry
->outstanding
= outstanding
;
560 __entry
->where
= where
;
563 TP_printk("c=%08x %s u=%d o=%d sp=%pSR",
565 __print_symbolic(__entry
->op
, afs_call_traces
),
567 __entry
->outstanding
,
571 TRACE_EVENT(afs_make_fs_call
,
572 TP_PROTO(struct afs_call
*call
, const struct afs_fid
*fid
),
577 __field(unsigned int, call
)
578 __field(enum afs_fs_operation
, op
)
579 __field_struct(struct afs_fid
, fid
)
583 __entry
->call
= call
->debug_id
;
584 __entry
->op
= call
->operation_ID
;
588 __entry
->fid
.vid
= 0;
589 __entry
->fid
.vnode
= 0;
590 __entry
->fid
.unique
= 0;
594 TP_printk("c=%08x %06llx:%06llx:%06x %s",
599 __print_symbolic(__entry
->op
, afs_fs_operations
))
602 TRACE_EVENT(afs_make_fs_calli
,
603 TP_PROTO(struct afs_call
*call
, const struct afs_fid
*fid
,
606 TP_ARGS(call
, fid
, i
),
609 __field(unsigned int, call
)
610 __field(unsigned int, i
)
611 __field(enum afs_fs_operation
, op
)
612 __field_struct(struct afs_fid
, fid
)
616 __entry
->call
= call
->debug_id
;
618 __entry
->op
= call
->operation_ID
;
622 __entry
->fid
.vid
= 0;
623 __entry
->fid
.vnode
= 0;
624 __entry
->fid
.unique
= 0;
628 TP_printk("c=%08x %06llx:%06llx:%06x %s i=%u",
633 __print_symbolic(__entry
->op
, afs_fs_operations
),
637 TRACE_EVENT(afs_make_fs_call1
,
638 TP_PROTO(struct afs_call
*call
, const struct afs_fid
*fid
,
641 TP_ARGS(call
, fid
, name
),
644 __field(unsigned int, call
)
645 __field(enum afs_fs_operation
, op
)
646 __field_struct(struct afs_fid
, fid
)
647 __array(char, name
, 24 )
651 int __len
= strlen(name
);
652 __len
= min(__len
, 23);
653 __entry
->call
= call
->debug_id
;
654 __entry
->op
= call
->operation_ID
;
658 __entry
->fid
.vid
= 0;
659 __entry
->fid
.vnode
= 0;
660 __entry
->fid
.unique
= 0;
662 memcpy(__entry
->name
, name
, __len
);
663 __entry
->name
[__len
] = 0;
666 TP_printk("c=%08x %06llx:%06llx:%06x %s \"%s\"",
671 __print_symbolic(__entry
->op
, afs_fs_operations
),
675 TRACE_EVENT(afs_make_fs_call2
,
676 TP_PROTO(struct afs_call
*call
, const struct afs_fid
*fid
,
677 const char *name
, const char *name2
),
679 TP_ARGS(call
, fid
, name
, name2
),
682 __field(unsigned int, call
)
683 __field(enum afs_fs_operation
, op
)
684 __field_struct(struct afs_fid
, fid
)
685 __array(char, name
, 24 )
686 __array(char, name2
, 24 )
690 int __len
= strlen(name
);
691 int __len2
= strlen(name2
);
692 __len
= min(__len
, 23);
693 __len2
= min(__len2
, 23);
694 __entry
->call
= call
->debug_id
;
695 __entry
->op
= call
->operation_ID
;
699 __entry
->fid
.vid
= 0;
700 __entry
->fid
.vnode
= 0;
701 __entry
->fid
.unique
= 0;
703 memcpy(__entry
->name
, name
, __len
);
704 __entry
->name
[__len
] = 0;
705 memcpy(__entry
->name2
, name2
, __len2
);
706 __entry
->name2
[__len2
] = 0;
709 TP_printk("c=%08x %06llx:%06llx:%06x %s \"%s\" \"%s\"",
714 __print_symbolic(__entry
->op
, afs_fs_operations
),
719 TRACE_EVENT(afs_make_vl_call
,
720 TP_PROTO(struct afs_call
*call
),
725 __field(unsigned int, call
)
726 __field(enum afs_vl_operation
, op
)
730 __entry
->call
= call
->debug_id
;
731 __entry
->op
= call
->operation_ID
;
734 TP_printk("c=%08x %s",
736 __print_symbolic(__entry
->op
, afs_vl_operations
))
739 TRACE_EVENT(afs_call_done
,
740 TP_PROTO(struct afs_call
*call
),
745 __field(unsigned int, call
)
746 __field(struct rxrpc_call
*, rx_call
)
748 __field(u32
, abort_code
)
752 __entry
->call
= call
->debug_id
;
753 __entry
->rx_call
= call
->rxcall
;
754 __entry
->ret
= call
->error
;
755 __entry
->abort_code
= call
->abort_code
;
758 TP_printk(" c=%08x ret=%d ab=%d [%p]",
765 TRACE_EVENT(afs_send_pages
,
766 TP_PROTO(struct afs_call
*call
, struct msghdr
*msg
,
767 pgoff_t first
, pgoff_t last
, unsigned int offset
),
769 TP_ARGS(call
, msg
, first
, last
, offset
),
772 __field(unsigned int, call
)
773 __field(pgoff_t
, first
)
774 __field(pgoff_t
, last
)
775 __field(unsigned int, nr
)
776 __field(unsigned int, bytes
)
777 __field(unsigned int, offset
)
778 __field(unsigned int, flags
)
782 __entry
->call
= call
->debug_id
;
783 __entry
->first
= first
;
784 __entry
->last
= last
;
785 __entry
->nr
= msg
->msg_iter
.nr_segs
;
786 __entry
->bytes
= msg
->msg_iter
.count
;
787 __entry
->offset
= offset
;
788 __entry
->flags
= msg
->msg_flags
;
791 TP_printk(" c=%08x %lx-%lx-%lx b=%x o=%x f=%x",
793 __entry
->first
, __entry
->first
+ __entry
->nr
- 1, __entry
->last
,
794 __entry
->bytes
, __entry
->offset
,
798 TRACE_EVENT(afs_sent_pages
,
799 TP_PROTO(struct afs_call
*call
, pgoff_t first
, pgoff_t last
,
800 pgoff_t cursor
, int ret
),
802 TP_ARGS(call
, first
, last
, cursor
, ret
),
805 __field(unsigned int, call
)
806 __field(pgoff_t
, first
)
807 __field(pgoff_t
, last
)
808 __field(pgoff_t
, cursor
)
813 __entry
->call
= call
->debug_id
;
814 __entry
->first
= first
;
815 __entry
->last
= last
;
816 __entry
->cursor
= cursor
;
820 TP_printk(" c=%08x %lx-%lx c=%lx r=%d",
822 __entry
->first
, __entry
->last
,
823 __entry
->cursor
, __entry
->ret
)
826 TRACE_EVENT(afs_dir_check_failed
,
827 TP_PROTO(struct afs_vnode
*vnode
, loff_t off
, loff_t i_size
),
829 TP_ARGS(vnode
, off
, i_size
),
832 __field(struct afs_vnode
*, vnode
)
833 __field(loff_t
, off
)
834 __field(loff_t
, i_size
)
838 __entry
->vnode
= vnode
;
840 __entry
->i_size
= i_size
;
843 TP_printk("vn=%p %llx/%llx",
844 __entry
->vnode
, __entry
->off
, __entry
->i_size
)
848 * We use page->private to hold the amount of the page that we've written to,
849 * splitting the field into two parts. However, we need to represent a range
850 * 0...PAGE_SIZE inclusive, so we can't support 64K pages on a 32-bit system.
852 #if PAGE_SIZE > 32768
853 #define AFS_PRIV_MAX 0xffffffff
854 #define AFS_PRIV_SHIFT 32
856 #define AFS_PRIV_MAX 0xffff
857 #define AFS_PRIV_SHIFT 16
860 TRACE_EVENT(afs_page_dirty
,
861 TP_PROTO(struct afs_vnode
*vnode
, const char *where
,
862 pgoff_t page
, unsigned long priv
),
864 TP_ARGS(vnode
, where
, page
, priv
),
867 __field(struct afs_vnode
*, vnode
)
868 __field(const char *, where
)
869 __field(pgoff_t
, page
)
870 __field(unsigned long, priv
)
874 __entry
->vnode
= vnode
;
875 __entry
->where
= where
;
876 __entry
->page
= page
;
877 __entry
->priv
= priv
;
880 TP_printk("vn=%p %lx %s %lu-%lu",
881 __entry
->vnode
, __entry
->page
, __entry
->where
,
882 __entry
->priv
& AFS_PRIV_MAX
,
883 __entry
->priv
>> AFS_PRIV_SHIFT
)
886 TRACE_EVENT(afs_call_state
,
887 TP_PROTO(struct afs_call
*call
,
888 enum afs_call_state from
,
889 enum afs_call_state to
,
890 int ret
, u32 remote_abort
),
892 TP_ARGS(call
, from
, to
, ret
, remote_abort
),
895 __field(unsigned int, call
)
896 __field(enum afs_call_state
, from
)
897 __field(enum afs_call_state
, to
)
903 __entry
->call
= call
->debug_id
;
904 __entry
->from
= from
;
907 __entry
->abort
= remote_abort
;
910 TP_printk("c=%08x %u->%u r=%d ab=%d",
912 __entry
->from
, __entry
->to
,
913 __entry
->ret
, __entry
->abort
)
916 TRACE_EVENT(afs_lookup
,
917 TP_PROTO(struct afs_vnode
*dvnode
, const struct qstr
*name
,
918 struct afs_fid
*fid
),
920 TP_ARGS(dvnode
, name
, fid
),
923 __field_struct(struct afs_fid
, dfid
)
924 __field_struct(struct afs_fid
, fid
)
925 __array(char, name
, 24 )
929 int __len
= min_t(int, name
->len
, 23);
930 __entry
->dfid
= dvnode
->fid
;
932 memcpy(__entry
->name
, name
->name
, __len
);
933 __entry
->name
[__len
] = 0;
936 TP_printk("d=%llx:%llx:%x \"%s\" f=%llx:%x",
937 __entry
->dfid
.vid
, __entry
->dfid
.vnode
, __entry
->dfid
.unique
,
939 __entry
->fid
.vnode
, __entry
->fid
.unique
)
942 TRACE_EVENT(afs_edit_dir
,
943 TP_PROTO(struct afs_vnode
*dvnode
,
944 enum afs_edit_dir_reason why
,
945 enum afs_edit_dir_op op
,
948 unsigned int f_vnode
,
949 unsigned int f_unique
,
952 TP_ARGS(dvnode
, why
, op
, block
, slot
, f_vnode
, f_unique
, name
),
955 __field(unsigned int, vnode
)
956 __field(unsigned int, unique
)
957 __field(enum afs_edit_dir_reason
, why
)
958 __field(enum afs_edit_dir_op
, op
)
959 __field(unsigned int, block
)
960 __field(unsigned short, slot
)
961 __field(unsigned int, f_vnode
)
962 __field(unsigned int, f_unique
)
963 __array(char, name
, 24 )
967 int __len
= strlen(name
);
968 __len
= min(__len
, 23);
969 __entry
->vnode
= dvnode
->fid
.vnode
;
970 __entry
->unique
= dvnode
->fid
.unique
;
973 __entry
->block
= block
;
974 __entry
->slot
= slot
;
975 __entry
->f_vnode
= f_vnode
;
976 __entry
->f_unique
= f_unique
;
977 memcpy(__entry
->name
, name
, __len
);
978 __entry
->name
[__len
] = 0;
981 TP_printk("d=%x:%x %s %s %u[%u] f=%x:%x \"%s\"",
982 __entry
->vnode
, __entry
->unique
,
983 __print_symbolic(__entry
->why
, afs_edit_dir_reasons
),
984 __print_symbolic(__entry
->op
, afs_edit_dir_ops
),
985 __entry
->block
, __entry
->slot
,
986 __entry
->f_vnode
, __entry
->f_unique
,
990 TRACE_EVENT(afs_protocol_error
,
991 TP_PROTO(struct afs_call
*call
, int error
, enum afs_eproto_cause cause
),
993 TP_ARGS(call
, error
, cause
),
996 __field(unsigned int, call
)
998 __field(enum afs_eproto_cause
, cause
)
1002 __entry
->call
= call
? call
->debug_id
: 0;
1003 __entry
->error
= error
;
1004 __entry
->cause
= cause
;
1007 TP_printk("c=%08x r=%d %s",
1008 __entry
->call
, __entry
->error
,
1009 __print_symbolic(__entry
->cause
, afs_eproto_causes
))
1012 TRACE_EVENT(afs_io_error
,
1013 TP_PROTO(unsigned int call
, int error
, enum afs_io_error where
),
1015 TP_ARGS(call
, error
, where
),
1018 __field(unsigned int, call
)
1019 __field(int, error
)
1020 __field(enum afs_io_error
, where
)
1024 __entry
->call
= call
;
1025 __entry
->error
= error
;
1026 __entry
->where
= where
;
1029 TP_printk("c=%08x r=%d %s",
1030 __entry
->call
, __entry
->error
,
1031 __print_symbolic(__entry
->where
, afs_io_errors
))
1034 TRACE_EVENT(afs_file_error
,
1035 TP_PROTO(struct afs_vnode
*vnode
, int error
, enum afs_file_error where
),
1037 TP_ARGS(vnode
, error
, where
),
1040 __field_struct(struct afs_fid
, fid
)
1041 __field(int, error
)
1042 __field(enum afs_file_error
, where
)
1046 __entry
->fid
= vnode
->fid
;
1047 __entry
->error
= error
;
1048 __entry
->where
= where
;
1051 TP_printk("%llx:%llx:%x r=%d %s",
1052 __entry
->fid
.vid
, __entry
->fid
.vnode
, __entry
->fid
.unique
,
1054 __print_symbolic(__entry
->where
, afs_file_errors
))
1057 TRACE_EVENT(afs_cm_no_server
,
1058 TP_PROTO(struct afs_call
*call
, struct sockaddr_rxrpc
*srx
),
1063 __field(unsigned int, call
)
1064 __field(unsigned int, op_id
)
1065 __field_struct(struct sockaddr_rxrpc
, srx
)
1069 __entry
->call
= call
->debug_id
;
1070 __entry
->op_id
= call
->operation_ID
;
1071 memcpy(&__entry
->srx
, srx
, sizeof(__entry
->srx
));
1074 TP_printk("c=%08x op=%u %pISpc",
1075 __entry
->call
, __entry
->op_id
, &__entry
->srx
.transport
)
1078 TRACE_EVENT(afs_cm_no_server_u
,
1079 TP_PROTO(struct afs_call
*call
, const uuid_t
*uuid
),
1081 TP_ARGS(call
, uuid
),
1084 __field(unsigned int, call
)
1085 __field(unsigned int, op_id
)
1086 __field_struct(uuid_t
, uuid
)
1090 __entry
->call
= call
->debug_id
;
1091 __entry
->op_id
= call
->operation_ID
;
1092 memcpy(&__entry
->uuid
, uuid
, sizeof(__entry
->uuid
));
1095 TP_printk("c=%08x op=%u %pU",
1096 __entry
->call
, __entry
->op_id
, &__entry
->uuid
)
1099 TRACE_EVENT(afs_flock_ev
,
1100 TP_PROTO(struct afs_vnode
*vnode
, struct file_lock
*fl
,
1101 enum afs_flock_event event
, int error
),
1103 TP_ARGS(vnode
, fl
, event
, error
),
1106 __field_struct(struct afs_fid
, fid
)
1107 __field(enum afs_flock_event
, event
)
1108 __field(enum afs_lock_state
, state
)
1109 __field(int, error
)
1110 __field(unsigned int, debug_id
)
1114 __entry
->fid
= vnode
->fid
;
1115 __entry
->event
= event
;
1116 __entry
->state
= vnode
->lock_state
;
1117 __entry
->error
= error
;
1118 __entry
->debug_id
= fl
? fl
->fl_u
.afs
.debug_id
: 0;
1121 TP_printk("%llx:%llx:%x %04x %s s=%s e=%d",
1122 __entry
->fid
.vid
, __entry
->fid
.vnode
, __entry
->fid
.unique
,
1124 __print_symbolic(__entry
->event
, afs_flock_events
),
1125 __print_symbolic(__entry
->state
, afs_flock_states
),
1129 TRACE_EVENT(afs_flock_op
,
1130 TP_PROTO(struct afs_vnode
*vnode
, struct file_lock
*fl
,
1131 enum afs_flock_operation op
),
1133 TP_ARGS(vnode
, fl
, op
),
1136 __field_struct(struct afs_fid
, fid
)
1137 __field(loff_t
, from
)
1138 __field(loff_t
, len
)
1139 __field(enum afs_flock_operation
, op
)
1140 __field(unsigned char, type
)
1141 __field(unsigned int, flags
)
1142 __field(unsigned int, debug_id
)
1146 __entry
->fid
= vnode
->fid
;
1147 __entry
->from
= fl
->fl_start
;
1148 __entry
->len
= fl
->fl_end
- fl
->fl_start
+ 1;
1150 __entry
->type
= fl
->fl_type
;
1151 __entry
->flags
= fl
->fl_flags
;
1152 __entry
->debug_id
= fl
->fl_u
.afs
.debug_id
;
1155 TP_printk("%llx:%llx:%x %04x %s t=%s R=%llx/%llx f=%x",
1156 __entry
->fid
.vid
, __entry
->fid
.vnode
, __entry
->fid
.unique
,
1158 __print_symbolic(__entry
->op
, afs_flock_operations
),
1159 __print_symbolic(__entry
->type
, afs_flock_types
),
1160 __entry
->from
, __entry
->len
, __entry
->flags
)
1163 TRACE_EVENT(afs_reload_dir
,
1164 TP_PROTO(struct afs_vnode
*vnode
),
1169 __field_struct(struct afs_fid
, fid
)
1173 __entry
->fid
= vnode
->fid
;
1176 TP_printk("%llx:%llx:%x",
1177 __entry
->fid
.vid
, __entry
->fid
.vnode
, __entry
->fid
.unique
)
1180 TRACE_EVENT(afs_silly_rename
,
1181 TP_PROTO(struct afs_vnode
*vnode
, bool done
),
1183 TP_ARGS(vnode
, done
),
1186 __field_struct(struct afs_fid
, fid
)
1187 __field(bool, done
)
1191 __entry
->fid
= vnode
->fid
;
1192 __entry
->done
= done
;
1195 TP_printk("%llx:%llx:%x done=%u",
1196 __entry
->fid
.vid
, __entry
->fid
.vnode
, __entry
->fid
.unique
,
1200 TRACE_EVENT(afs_get_tree
,
1201 TP_PROTO(struct afs_cell
*cell
, struct afs_volume
*volume
),
1203 TP_ARGS(cell
, volume
),
1207 __array(char, cell
, 24 )
1208 __array(char, volume
, 24 )
1213 __entry
->vid
= volume
->vid
;
1214 __len
= min_t(int, cell
->name_len
, 23);
1215 memcpy(__entry
->cell
, cell
->name
, __len
);
1216 __entry
->cell
[__len
] = 0;
1217 __len
= min_t(int, volume
->name_len
, 23);
1218 memcpy(__entry
->volume
, volume
->name
, __len
);
1219 __entry
->volume
[__len
] = 0;
1222 TP_printk("--- MOUNT %s:%s %llx",
1223 __entry
->cell
, __entry
->volume
, __entry
->vid
)
1226 TRACE_EVENT(afs_cb_break
,
1227 TP_PROTO(struct afs_fid
*fid
, unsigned int cb_break
,
1228 enum afs_cb_break_reason reason
, bool skipped
),
1230 TP_ARGS(fid
, cb_break
, reason
, skipped
),
1233 __field_struct(struct afs_fid
, fid
)
1234 __field(unsigned int, cb_break
)
1235 __field(enum afs_cb_break_reason
, reason
)
1236 __field(bool, skipped
)
1240 __entry
->fid
= *fid
;
1241 __entry
->cb_break
= cb_break
;
1242 __entry
->reason
= reason
;
1243 __entry
->skipped
= skipped
;
1246 TP_printk("%llx:%llx:%x b=%x s=%u %s",
1247 __entry
->fid
.vid
, __entry
->fid
.vnode
, __entry
->fid
.unique
,
1250 __print_symbolic(__entry
->reason
, afs_cb_break_reasons
))
1253 TRACE_EVENT(afs_cb_miss
,
1254 TP_PROTO(struct afs_fid
*fid
, enum afs_cb_break_reason reason
),
1256 TP_ARGS(fid
, reason
),
1259 __field_struct(struct afs_fid
, fid
)
1260 __field(enum afs_cb_break_reason
, reason
)
1264 __entry
->fid
= *fid
;
1265 __entry
->reason
= reason
;
1268 TP_printk(" %llx:%llx:%x %s",
1269 __entry
->fid
.vid
, __entry
->fid
.vnode
, __entry
->fid
.unique
,
1270 __print_symbolic(__entry
->reason
, afs_cb_break_reasons
))
1273 TRACE_EVENT(afs_server
,
1274 TP_PROTO(struct afs_server
*server
, int usage
, enum afs_server_trace reason
),
1276 TP_ARGS(server
, usage
, reason
),
1279 __field(unsigned int, server
)
1280 __field(int, usage
)
1281 __field(int, reason
)
1285 __entry
->server
= server
->debug_id
;
1286 __entry
->usage
= usage
;
1287 __entry
->reason
= reason
;
1290 TP_printk("s=%08x %s u=%d",
1292 __print_symbolic(__entry
->reason
, afs_server_traces
),
1296 #endif /* _TRACE_AFS_H */
1298 /* This part must be outside protection */
1299 #include <trace/define_trace.h>