xref: /openbmc/linux/include/trace/events/afs.h (revision c3e9f888263bb4df11cbd623ceced02081cb2f9f)
1b4d0d230SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
28e8d7f13SDavid Howells /* AFS tracepoints
38e8d7f13SDavid Howells  *
48e8d7f13SDavid Howells  * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved.
58e8d7f13SDavid Howells  * Written by David Howells (dhowells@redhat.com)
68e8d7f13SDavid Howells  */
78e8d7f13SDavid Howells #undef TRACE_SYSTEM
88e8d7f13SDavid Howells #define TRACE_SYSTEM afs
98e8d7f13SDavid Howells 
108e8d7f13SDavid Howells #if !defined(_TRACE_AFS_H) || defined(TRACE_HEADER_MULTI_READ)
118e8d7f13SDavid Howells #define _TRACE_AFS_H
128e8d7f13SDavid Howells 
138e8d7f13SDavid Howells #include <linux/tracepoint.h>
148e8d7f13SDavid Howells 
15341f741fSDavid Howells /*
16341f741fSDavid Howells  * Define enums for tracing information.
17341f741fSDavid Howells  */
18341f741fSDavid Howells #ifndef __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY
19341f741fSDavid Howells #define __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY
20341f741fSDavid Howells 
21341f741fSDavid Howells enum afs_call_trace {
22341f741fSDavid Howells 	afs_call_trace_alloc,
23341f741fSDavid Howells 	afs_call_trace_free,
2434fa4761SDavid Howells 	afs_call_trace_get,
25341f741fSDavid Howells 	afs_call_trace_put,
26341f741fSDavid Howells 	afs_call_trace_wake,
27341f741fSDavid Howells 	afs_call_trace_work,
28341f741fSDavid Howells };
29341f741fSDavid Howells 
3045218193SDavid Howells enum afs_server_trace {
3145218193SDavid Howells 	afs_server_trace_alloc,
3245218193SDavid Howells 	afs_server_trace_callback,
3345218193SDavid Howells 	afs_server_trace_destroy,
3445218193SDavid Howells 	afs_server_trace_free,
3545218193SDavid Howells 	afs_server_trace_gc,
36977e5f8eSDavid Howells 	afs_server_trace_get_by_addr,
3745218193SDavid Howells 	afs_server_trace_get_by_uuid,
3845218193SDavid Howells 	afs_server_trace_get_caps,
3945218193SDavid Howells 	afs_server_trace_get_install,
4045218193SDavid Howells 	afs_server_trace_get_new_cbi,
41f6cbb368SDavid Howells 	afs_server_trace_get_probe,
4245218193SDavid Howells 	afs_server_trace_give_up_cb,
4345218193SDavid Howells 	afs_server_trace_put_call,
4445218193SDavid Howells 	afs_server_trace_put_cbi,
4545218193SDavid Howells 	afs_server_trace_put_find_rsq,
46f6cbb368SDavid Howells 	afs_server_trace_put_probe,
4745218193SDavid Howells 	afs_server_trace_put_slist,
4845218193SDavid Howells 	afs_server_trace_put_slist_isort,
4945218193SDavid Howells 	afs_server_trace_put_uuid_rsq,
5045218193SDavid Howells 	afs_server_trace_update,
5145218193SDavid Howells };
5245218193SDavid Howells 
53025db80cSDavid Howells enum afs_fs_operation {
54025db80cSDavid Howells 	afs_FS_FetchData		= 130,	/* AFS Fetch file data */
55260f082bSDavid Howells 	afs_FS_FetchACL			= 131,	/* AFS Fetch file ACL */
56025db80cSDavid Howells 	afs_FS_FetchStatus		= 132,	/* AFS Fetch file status */
57025db80cSDavid Howells 	afs_FS_StoreData		= 133,	/* AFS Store file data */
58b10494afSJoe Gorse 	afs_FS_StoreACL			= 134,	/* AFS Store file ACL */
59025db80cSDavid Howells 	afs_FS_StoreStatus		= 135,	/* AFS Store file status */
60025db80cSDavid Howells 	afs_FS_RemoveFile		= 136,	/* AFS Remove a file */
61025db80cSDavid Howells 	afs_FS_CreateFile		= 137,	/* AFS Create a file */
62025db80cSDavid Howells 	afs_FS_Rename			= 138,	/* AFS Rename or move a file or directory */
63025db80cSDavid Howells 	afs_FS_Symlink			= 139,	/* AFS Create a symbolic link */
64025db80cSDavid Howells 	afs_FS_Link			= 140,	/* AFS Create a hard link */
65025db80cSDavid Howells 	afs_FS_MakeDir			= 141,	/* AFS Create a directory */
66025db80cSDavid Howells 	afs_FS_RemoveDir		= 142,	/* AFS Remove a directory */
67025db80cSDavid Howells 	afs_FS_GetVolumeInfo		= 148,	/* AFS Get information about a volume */
68025db80cSDavid Howells 	afs_FS_GetVolumeStatus		= 149,	/* AFS Get volume status information */
69025db80cSDavid Howells 	afs_FS_GetRootVolume		= 151,	/* AFS Get root volume name */
70025db80cSDavid Howells 	afs_FS_SetLock			= 156,	/* AFS Request a file lock */
71025db80cSDavid Howells 	afs_FS_ExtendLock		= 157,	/* AFS Extend a file lock */
72025db80cSDavid Howells 	afs_FS_ReleaseLock		= 158,	/* AFS Release a file lock */
73025db80cSDavid Howells 	afs_FS_Lookup			= 161,	/* AFS lookup file in directory */
745cf9dd55SDavid Howells 	afs_FS_InlineBulkStatus		= 65536, /* AFS Fetch multiple file statuses with errors */
75025db80cSDavid Howells 	afs_FS_FetchData64		= 65537, /* AFS Fetch file data */
76025db80cSDavid Howells 	afs_FS_StoreData64		= 65538, /* AFS Store file data */
77025db80cSDavid Howells 	afs_FS_GiveUpAllCallBacks	= 65539, /* AFS Give up all our callbacks on a server */
78025db80cSDavid Howells 	afs_FS_GetCapabilities		= 65540, /* AFS Get FS server capabilities */
7930062bd1SDavid Howells 
8030062bd1SDavid Howells 	yfs_FS_FetchData		= 130,	 /* YFS Fetch file data */
8130062bd1SDavid Howells 	yfs_FS_FetchACL			= 64131, /* YFS Fetch file ACL */
8230062bd1SDavid Howells 	yfs_FS_FetchStatus		= 64132, /* YFS Fetch file status */
8330062bd1SDavid Howells 	yfs_FS_StoreACL			= 64134, /* YFS Store file ACL */
8430062bd1SDavid Howells 	yfs_FS_StoreStatus		= 64135, /* YFS Store file status */
8530062bd1SDavid Howells 	yfs_FS_RemoveFile		= 64136, /* YFS Remove a file */
8630062bd1SDavid Howells 	yfs_FS_CreateFile		= 64137, /* YFS Create a file */
8730062bd1SDavid Howells 	yfs_FS_Rename			= 64138, /* YFS Rename or move a file or directory */
8830062bd1SDavid Howells 	yfs_FS_Symlink			= 64139, /* YFS Create a symbolic link */
8930062bd1SDavid Howells 	yfs_FS_Link			= 64140, /* YFS Create a hard link */
9030062bd1SDavid Howells 	yfs_FS_MakeDir			= 64141, /* YFS Create a directory */
9130062bd1SDavid Howells 	yfs_FS_RemoveDir		= 64142, /* YFS Remove a directory */
9230062bd1SDavid Howells 	yfs_FS_GetVolumeStatus		= 64149, /* YFS Get volume status information */
9330062bd1SDavid Howells 	yfs_FS_SetVolumeStatus		= 64150, /* YFS Set volume status information */
9430062bd1SDavid Howells 	yfs_FS_SetLock			= 64156, /* YFS Request a file lock */
9530062bd1SDavid Howells 	yfs_FS_ExtendLock		= 64157, /* YFS Extend a file lock */
9630062bd1SDavid Howells 	yfs_FS_ReleaseLock		= 64158, /* YFS Release a file lock */
9730062bd1SDavid Howells 	yfs_FS_Lookup			= 64161, /* YFS lookup file in directory */
9830062bd1SDavid Howells 	yfs_FS_FlushCPS			= 64165,
9930062bd1SDavid Howells 	yfs_FS_FetchOpaqueACL		= 64168,
10030062bd1SDavid Howells 	yfs_FS_WhoAmI			= 64170,
10130062bd1SDavid Howells 	yfs_FS_RemoveACL		= 64171,
10230062bd1SDavid Howells 	yfs_FS_RemoveFile2		= 64173,
10330062bd1SDavid Howells 	yfs_FS_StoreOpaqueACL2		= 64174,
10430062bd1SDavid Howells 	yfs_FS_InlineBulkStatus		= 64536, /* YFS Fetch multiple file statuses with errors */
10530062bd1SDavid Howells 	yfs_FS_FetchData64		= 64537, /* YFS Fetch file data */
10630062bd1SDavid Howells 	yfs_FS_StoreData64		= 64538, /* YFS Store file data */
10730062bd1SDavid Howells 	yfs_FS_UpdateSymlink		= 64540,
108025db80cSDavid Howells };
109025db80cSDavid Howells 
110025db80cSDavid Howells enum afs_vl_operation {
111025db80cSDavid Howells 	afs_VL_GetEntryByNameU	= 527,		/* AFS Get Vol Entry By Name operation ID */
112025db80cSDavid Howells 	afs_VL_GetAddrsU	= 533,		/* AFS Get FS server addresses */
113025db80cSDavid Howells 	afs_YFSVL_GetEndpoints	= 64002,	/* YFS Get FS & Vol server addresses */
114*c3e9f888SDavid Howells 	afs_YFSVL_GetCellName	= 64014,	/* YFS Get actual cell name */
115025db80cSDavid Howells 	afs_VL_GetCapabilities	= 65537,	/* AFS Get VL server capabilities */
116025db80cSDavid Howells };
117025db80cSDavid Howells 
11863a4681fSDavid Howells enum afs_edit_dir_op {
11963a4681fSDavid Howells 	afs_edit_dir_create,
12063a4681fSDavid Howells 	afs_edit_dir_create_error,
12163a4681fSDavid Howells 	afs_edit_dir_create_inval,
12263a4681fSDavid Howells 	afs_edit_dir_create_nospc,
12363a4681fSDavid Howells 	afs_edit_dir_delete,
12463a4681fSDavid Howells 	afs_edit_dir_delete_error,
12563a4681fSDavid Howells 	afs_edit_dir_delete_inval,
12663a4681fSDavid Howells 	afs_edit_dir_delete_noent,
12763a4681fSDavid Howells };
12863a4681fSDavid Howells 
12963a4681fSDavid Howells enum afs_edit_dir_reason {
13063a4681fSDavid Howells 	afs_edit_dir_for_create,
13163a4681fSDavid Howells 	afs_edit_dir_for_link,
13263a4681fSDavid Howells 	afs_edit_dir_for_mkdir,
13379ddbfa5SDavid Howells 	afs_edit_dir_for_rename_0,
13479ddbfa5SDavid Howells 	afs_edit_dir_for_rename_1,
13579ddbfa5SDavid Howells 	afs_edit_dir_for_rename_2,
13663a4681fSDavid Howells 	afs_edit_dir_for_rmdir,
13779ddbfa5SDavid Howells 	afs_edit_dir_for_silly_0,
13879ddbfa5SDavid Howells 	afs_edit_dir_for_silly_1,
13963a4681fSDavid Howells 	afs_edit_dir_for_symlink,
14063a4681fSDavid Howells 	afs_edit_dir_for_unlink,
14163a4681fSDavid Howells };
14263a4681fSDavid Howells 
143160cb957SDavid Howells enum afs_eproto_cause {
144160cb957SDavid Howells 	afs_eproto_bad_status,
145160cb957SDavid Howells 	afs_eproto_cb_count,
146160cb957SDavid Howells 	afs_eproto_cb_fid_count,
147*c3e9f888SDavid Howells 	afs_eproto_cellname_len,
148160cb957SDavid Howells 	afs_eproto_file_type,
149160cb957SDavid Howells 	afs_eproto_ibulkst_cb_count,
150160cb957SDavid Howells 	afs_eproto_ibulkst_count,
151160cb957SDavid Howells 	afs_eproto_motd_len,
152160cb957SDavid Howells 	afs_eproto_offline_msg_len,
153160cb957SDavid Howells 	afs_eproto_volname_len,
154160cb957SDavid Howells 	afs_eproto_yvl_fsendpt4_len,
155160cb957SDavid Howells 	afs_eproto_yvl_fsendpt6_len,
156160cb957SDavid Howells 	afs_eproto_yvl_fsendpt_num,
157160cb957SDavid Howells 	afs_eproto_yvl_fsendpt_type,
158160cb957SDavid Howells 	afs_eproto_yvl_vlendpt4_len,
159160cb957SDavid Howells 	afs_eproto_yvl_vlendpt6_len,
160160cb957SDavid Howells 	afs_eproto_yvl_vlendpt_type,
161160cb957SDavid Howells };
162160cb957SDavid Howells 
163f51375cdSDavid Howells enum afs_io_error {
164f51375cdSDavid Howells 	afs_io_error_cm_reply,
165f51375cdSDavid Howells 	afs_io_error_extract,
166f51375cdSDavid Howells 	afs_io_error_fs_probe_fail,
167f51375cdSDavid Howells 	afs_io_error_vl_lookup_fail,
1683bf0fb6fSDavid Howells 	afs_io_error_vl_probe_fail,
169f51375cdSDavid Howells };
170f51375cdSDavid Howells 
171f51375cdSDavid Howells enum afs_file_error {
172f51375cdSDavid Howells 	afs_file_error_dir_bad_magic,
173f51375cdSDavid Howells 	afs_file_error_dir_big,
174f51375cdSDavid Howells 	afs_file_error_dir_missing_page,
175f51375cdSDavid Howells 	afs_file_error_dir_over_end,
176f51375cdSDavid Howells 	afs_file_error_dir_small,
177f51375cdSDavid Howells 	afs_file_error_dir_unmarked_ext,
178f51375cdSDavid Howells 	afs_file_error_mntpt,
179f51375cdSDavid Howells 	afs_file_error_writeback_fail,
180f51375cdSDavid Howells };
181f51375cdSDavid Howells 
182d4696601SDavid Howells enum afs_flock_event {
183d4696601SDavid Howells 	afs_flock_acquired,
184d4696601SDavid Howells 	afs_flock_callback_break,
185d4696601SDavid Howells 	afs_flock_defer_unlock,
186cdfb26b4SDavid Howells 	afs_flock_extend_fail,
187d4696601SDavid Howells 	afs_flock_fail_other,
188d4696601SDavid Howells 	afs_flock_fail_perm,
189d4696601SDavid Howells 	afs_flock_no_lockers,
190cdfb26b4SDavid Howells 	afs_flock_release_fail,
19179ddbfa5SDavid Howells 	afs_flock_silly_delete,
192d4696601SDavid Howells 	afs_flock_timestamp,
193d4696601SDavid Howells 	afs_flock_try_to_lock,
194d4696601SDavid Howells 	afs_flock_vfs_lock,
195d4696601SDavid Howells 	afs_flock_vfs_locking,
196d4696601SDavid Howells 	afs_flock_waited,
197d4696601SDavid Howells 	afs_flock_waiting,
198d4696601SDavid Howells 	afs_flock_work_extending,
199d4696601SDavid Howells 	afs_flock_work_retry,
200d4696601SDavid Howells 	afs_flock_work_unlocking,
201d4696601SDavid Howells 	afs_flock_would_block,
202d4696601SDavid Howells };
203d4696601SDavid Howells 
204d4696601SDavid Howells enum afs_flock_operation {
205d4696601SDavid Howells 	afs_flock_op_copy_lock,
206d4696601SDavid Howells 	afs_flock_op_flock,
207d4696601SDavid Howells 	afs_flock_op_grant,
208d4696601SDavid Howells 	afs_flock_op_lock,
209d4696601SDavid Howells 	afs_flock_op_release_lock,
210d4696601SDavid Howells 	afs_flock_op_return_ok,
211d4696601SDavid Howells 	afs_flock_op_return_eagain,
212d4696601SDavid Howells 	afs_flock_op_return_edeadlk,
213d4696601SDavid Howells 	afs_flock_op_return_error,
214d4696601SDavid Howells 	afs_flock_op_set_lock,
215d4696601SDavid Howells 	afs_flock_op_unlock,
216d4696601SDavid Howells 	afs_flock_op_wake,
217d4696601SDavid Howells };
218d4696601SDavid Howells 
219051d2525SDavid Howells enum afs_cb_break_reason {
220051d2525SDavid Howells 	afs_cb_break_no_break,
221051d2525SDavid Howells 	afs_cb_break_for_callback,
222051d2525SDavid Howells 	afs_cb_break_for_deleted,
223051d2525SDavid Howells 	afs_cb_break_for_lapsed,
224051d2525SDavid Howells 	afs_cb_break_for_unlink,
225051d2525SDavid Howells 	afs_cb_break_for_vsbreak,
226051d2525SDavid Howells 	afs_cb_break_for_volume_callback,
227051d2525SDavid Howells 	afs_cb_break_for_zap,
228051d2525SDavid Howells };
229051d2525SDavid Howells 
230341f741fSDavid Howells #endif /* end __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY */
231341f741fSDavid Howells 
232341f741fSDavid Howells /*
233341f741fSDavid Howells  * Declare tracing information enums and their string mappings for display.
234341f741fSDavid Howells  */
235341f741fSDavid Howells #define afs_call_traces \
236341f741fSDavid Howells 	EM(afs_call_trace_alloc,		"ALLOC") \
237341f741fSDavid Howells 	EM(afs_call_trace_free,			"FREE ") \
23834fa4761SDavid Howells 	EM(afs_call_trace_get,			"GET  ") \
239341f741fSDavid Howells 	EM(afs_call_trace_put,			"PUT  ") \
240341f741fSDavid Howells 	EM(afs_call_trace_wake,			"WAKE ") \
2414636cf18SDavid Howells 	E_(afs_call_trace_work,			"QUEUE")
242341f741fSDavid Howells 
24345218193SDavid Howells #define afs_server_traces \
24445218193SDavid Howells 	EM(afs_server_trace_alloc,		"ALLOC    ") \
24545218193SDavid Howells 	EM(afs_server_trace_callback,		"CALLBACK ") \
24645218193SDavid Howells 	EM(afs_server_trace_destroy,		"DESTROY  ") \
24745218193SDavid Howells 	EM(afs_server_trace_free,		"FREE     ") \
24845218193SDavid Howells 	EM(afs_server_trace_gc,			"GC       ") \
249977e5f8eSDavid Howells 	EM(afs_server_trace_get_by_addr,	"GET addr ") \
25045218193SDavid Howells 	EM(afs_server_trace_get_by_uuid,	"GET uuid ") \
25145218193SDavid Howells 	EM(afs_server_trace_get_caps,		"GET caps ") \
25245218193SDavid Howells 	EM(afs_server_trace_get_install,	"GET inst ") \
25345218193SDavid Howells 	EM(afs_server_trace_get_new_cbi,	"GET cbi  ") \
254f6cbb368SDavid Howells 	EM(afs_server_trace_get_probe,		"GET probe") \
25545218193SDavid Howells 	EM(afs_server_trace_give_up_cb,		"giveup-cb") \
25645218193SDavid Howells 	EM(afs_server_trace_put_call,		"PUT call ") \
25745218193SDavid Howells 	EM(afs_server_trace_put_cbi,		"PUT cbi  ") \
25845218193SDavid Howells 	EM(afs_server_trace_put_find_rsq,	"PUT f-rsq") \
259f6cbb368SDavid Howells 	EM(afs_server_trace_put_probe,		"PUT probe") \
26045218193SDavid Howells 	EM(afs_server_trace_put_slist,		"PUT slist") \
26145218193SDavid Howells 	EM(afs_server_trace_put_slist_isort,	"PUT isort") \
26245218193SDavid Howells 	EM(afs_server_trace_put_uuid_rsq,	"PUT u-req") \
26345218193SDavid Howells 	E_(afs_server_trace_update,		"UPDATE")
26445218193SDavid Howells 
265025db80cSDavid Howells #define afs_fs_operations \
266025db80cSDavid Howells 	EM(afs_FS_FetchData,			"FS.FetchData") \
267025db80cSDavid Howells 	EM(afs_FS_FetchStatus,			"FS.FetchStatus") \
268025db80cSDavid Howells 	EM(afs_FS_StoreData,			"FS.StoreData") \
269025db80cSDavid Howells 	EM(afs_FS_StoreStatus,			"FS.StoreStatus") \
270025db80cSDavid Howells 	EM(afs_FS_RemoveFile,			"FS.RemoveFile") \
271025db80cSDavid Howells 	EM(afs_FS_CreateFile,			"FS.CreateFile") \
272025db80cSDavid Howells 	EM(afs_FS_Rename,			"FS.Rename") \
273025db80cSDavid Howells 	EM(afs_FS_Symlink,			"FS.Symlink") \
274025db80cSDavid Howells 	EM(afs_FS_Link,				"FS.Link") \
275025db80cSDavid Howells 	EM(afs_FS_MakeDir,			"FS.MakeDir") \
276025db80cSDavid Howells 	EM(afs_FS_RemoveDir,			"FS.RemoveDir") \
277025db80cSDavid Howells 	EM(afs_FS_GetVolumeInfo,		"FS.GetVolumeInfo") \
278025db80cSDavid Howells 	EM(afs_FS_GetVolumeStatus,		"FS.GetVolumeStatus") \
279025db80cSDavid Howells 	EM(afs_FS_GetRootVolume,		"FS.GetRootVolume") \
280025db80cSDavid Howells 	EM(afs_FS_SetLock,			"FS.SetLock") \
281025db80cSDavid Howells 	EM(afs_FS_ExtendLock,			"FS.ExtendLock") \
282025db80cSDavid Howells 	EM(afs_FS_ReleaseLock,			"FS.ReleaseLock") \
283025db80cSDavid Howells 	EM(afs_FS_Lookup,			"FS.Lookup") \
2845cf9dd55SDavid Howells 	EM(afs_FS_InlineBulkStatus,		"FS.InlineBulkStatus") \
285025db80cSDavid Howells 	EM(afs_FS_FetchData64,			"FS.FetchData64") \
286025db80cSDavid Howells 	EM(afs_FS_StoreData64,			"FS.StoreData64") \
287025db80cSDavid Howells 	EM(afs_FS_GiveUpAllCallBacks,		"FS.GiveUpAllCallBacks") \
28830062bd1SDavid Howells 	EM(afs_FS_GetCapabilities,		"FS.GetCapabilities") \
28930062bd1SDavid Howells 	EM(yfs_FS_FetchACL,			"YFS.FetchACL") \
29030062bd1SDavid Howells 	EM(yfs_FS_FetchStatus,			"YFS.FetchStatus") \
29130062bd1SDavid Howells 	EM(yfs_FS_StoreACL,			"YFS.StoreACL") \
29230062bd1SDavid Howells 	EM(yfs_FS_StoreStatus,			"YFS.StoreStatus") \
29330062bd1SDavid Howells 	EM(yfs_FS_RemoveFile,			"YFS.RemoveFile") \
29430062bd1SDavid Howells 	EM(yfs_FS_CreateFile,			"YFS.CreateFile") \
29530062bd1SDavid Howells 	EM(yfs_FS_Rename,			"YFS.Rename") \
29630062bd1SDavid Howells 	EM(yfs_FS_Symlink,			"YFS.Symlink") \
29730062bd1SDavid Howells 	EM(yfs_FS_Link,				"YFS.Link") \
29830062bd1SDavid Howells 	EM(yfs_FS_MakeDir,			"YFS.MakeDir") \
29930062bd1SDavid Howells 	EM(yfs_FS_RemoveDir,			"YFS.RemoveDir") \
30030062bd1SDavid Howells 	EM(yfs_FS_GetVolumeStatus,		"YFS.GetVolumeStatus") \
30130062bd1SDavid Howells 	EM(yfs_FS_SetVolumeStatus,		"YFS.SetVolumeStatus") \
30230062bd1SDavid Howells 	EM(yfs_FS_SetLock,			"YFS.SetLock") \
30330062bd1SDavid Howells 	EM(yfs_FS_ExtendLock,			"YFS.ExtendLock") \
30430062bd1SDavid Howells 	EM(yfs_FS_ReleaseLock,			"YFS.ReleaseLock") \
30530062bd1SDavid Howells 	EM(yfs_FS_Lookup,			"YFS.Lookup") \
30630062bd1SDavid Howells 	EM(yfs_FS_FlushCPS,			"YFS.FlushCPS") \
30730062bd1SDavid Howells 	EM(yfs_FS_FetchOpaqueACL,		"YFS.FetchOpaqueACL") \
30830062bd1SDavid Howells 	EM(yfs_FS_WhoAmI,			"YFS.WhoAmI") \
30930062bd1SDavid Howells 	EM(yfs_FS_RemoveACL,			"YFS.RemoveACL") \
31030062bd1SDavid Howells 	EM(yfs_FS_RemoveFile2,			"YFS.RemoveFile2") \
31130062bd1SDavid Howells 	EM(yfs_FS_StoreOpaqueACL2,		"YFS.StoreOpaqueACL2") \
31230062bd1SDavid Howells 	EM(yfs_FS_InlineBulkStatus,		"YFS.InlineBulkStatus") \
31330062bd1SDavid Howells 	EM(yfs_FS_FetchData64,			"YFS.FetchData64") \
31430062bd1SDavid Howells 	EM(yfs_FS_StoreData64,			"YFS.StoreData64") \
31530062bd1SDavid Howells 	E_(yfs_FS_UpdateSymlink,		"YFS.UpdateSymlink")
316025db80cSDavid Howells 
317025db80cSDavid Howells #define afs_vl_operations \
318025db80cSDavid Howells 	EM(afs_VL_GetEntryByNameU,		"VL.GetEntryByNameU") \
319025db80cSDavid Howells 	EM(afs_VL_GetAddrsU,			"VL.GetAddrsU") \
320025db80cSDavid Howells 	EM(afs_YFSVL_GetEndpoints,		"YFSVL.GetEndpoints") \
321*c3e9f888SDavid Howells 	EM(afs_YFSVL_GetCellName,		"YFSVL.GetCellName") \
322025db80cSDavid Howells 	E_(afs_VL_GetCapabilities,		"VL.GetCapabilities")
323025db80cSDavid Howells 
32463a4681fSDavid Howells #define afs_edit_dir_ops				  \
32563a4681fSDavid Howells 	EM(afs_edit_dir_create,			"create") \
32663a4681fSDavid Howells 	EM(afs_edit_dir_create_error,		"c_fail") \
32763a4681fSDavid Howells 	EM(afs_edit_dir_create_inval,		"c_invl") \
32863a4681fSDavid Howells 	EM(afs_edit_dir_create_nospc,		"c_nspc") \
32963a4681fSDavid Howells 	EM(afs_edit_dir_delete,			"delete") \
33063a4681fSDavid Howells 	EM(afs_edit_dir_delete_error,		"d_err ") \
33163a4681fSDavid Howells 	EM(afs_edit_dir_delete_inval,		"d_invl") \
33263a4681fSDavid Howells 	E_(afs_edit_dir_delete_noent,		"d_nent")
33363a4681fSDavid Howells 
33463a4681fSDavid Howells #define afs_edit_dir_reasons				  \
33563a4681fSDavid Howells 	EM(afs_edit_dir_for_create,		"Create") \
33663a4681fSDavid Howells 	EM(afs_edit_dir_for_link,		"Link  ") \
33763a4681fSDavid Howells 	EM(afs_edit_dir_for_mkdir,		"MkDir ") \
33879ddbfa5SDavid Howells 	EM(afs_edit_dir_for_rename_0,		"Renam0") \
33979ddbfa5SDavid Howells 	EM(afs_edit_dir_for_rename_1,		"Renam1") \
34079ddbfa5SDavid Howells 	EM(afs_edit_dir_for_rename_2,		"Renam2") \
34163a4681fSDavid Howells 	EM(afs_edit_dir_for_rmdir,		"RmDir ") \
34279ddbfa5SDavid Howells 	EM(afs_edit_dir_for_silly_0,		"S_Ren0") \
34379ddbfa5SDavid Howells 	EM(afs_edit_dir_for_silly_1,		"S_Ren1") \
34463a4681fSDavid Howells 	EM(afs_edit_dir_for_symlink,		"Symlnk") \
34563a4681fSDavid Howells 	E_(afs_edit_dir_for_unlink,		"Unlink")
34663a4681fSDavid Howells 
347160cb957SDavid Howells #define afs_eproto_causes			\
348160cb957SDavid Howells 	EM(afs_eproto_bad_status,	"BadStatus") \
349160cb957SDavid Howells 	EM(afs_eproto_cb_count,		"CbCount") \
350160cb957SDavid Howells 	EM(afs_eproto_cb_fid_count,	"CbFidCount") \
351*c3e9f888SDavid Howells 	EM(afs_eproto_cellname_len,	"CellNameLen") \
352160cb957SDavid Howells 	EM(afs_eproto_file_type,	"FileTYpe") \
353160cb957SDavid Howells 	EM(afs_eproto_ibulkst_cb_count,	"IBS.CbCount") \
354160cb957SDavid Howells 	EM(afs_eproto_ibulkst_count,	"IBS.FidCount") \
355160cb957SDavid Howells 	EM(afs_eproto_motd_len,		"MotdLen") \
356160cb957SDavid Howells 	EM(afs_eproto_offline_msg_len,	"OfflineMsgLen") \
357160cb957SDavid Howells 	EM(afs_eproto_volname_len,	"VolNameLen") \
358160cb957SDavid Howells 	EM(afs_eproto_yvl_fsendpt4_len,	"YVL.FsEnd4Len") \
359160cb957SDavid Howells 	EM(afs_eproto_yvl_fsendpt6_len,	"YVL.FsEnd6Len") \
360160cb957SDavid Howells 	EM(afs_eproto_yvl_fsendpt_num,	"YVL.FsEndCount") \
361160cb957SDavid Howells 	EM(afs_eproto_yvl_fsendpt_type,	"YVL.FsEndType") \
362160cb957SDavid Howells 	EM(afs_eproto_yvl_vlendpt4_len,	"YVL.VlEnd4Len") \
363160cb957SDavid Howells 	EM(afs_eproto_yvl_vlendpt6_len,	"YVL.VlEnd6Len") \
364160cb957SDavid Howells 	E_(afs_eproto_yvl_vlendpt_type,	"YVL.VlEndType")
365160cb957SDavid Howells 
366f51375cdSDavid Howells #define afs_io_errors							\
367f51375cdSDavid Howells 	EM(afs_io_error_cm_reply,		"CM_REPLY")		\
368f51375cdSDavid Howells 	EM(afs_io_error_extract,		"EXTRACT")		\
369f51375cdSDavid Howells 	EM(afs_io_error_fs_probe_fail,		"FS_PROBE_FAIL")	\
3703bf0fb6fSDavid Howells 	EM(afs_io_error_vl_lookup_fail,		"VL_LOOKUP_FAIL")	\
3713bf0fb6fSDavid Howells 	E_(afs_io_error_vl_probe_fail,		"VL_PROBE_FAIL")
372f51375cdSDavid Howells 
373f51375cdSDavid Howells #define afs_file_errors							\
374f51375cdSDavid Howells 	EM(afs_file_error_dir_bad_magic,	"DIR_BAD_MAGIC")	\
375f51375cdSDavid Howells 	EM(afs_file_error_dir_big,		"DIR_BIG")		\
376f51375cdSDavid Howells 	EM(afs_file_error_dir_missing_page,	"DIR_MISSING_PAGE")	\
377f51375cdSDavid Howells 	EM(afs_file_error_dir_over_end,		"DIR_ENT_OVER_END")	\
378f51375cdSDavid Howells 	EM(afs_file_error_dir_small,		"DIR_SMALL")		\
379f51375cdSDavid Howells 	EM(afs_file_error_dir_unmarked_ext,	"DIR_UNMARKED_EXT")	\
380f51375cdSDavid Howells 	EM(afs_file_error_mntpt,		"MNTPT_READ_FAILED")	\
381f51375cdSDavid Howells 	E_(afs_file_error_writeback_fail,	"WRITEBACK_FAILED")
382025db80cSDavid Howells 
383d4696601SDavid Howells #define afs_flock_types							\
384d4696601SDavid Howells 	EM(F_RDLCK,				"RDLCK")		\
385d4696601SDavid Howells 	EM(F_WRLCK,				"WRLCK")		\
386d4696601SDavid Howells 	E_(F_UNLCK,				"UNLCK")
387d4696601SDavid Howells 
388d4696601SDavid Howells #define afs_flock_states						\
389d4696601SDavid Howells 	EM(AFS_VNODE_LOCK_NONE,			"NONE")			\
390d4696601SDavid Howells 	EM(AFS_VNODE_LOCK_WAITING_FOR_CB,	"WAIT_FOR_CB")		\
391d4696601SDavid Howells 	EM(AFS_VNODE_LOCK_SETTING,		"SETTING")		\
392d4696601SDavid Howells 	EM(AFS_VNODE_LOCK_GRANTED,		"GRANTED")		\
393d4696601SDavid Howells 	EM(AFS_VNODE_LOCK_EXTENDING,		"EXTENDING")		\
394d4696601SDavid Howells 	EM(AFS_VNODE_LOCK_NEED_UNLOCK,		"NEED_UNLOCK")		\
395cdfb26b4SDavid Howells 	EM(AFS_VNODE_LOCK_UNLOCKING,		"UNLOCKING")		\
396cdfb26b4SDavid Howells 	E_(AFS_VNODE_LOCK_DELETED,		"DELETED")
397d4696601SDavid Howells 
398d4696601SDavid Howells #define afs_flock_events						\
399d4696601SDavid Howells 	EM(afs_flock_acquired,			"Acquired")		\
400d4696601SDavid Howells 	EM(afs_flock_callback_break,		"Callback")		\
401d4696601SDavid Howells 	EM(afs_flock_defer_unlock,		"D-Unlock")		\
402cdfb26b4SDavid Howells 	EM(afs_flock_extend_fail,		"Ext_Fail")		\
403d4696601SDavid Howells 	EM(afs_flock_fail_other,		"ErrOther")		\
404d4696601SDavid Howells 	EM(afs_flock_fail_perm,			"ErrPerm ")		\
405d4696601SDavid Howells 	EM(afs_flock_no_lockers,		"NoLocker")		\
406cdfb26b4SDavid Howells 	EM(afs_flock_release_fail,		"Rel_Fail")		\
40779ddbfa5SDavid Howells 	EM(afs_flock_silly_delete,		"SillyDel")		\
408d4696601SDavid Howells 	EM(afs_flock_timestamp,			"Timestmp")		\
409d4696601SDavid Howells 	EM(afs_flock_try_to_lock,		"TryToLck")		\
410d4696601SDavid Howells 	EM(afs_flock_vfs_lock,			"VFSLock ")		\
411d4696601SDavid Howells 	EM(afs_flock_vfs_locking,		"VFSLking")		\
412d4696601SDavid Howells 	EM(afs_flock_waited,			"Waited  ")		\
413d4696601SDavid Howells 	EM(afs_flock_waiting,			"Waiting ")		\
414d4696601SDavid Howells 	EM(afs_flock_work_extending,		"Extendng")		\
415d4696601SDavid Howells 	EM(afs_flock_work_retry,		"Retry   ")		\
416d4696601SDavid Howells 	EM(afs_flock_work_unlocking,		"Unlcking")		\
417d4696601SDavid Howells 	E_(afs_flock_would_block,		"EWOULDBL")
418d4696601SDavid Howells 
419d4696601SDavid Howells #define afs_flock_operations						\
420d4696601SDavid Howells 	EM(afs_flock_op_copy_lock,		"COPY    ")		\
421d4696601SDavid Howells 	EM(afs_flock_op_flock,			"->flock ")		\
422d4696601SDavid Howells 	EM(afs_flock_op_grant,			"GRANT   ")		\
423d4696601SDavid Howells 	EM(afs_flock_op_lock,			"->lock  ")		\
424d4696601SDavid Howells 	EM(afs_flock_op_release_lock,		"RELEASE ")		\
425d4696601SDavid Howells 	EM(afs_flock_op_return_ok,		"<-OK    ")		\
426d4696601SDavid Howells 	EM(afs_flock_op_return_edeadlk,		"<-EDEADL")		\
427d4696601SDavid Howells 	EM(afs_flock_op_return_eagain,		"<-EAGAIN")		\
428d4696601SDavid Howells 	EM(afs_flock_op_return_error,		"<-ERROR ")		\
429d4696601SDavid Howells 	EM(afs_flock_op_set_lock,		"SET     ")		\
430d4696601SDavid Howells 	EM(afs_flock_op_unlock,			"UNLOCK  ")		\
431d4696601SDavid Howells 	E_(afs_flock_op_wake,			"WAKE    ")
432d4696601SDavid Howells 
433051d2525SDavid Howells #define afs_cb_break_reasons						\
434051d2525SDavid Howells 	EM(afs_cb_break_no_break,		"no-break")		\
435051d2525SDavid Howells 	EM(afs_cb_break_for_callback,		"break-cb")		\
436051d2525SDavid Howells 	EM(afs_cb_break_for_deleted,		"break-del")		\
437051d2525SDavid Howells 	EM(afs_cb_break_for_lapsed,		"break-lapsed")		\
438051d2525SDavid Howells 	EM(afs_cb_break_for_unlink,		"break-unlink")		\
439051d2525SDavid Howells 	EM(afs_cb_break_for_vsbreak,		"break-vs")		\
440051d2525SDavid Howells 	EM(afs_cb_break_for_volume_callback,	"break-v-cb")		\
441051d2525SDavid Howells 	E_(afs_cb_break_for_zap,		"break-zap")
442051d2525SDavid Howells 
443341f741fSDavid Howells /*
444341f741fSDavid Howells  * Export enum symbols via userspace.
445341f741fSDavid Howells  */
446341f741fSDavid Howells #undef EM
447341f741fSDavid Howells #undef E_
448341f741fSDavid Howells #define EM(a, b) TRACE_DEFINE_ENUM(a);
449341f741fSDavid Howells #define E_(a, b) TRACE_DEFINE_ENUM(a);
450341f741fSDavid Howells 
451341f741fSDavid Howells afs_call_traces;
45245218193SDavid Howells afs_server_traces;
453025db80cSDavid Howells afs_fs_operations;
454025db80cSDavid Howells afs_vl_operations;
45563a4681fSDavid Howells afs_edit_dir_ops;
45663a4681fSDavid Howells afs_edit_dir_reasons;
457f51375cdSDavid Howells afs_eproto_causes;
458f51375cdSDavid Howells afs_io_errors;
459f51375cdSDavid Howells afs_file_errors;
460d4696601SDavid Howells afs_flock_types;
461d4696601SDavid Howells afs_flock_operations;
462051d2525SDavid Howells afs_cb_break_reasons;
463341f741fSDavid Howells 
464341f741fSDavid Howells /*
465341f741fSDavid Howells  * Now redefine the EM() and E_() macros to map the enums to the strings that
466341f741fSDavid Howells  * will be printed in the output.
467341f741fSDavid Howells  */
468341f741fSDavid Howells #undef EM
469341f741fSDavid Howells #undef E_
470341f741fSDavid Howells #define EM(a, b)	{ a, b },
471341f741fSDavid Howells #define E_(a, b)	{ a, b }
472341f741fSDavid Howells 
47312bdcf33SDavid Howells TRACE_EVENT(afs_receive_data,
47412bdcf33SDavid Howells 	    TP_PROTO(struct afs_call *call, struct iov_iter *iter,
4758e8d7f13SDavid Howells 		     bool want_more, int ret),
4768e8d7f13SDavid Howells 
47712bdcf33SDavid Howells 	    TP_ARGS(call, iter, want_more, ret),
4788e8d7f13SDavid Howells 
4798e8d7f13SDavid Howells 	    TP_STRUCT__entry(
48012bdcf33SDavid Howells 		    __field(loff_t,			remain		)
481a25e21f0SDavid Howells 		    __field(unsigned int,		call		)
4828e8d7f13SDavid Howells 		    __field(enum afs_call_state,	state		)
4838e8d7f13SDavid Howells 		    __field(unsigned short,		unmarshall	)
4848e8d7f13SDavid Howells 		    __field(bool,			want_more	)
4858e8d7f13SDavid Howells 		    __field(int,			ret		)
4868e8d7f13SDavid Howells 			     ),
4878e8d7f13SDavid Howells 
4888e8d7f13SDavid Howells 	    TP_fast_assign(
489a25e21f0SDavid Howells 		    __entry->call	= call->debug_id;
4908e8d7f13SDavid Howells 		    __entry->state	= call->state;
4918e8d7f13SDavid Howells 		    __entry->unmarshall	= call->unmarshall;
49212bdcf33SDavid Howells 		    __entry->remain	= iov_iter_count(iter);
4938e8d7f13SDavid Howells 		    __entry->want_more	= want_more;
4948e8d7f13SDavid Howells 		    __entry->ret	= ret;
4958e8d7f13SDavid Howells 			   ),
4968e8d7f13SDavid Howells 
49712bdcf33SDavid Howells 	    TP_printk("c=%08x r=%llu u=%u w=%u s=%u ret=%d",
4988e8d7f13SDavid Howells 		      __entry->call,
49912bdcf33SDavid Howells 		      __entry->remain,
50012bdcf33SDavid Howells 		      __entry->unmarshall,
50112bdcf33SDavid Howells 		      __entry->want_more,
50212bdcf33SDavid Howells 		      __entry->state,
50312bdcf33SDavid Howells 		      __entry->ret)
5048e8d7f13SDavid Howells 	    );
5058e8d7f13SDavid Howells 
5068e8d7f13SDavid Howells TRACE_EVENT(afs_notify_call,
5078e8d7f13SDavid Howells 	    TP_PROTO(struct rxrpc_call *rxcall, struct afs_call *call),
5088e8d7f13SDavid Howells 
5098e8d7f13SDavid Howells 	    TP_ARGS(rxcall, call),
5108e8d7f13SDavid Howells 
5118e8d7f13SDavid Howells 	    TP_STRUCT__entry(
512a25e21f0SDavid Howells 		    __field(unsigned int,		call		)
5138e8d7f13SDavid Howells 		    __field(enum afs_call_state,	state		)
5148e8d7f13SDavid Howells 		    __field(unsigned short,		unmarshall	)
5158e8d7f13SDavid Howells 			     ),
5168e8d7f13SDavid Howells 
5178e8d7f13SDavid Howells 	    TP_fast_assign(
518a25e21f0SDavid Howells 		    __entry->call	= call->debug_id;
5198e8d7f13SDavid Howells 		    __entry->state	= call->state;
5208e8d7f13SDavid Howells 		    __entry->unmarshall	= call->unmarshall;
5218e8d7f13SDavid Howells 			   ),
5228e8d7f13SDavid Howells 
523a25e21f0SDavid Howells 	    TP_printk("c=%08x s=%u u=%u",
5248e8d7f13SDavid Howells 		      __entry->call,
5258e8d7f13SDavid Howells 		      __entry->state, __entry->unmarshall)
5268e8d7f13SDavid Howells 	    );
5278e8d7f13SDavid Howells 
5288e8d7f13SDavid Howells TRACE_EVENT(afs_cb_call,
5298e8d7f13SDavid Howells 	    TP_PROTO(struct afs_call *call),
5308e8d7f13SDavid Howells 
5318e8d7f13SDavid Howells 	    TP_ARGS(call),
5328e8d7f13SDavid Howells 
5338e8d7f13SDavid Howells 	    TP_STRUCT__entry(
534a25e21f0SDavid Howells 		    __field(unsigned int,		call		)
5358e8d7f13SDavid Howells 		    __field(const char *,		name		)
5368e8d7f13SDavid Howells 		    __field(u32,			op		)
5378e8d7f13SDavid Howells 			     ),
5388e8d7f13SDavid Howells 
5398e8d7f13SDavid Howells 	    TP_fast_assign(
540a25e21f0SDavid Howells 		    __entry->call	= call->debug_id;
5418e8d7f13SDavid Howells 		    __entry->name	= call->type->name;
5428e8d7f13SDavid Howells 		    __entry->op		= call->operation_ID;
5438e8d7f13SDavid Howells 			   ),
5448e8d7f13SDavid Howells 
545a25e21f0SDavid Howells 	    TP_printk("c=%08x %s o=%u",
5468e8d7f13SDavid Howells 		      __entry->call,
5478e8d7f13SDavid Howells 		      __entry->name,
5488e8d7f13SDavid Howells 		      __entry->op)
5498e8d7f13SDavid Howells 	    );
5508e8d7f13SDavid Howells 
551341f741fSDavid Howells TRACE_EVENT(afs_call,
552341f741fSDavid Howells 	    TP_PROTO(struct afs_call *call, enum afs_call_trace op,
553341f741fSDavid Howells 		     int usage, int outstanding, const void *where),
554341f741fSDavid Howells 
555341f741fSDavid Howells 	    TP_ARGS(call, op, usage, outstanding, where),
556341f741fSDavid Howells 
557341f741fSDavid Howells 	    TP_STRUCT__entry(
558a25e21f0SDavid Howells 		    __field(unsigned int,		call		)
559341f741fSDavid Howells 		    __field(int,			op		)
560341f741fSDavid Howells 		    __field(int,			usage		)
561341f741fSDavid Howells 		    __field(int,			outstanding	)
562341f741fSDavid Howells 		    __field(const void *,		where		)
563341f741fSDavid Howells 			     ),
564341f741fSDavid Howells 
565341f741fSDavid Howells 	    TP_fast_assign(
566a25e21f0SDavid Howells 		    __entry->call = call->debug_id;
567341f741fSDavid Howells 		    __entry->op = op;
568341f741fSDavid Howells 		    __entry->usage = usage;
569341f741fSDavid Howells 		    __entry->outstanding = outstanding;
570341f741fSDavid Howells 		    __entry->where = where;
571341f741fSDavid Howells 			   ),
572341f741fSDavid Howells 
573a25e21f0SDavid Howells 	    TP_printk("c=%08x %s u=%d o=%d sp=%pSR",
574341f741fSDavid Howells 		      __entry->call,
575341f741fSDavid Howells 		      __print_symbolic(__entry->op, afs_call_traces),
576341f741fSDavid Howells 		      __entry->usage,
577341f741fSDavid Howells 		      __entry->outstanding,
578341f741fSDavid Howells 		      __entry->where)
579341f741fSDavid Howells 	    );
580341f741fSDavid Howells 
581025db80cSDavid Howells TRACE_EVENT(afs_make_fs_call,
582025db80cSDavid Howells 	    TP_PROTO(struct afs_call *call, const struct afs_fid *fid),
583025db80cSDavid Howells 
584025db80cSDavid Howells 	    TP_ARGS(call, fid),
585025db80cSDavid Howells 
586025db80cSDavid Howells 	    TP_STRUCT__entry(
587a25e21f0SDavid Howells 		    __field(unsigned int,		call		)
588025db80cSDavid Howells 		    __field(enum afs_fs_operation,	op		)
589025db80cSDavid Howells 		    __field_struct(struct afs_fid,	fid		)
590025db80cSDavid Howells 			     ),
591025db80cSDavid Howells 
592025db80cSDavid Howells 	    TP_fast_assign(
593a25e21f0SDavid Howells 		    __entry->call = call->debug_id;
594025db80cSDavid Howells 		    __entry->op = call->operation_ID;
595025db80cSDavid Howells 		    if (fid) {
596025db80cSDavid Howells 			    __entry->fid = *fid;
597025db80cSDavid Howells 		    } else {
598025db80cSDavid Howells 			    __entry->fid.vid = 0;
599025db80cSDavid Howells 			    __entry->fid.vnode = 0;
600025db80cSDavid Howells 			    __entry->fid.unique = 0;
601025db80cSDavid Howells 		    }
602025db80cSDavid Howells 			   ),
603025db80cSDavid Howells 
6043b6492dfSDavid Howells 	    TP_printk("c=%08x %06llx:%06llx:%06x %s",
605025db80cSDavid Howells 		      __entry->call,
606025db80cSDavid Howells 		      __entry->fid.vid,
607025db80cSDavid Howells 		      __entry->fid.vnode,
608025db80cSDavid Howells 		      __entry->fid.unique,
609025db80cSDavid Howells 		      __print_symbolic(__entry->op, afs_fs_operations))
610025db80cSDavid Howells 	    );
611025db80cSDavid Howells 
6126c6c1d63SDavid Howells TRACE_EVENT(afs_make_fs_calli,
6136c6c1d63SDavid Howells 	    TP_PROTO(struct afs_call *call, const struct afs_fid *fid,
6146c6c1d63SDavid Howells 		     unsigned int i),
6156c6c1d63SDavid Howells 
6166c6c1d63SDavid Howells 	    TP_ARGS(call, fid, i),
6176c6c1d63SDavid Howells 
6186c6c1d63SDavid Howells 	    TP_STRUCT__entry(
6196c6c1d63SDavid Howells 		    __field(unsigned int,		call		)
6206c6c1d63SDavid Howells 		    __field(unsigned int,		i		)
6216c6c1d63SDavid Howells 		    __field(enum afs_fs_operation,	op		)
6226c6c1d63SDavid Howells 		    __field_struct(struct afs_fid,	fid		)
6236c6c1d63SDavid Howells 			     ),
6246c6c1d63SDavid Howells 
6256c6c1d63SDavid Howells 	    TP_fast_assign(
6266c6c1d63SDavid Howells 		    __entry->call = call->debug_id;
6276c6c1d63SDavid Howells 		    __entry->i = i;
6286c6c1d63SDavid Howells 		    __entry->op = call->operation_ID;
6296c6c1d63SDavid Howells 		    if (fid) {
6306c6c1d63SDavid Howells 			    __entry->fid = *fid;
6316c6c1d63SDavid Howells 		    } else {
6326c6c1d63SDavid Howells 			    __entry->fid.vid = 0;
6336c6c1d63SDavid Howells 			    __entry->fid.vnode = 0;
6346c6c1d63SDavid Howells 			    __entry->fid.unique = 0;
6356c6c1d63SDavid Howells 		    }
6366c6c1d63SDavid Howells 			   ),
6376c6c1d63SDavid Howells 
6386c6c1d63SDavid Howells 	    TP_printk("c=%08x %06llx:%06llx:%06x %s i=%u",
6396c6c1d63SDavid Howells 		      __entry->call,
6406c6c1d63SDavid Howells 		      __entry->fid.vid,
6416c6c1d63SDavid Howells 		      __entry->fid.vnode,
6426c6c1d63SDavid Howells 		      __entry->fid.unique,
6436c6c1d63SDavid Howells 		      __print_symbolic(__entry->op, afs_fs_operations),
6446c6c1d63SDavid Howells 		      __entry->i)
6456c6c1d63SDavid Howells 	    );
6466c6c1d63SDavid Howells 
64780548b03SDavid Howells TRACE_EVENT(afs_make_fs_call1,
64880548b03SDavid Howells 	    TP_PROTO(struct afs_call *call, const struct afs_fid *fid,
649e49c7b2fSDavid Howells 		     const struct qstr *name),
65080548b03SDavid Howells 
65180548b03SDavid Howells 	    TP_ARGS(call, fid, name),
65280548b03SDavid Howells 
65380548b03SDavid Howells 	    TP_STRUCT__entry(
65480548b03SDavid Howells 		    __field(unsigned int,		call		)
65580548b03SDavid Howells 		    __field(enum afs_fs_operation,	op		)
65680548b03SDavid Howells 		    __field_struct(struct afs_fid,	fid		)
65780548b03SDavid Howells 		    __array(char,			name, 24	)
65880548b03SDavid Howells 			     ),
65980548b03SDavid Howells 
66080548b03SDavid Howells 	    TP_fast_assign(
661e49c7b2fSDavid Howells 		    unsigned int __len = min_t(unsigned int, name->len, 23);
66280548b03SDavid Howells 		    __entry->call = call->debug_id;
66380548b03SDavid Howells 		    __entry->op = call->operation_ID;
66480548b03SDavid Howells 		    if (fid) {
66580548b03SDavid Howells 			    __entry->fid = *fid;
66680548b03SDavid Howells 		    } else {
66780548b03SDavid Howells 			    __entry->fid.vid = 0;
66880548b03SDavid Howells 			    __entry->fid.vnode = 0;
66980548b03SDavid Howells 			    __entry->fid.unique = 0;
67080548b03SDavid Howells 		    }
671e49c7b2fSDavid Howells 		    memcpy(__entry->name, name->name, __len);
67280548b03SDavid Howells 		    __entry->name[__len] = 0;
67380548b03SDavid Howells 			   ),
67480548b03SDavid Howells 
67580548b03SDavid Howells 	    TP_printk("c=%08x %06llx:%06llx:%06x %s \"%s\"",
67680548b03SDavid Howells 		      __entry->call,
67780548b03SDavid Howells 		      __entry->fid.vid,
67880548b03SDavid Howells 		      __entry->fid.vnode,
67980548b03SDavid Howells 		      __entry->fid.unique,
68080548b03SDavid Howells 		      __print_symbolic(__entry->op, afs_fs_operations),
68180548b03SDavid Howells 		      __entry->name)
68280548b03SDavid Howells 	    );
68380548b03SDavid Howells 
68480548b03SDavid Howells TRACE_EVENT(afs_make_fs_call2,
68580548b03SDavid Howells 	    TP_PROTO(struct afs_call *call, const struct afs_fid *fid,
686e49c7b2fSDavid Howells 		     const struct qstr *name, const struct qstr *name2),
68780548b03SDavid Howells 
68880548b03SDavid Howells 	    TP_ARGS(call, fid, name, name2),
68980548b03SDavid Howells 
69080548b03SDavid Howells 	    TP_STRUCT__entry(
69180548b03SDavid Howells 		    __field(unsigned int,		call		)
69280548b03SDavid Howells 		    __field(enum afs_fs_operation,	op		)
69380548b03SDavid Howells 		    __field_struct(struct afs_fid,	fid		)
69480548b03SDavid Howells 		    __array(char,			name, 24	)
69580548b03SDavid Howells 		    __array(char,			name2, 24	)
69680548b03SDavid Howells 			     ),
69780548b03SDavid Howells 
69880548b03SDavid Howells 	    TP_fast_assign(
699e49c7b2fSDavid Howells 		    unsigned int __len = min_t(unsigned int, name->len, 23);
700e49c7b2fSDavid Howells 		    unsigned int __len2 = min_t(unsigned int, name2->len, 23);
70180548b03SDavid Howells 		    __entry->call = call->debug_id;
70280548b03SDavid Howells 		    __entry->op = call->operation_ID;
70380548b03SDavid Howells 		    if (fid) {
70480548b03SDavid Howells 			    __entry->fid = *fid;
70580548b03SDavid Howells 		    } else {
70680548b03SDavid Howells 			    __entry->fid.vid = 0;
70780548b03SDavid Howells 			    __entry->fid.vnode = 0;
70880548b03SDavid Howells 			    __entry->fid.unique = 0;
70980548b03SDavid Howells 		    }
710e49c7b2fSDavid Howells 		    memcpy(__entry->name, name->name, __len);
71180548b03SDavid Howells 		    __entry->name[__len] = 0;
712e49c7b2fSDavid Howells 		    memcpy(__entry->name2, name2->name, __len2);
71380548b03SDavid Howells 		    __entry->name2[__len2] = 0;
71480548b03SDavid Howells 			   ),
71580548b03SDavid Howells 
71680548b03SDavid Howells 	    TP_printk("c=%08x %06llx:%06llx:%06x %s \"%s\" \"%s\"",
71780548b03SDavid Howells 		      __entry->call,
71880548b03SDavid Howells 		      __entry->fid.vid,
71980548b03SDavid Howells 		      __entry->fid.vnode,
72080548b03SDavid Howells 		      __entry->fid.unique,
72180548b03SDavid Howells 		      __print_symbolic(__entry->op, afs_fs_operations),
72280548b03SDavid Howells 		      __entry->name,
72380548b03SDavid Howells 		      __entry->name2)
72480548b03SDavid Howells 	    );
72580548b03SDavid Howells 
726025db80cSDavid Howells TRACE_EVENT(afs_make_vl_call,
727025db80cSDavid Howells 	    TP_PROTO(struct afs_call *call),
728025db80cSDavid Howells 
729025db80cSDavid Howells 	    TP_ARGS(call),
730025db80cSDavid Howells 
731025db80cSDavid Howells 	    TP_STRUCT__entry(
732a25e21f0SDavid Howells 		    __field(unsigned int,		call		)
733025db80cSDavid Howells 		    __field(enum afs_vl_operation,	op		)
734025db80cSDavid Howells 			     ),
735025db80cSDavid Howells 
736025db80cSDavid Howells 	    TP_fast_assign(
737a25e21f0SDavid Howells 		    __entry->call = call->debug_id;
738025db80cSDavid Howells 		    __entry->op = call->operation_ID;
739025db80cSDavid Howells 			   ),
740025db80cSDavid Howells 
741a25e21f0SDavid Howells 	    TP_printk("c=%08x %s",
742025db80cSDavid Howells 		      __entry->call,
743025db80cSDavid Howells 		      __print_symbolic(__entry->op, afs_vl_operations))
744025db80cSDavid Howells 	    );
745025db80cSDavid Howells 
746025db80cSDavid Howells TRACE_EVENT(afs_call_done,
747025db80cSDavid Howells 	    TP_PROTO(struct afs_call *call),
748025db80cSDavid Howells 
749025db80cSDavid Howells 	    TP_ARGS(call),
750025db80cSDavid Howells 
751025db80cSDavid Howells 	    TP_STRUCT__entry(
752a25e21f0SDavid Howells 		    __field(unsigned int,		call		)
753025db80cSDavid Howells 		    __field(struct rxrpc_call *,	rx_call		)
754025db80cSDavid Howells 		    __field(int,			ret		)
755025db80cSDavid Howells 		    __field(u32,			abort_code	)
756025db80cSDavid Howells 			     ),
757025db80cSDavid Howells 
758025db80cSDavid Howells 	    TP_fast_assign(
759a25e21f0SDavid Howells 		    __entry->call = call->debug_id;
760025db80cSDavid Howells 		    __entry->rx_call = call->rxcall;
761025db80cSDavid Howells 		    __entry->ret = call->error;
762025db80cSDavid Howells 		    __entry->abort_code = call->abort_code;
763025db80cSDavid Howells 			   ),
764025db80cSDavid Howells 
765a25e21f0SDavid Howells 	    TP_printk("   c=%08x ret=%d ab=%d [%p]",
766025db80cSDavid Howells 		      __entry->call,
767025db80cSDavid Howells 		      __entry->ret,
768025db80cSDavid Howells 		      __entry->abort_code,
769025db80cSDavid Howells 		      __entry->rx_call)
770025db80cSDavid Howells 	    );
771025db80cSDavid Howells 
7722c099014SDavid Howells TRACE_EVENT(afs_send_pages,
7732c099014SDavid Howells 	    TP_PROTO(struct afs_call *call, struct msghdr *msg,
7742c099014SDavid Howells 		     pgoff_t first, pgoff_t last, unsigned int offset),
7752c099014SDavid Howells 
7762c099014SDavid Howells 	    TP_ARGS(call, msg, first, last, offset),
7772c099014SDavid Howells 
7782c099014SDavid Howells 	    TP_STRUCT__entry(
779a25e21f0SDavid Howells 		    __field(unsigned int,		call		)
7802c099014SDavid Howells 		    __field(pgoff_t,			first		)
7812c099014SDavid Howells 		    __field(pgoff_t,			last		)
7822c099014SDavid Howells 		    __field(unsigned int,		nr		)
7832c099014SDavid Howells 		    __field(unsigned int,		bytes		)
7842c099014SDavid Howells 		    __field(unsigned int,		offset		)
7852c099014SDavid Howells 		    __field(unsigned int,		flags		)
7862c099014SDavid Howells 			     ),
7872c099014SDavid Howells 
7882c099014SDavid Howells 	    TP_fast_assign(
789a25e21f0SDavid Howells 		    __entry->call = call->debug_id;
7902c099014SDavid Howells 		    __entry->first = first;
7912c099014SDavid Howells 		    __entry->last = last;
7922c099014SDavid Howells 		    __entry->nr = msg->msg_iter.nr_segs;
7932c099014SDavid Howells 		    __entry->bytes = msg->msg_iter.count;
7942c099014SDavid Howells 		    __entry->offset = offset;
7952c099014SDavid Howells 		    __entry->flags = msg->msg_flags;
7962c099014SDavid Howells 			   ),
7972c099014SDavid Howells 
798a25e21f0SDavid Howells 	    TP_printk(" c=%08x %lx-%lx-%lx b=%x o=%x f=%x",
7992c099014SDavid Howells 		      __entry->call,
8002c099014SDavid Howells 		      __entry->first, __entry->first + __entry->nr - 1, __entry->last,
8012c099014SDavid Howells 		      __entry->bytes, __entry->offset,
8022c099014SDavid Howells 		      __entry->flags)
8032c099014SDavid Howells 	    );
8042c099014SDavid Howells 
8052c099014SDavid Howells TRACE_EVENT(afs_sent_pages,
8062c099014SDavid Howells 	    TP_PROTO(struct afs_call *call, pgoff_t first, pgoff_t last,
8072c099014SDavid Howells 		     pgoff_t cursor, int ret),
8082c099014SDavid Howells 
8092c099014SDavid Howells 	    TP_ARGS(call, first, last, cursor, ret),
8102c099014SDavid Howells 
8112c099014SDavid Howells 	    TP_STRUCT__entry(
812a25e21f0SDavid Howells 		    __field(unsigned int,		call		)
8132c099014SDavid Howells 		    __field(pgoff_t,			first		)
8142c099014SDavid Howells 		    __field(pgoff_t,			last		)
8152c099014SDavid Howells 		    __field(pgoff_t,			cursor		)
8162c099014SDavid Howells 		    __field(int,			ret		)
8172c099014SDavid Howells 			     ),
8182c099014SDavid Howells 
8192c099014SDavid Howells 	    TP_fast_assign(
820a25e21f0SDavid Howells 		    __entry->call = call->debug_id;
8212c099014SDavid Howells 		    __entry->first = first;
8222c099014SDavid Howells 		    __entry->last = last;
8232c099014SDavid Howells 		    __entry->cursor = cursor;
8242c099014SDavid Howells 		    __entry->ret = ret;
8252c099014SDavid Howells 			   ),
8262c099014SDavid Howells 
827a25e21f0SDavid Howells 	    TP_printk(" c=%08x %lx-%lx c=%lx r=%d",
8282c099014SDavid Howells 		      __entry->call,
8292c099014SDavid Howells 		      __entry->first, __entry->last,
8302c099014SDavid Howells 		      __entry->cursor, __entry->ret)
8312c099014SDavid Howells 	    );
8322c099014SDavid Howells 
833dab17c1aSDavid Howells TRACE_EVENT(afs_dir_check_failed,
834dab17c1aSDavid Howells 	    TP_PROTO(struct afs_vnode *vnode, loff_t off, loff_t i_size),
835dab17c1aSDavid Howells 
836dab17c1aSDavid Howells 	    TP_ARGS(vnode, off, i_size),
837dab17c1aSDavid Howells 
838dab17c1aSDavid Howells 	    TP_STRUCT__entry(
839dab17c1aSDavid Howells 		    __field(struct afs_vnode *,		vnode		)
840dab17c1aSDavid Howells 		    __field(loff_t,			off		)
841dab17c1aSDavid Howells 		    __field(loff_t,			i_size		)
842dab17c1aSDavid Howells 			     ),
843dab17c1aSDavid Howells 
844dab17c1aSDavid Howells 	    TP_fast_assign(
845dab17c1aSDavid Howells 		    __entry->vnode = vnode;
846dab17c1aSDavid Howells 		    __entry->off = off;
847dab17c1aSDavid Howells 		    __entry->i_size = i_size;
848dab17c1aSDavid Howells 			   ),
849dab17c1aSDavid Howells 
850dab17c1aSDavid Howells 	    TP_printk("vn=%p %llx/%llx",
851dab17c1aSDavid Howells 		      __entry->vnode, __entry->off, __entry->i_size)
852dab17c1aSDavid Howells 	    );
853dab17c1aSDavid Howells 
85413524ab3SDavid Howells /*
85513524ab3SDavid Howells  * We use page->private to hold the amount of the page that we've written to,
85613524ab3SDavid Howells  * splitting the field into two parts.  However, we need to represent a range
85713524ab3SDavid Howells  * 0...PAGE_SIZE inclusive, so we can't support 64K pages on a 32-bit system.
85813524ab3SDavid Howells  */
85913524ab3SDavid Howells #if PAGE_SIZE > 32768
86013524ab3SDavid Howells #define AFS_PRIV_MAX	0xffffffff
86113524ab3SDavid Howells #define AFS_PRIV_SHIFT	32
86213524ab3SDavid Howells #else
86313524ab3SDavid Howells #define AFS_PRIV_MAX	0xffff
86413524ab3SDavid Howells #define AFS_PRIV_SHIFT	16
86513524ab3SDavid Howells #endif
86613524ab3SDavid Howells 
86713524ab3SDavid Howells TRACE_EVENT(afs_page_dirty,
86813524ab3SDavid Howells 	    TP_PROTO(struct afs_vnode *vnode, const char *where,
86913524ab3SDavid Howells 		     pgoff_t page, unsigned long priv),
87013524ab3SDavid Howells 
87113524ab3SDavid Howells 	    TP_ARGS(vnode, where, page, priv),
87213524ab3SDavid Howells 
87313524ab3SDavid Howells 	    TP_STRUCT__entry(
87413524ab3SDavid Howells 		    __field(struct afs_vnode *,		vnode		)
87513524ab3SDavid Howells 		    __field(const char *,		where		)
87613524ab3SDavid Howells 		    __field(pgoff_t,			page		)
87713524ab3SDavid Howells 		    __field(unsigned long,		priv		)
87813524ab3SDavid Howells 			     ),
87913524ab3SDavid Howells 
88013524ab3SDavid Howells 	    TP_fast_assign(
88113524ab3SDavid Howells 		    __entry->vnode = vnode;
88213524ab3SDavid Howells 		    __entry->where = where;
88313524ab3SDavid Howells 		    __entry->page = page;
88413524ab3SDavid Howells 		    __entry->priv = priv;
88513524ab3SDavid Howells 			   ),
88613524ab3SDavid Howells 
88713524ab3SDavid Howells 	    TP_printk("vn=%p %lx %s %lu-%lu",
88813524ab3SDavid Howells 		      __entry->vnode, __entry->page, __entry->where,
88913524ab3SDavid Howells 		      __entry->priv & AFS_PRIV_MAX,
89013524ab3SDavid Howells 		      __entry->priv >> AFS_PRIV_SHIFT)
89113524ab3SDavid Howells 	    );
89213524ab3SDavid Howells 
89398bf40cdSDavid Howells TRACE_EVENT(afs_call_state,
89498bf40cdSDavid Howells 	    TP_PROTO(struct afs_call *call,
89598bf40cdSDavid Howells 		     enum afs_call_state from,
89698bf40cdSDavid Howells 		     enum afs_call_state to,
89798bf40cdSDavid Howells 		     int ret, u32 remote_abort),
89898bf40cdSDavid Howells 
89998bf40cdSDavid Howells 	    TP_ARGS(call, from, to, ret, remote_abort),
90098bf40cdSDavid Howells 
90198bf40cdSDavid Howells 	    TP_STRUCT__entry(
902a25e21f0SDavid Howells 		    __field(unsigned int,		call		)
90398bf40cdSDavid Howells 		    __field(enum afs_call_state,	from		)
90498bf40cdSDavid Howells 		    __field(enum afs_call_state,	to		)
90598bf40cdSDavid Howells 		    __field(int,			ret		)
90698bf40cdSDavid Howells 		    __field(u32,			abort		)
90798bf40cdSDavid Howells 			     ),
90898bf40cdSDavid Howells 
90998bf40cdSDavid Howells 	    TP_fast_assign(
910a25e21f0SDavid Howells 		    __entry->call = call->debug_id;
91198bf40cdSDavid Howells 		    __entry->from = from;
91298bf40cdSDavid Howells 		    __entry->to = to;
91398bf40cdSDavid Howells 		    __entry->ret = ret;
91498bf40cdSDavid Howells 		    __entry->abort = remote_abort;
91598bf40cdSDavid Howells 			   ),
91698bf40cdSDavid Howells 
917a25e21f0SDavid Howells 	    TP_printk("c=%08x %u->%u r=%d ab=%d",
91898bf40cdSDavid Howells 		      __entry->call,
91998bf40cdSDavid Howells 		      __entry->from, __entry->to,
92098bf40cdSDavid Howells 		      __entry->ret, __entry->abort)
92198bf40cdSDavid Howells 	    );
92298bf40cdSDavid Howells 
92380548b03SDavid Howells TRACE_EVENT(afs_lookup,
92480548b03SDavid Howells 	    TP_PROTO(struct afs_vnode *dvnode, const struct qstr *name,
92540a708bdSDavid Howells 		     struct afs_fid *fid),
92680548b03SDavid Howells 
92740a708bdSDavid Howells 	    TP_ARGS(dvnode, name, fid),
92880548b03SDavid Howells 
92980548b03SDavid Howells 	    TP_STRUCT__entry(
93080548b03SDavid Howells 		    __field_struct(struct afs_fid,	dfid		)
93180548b03SDavid Howells 		    __field_struct(struct afs_fid,	fid		)
93280548b03SDavid Howells 		    __array(char,			name, 24	)
93380548b03SDavid Howells 			     ),
93480548b03SDavid Howells 
93580548b03SDavid Howells 	    TP_fast_assign(
93680548b03SDavid Howells 		    int __len = min_t(int, name->len, 23);
93780548b03SDavid Howells 		    __entry->dfid = dvnode->fid;
93840a708bdSDavid Howells 		    __entry->fid = *fid;
93980548b03SDavid Howells 		    memcpy(__entry->name, name->name, __len);
94080548b03SDavid Howells 		    __entry->name[__len] = 0;
94180548b03SDavid Howells 			   ),
94280548b03SDavid Howells 
94380548b03SDavid Howells 	    TP_printk("d=%llx:%llx:%x \"%s\" f=%llx:%x",
94480548b03SDavid Howells 		      __entry->dfid.vid, __entry->dfid.vnode, __entry->dfid.unique,
94580548b03SDavid Howells 		      __entry->name,
94680548b03SDavid Howells 		      __entry->fid.vnode, __entry->fid.unique)
94780548b03SDavid Howells 	    );
94880548b03SDavid Howells 
94963a4681fSDavid Howells TRACE_EVENT(afs_edit_dir,
95063a4681fSDavid Howells 	    TP_PROTO(struct afs_vnode *dvnode,
95163a4681fSDavid Howells 		     enum afs_edit_dir_reason why,
95263a4681fSDavid Howells 		     enum afs_edit_dir_op op,
95363a4681fSDavid Howells 		     unsigned int block,
95463a4681fSDavid Howells 		     unsigned int slot,
95563a4681fSDavid Howells 		     unsigned int f_vnode,
95663a4681fSDavid Howells 		     unsigned int f_unique,
95763a4681fSDavid Howells 		     const char *name),
95863a4681fSDavid Howells 
95963a4681fSDavid Howells 	    TP_ARGS(dvnode, why, op, block, slot, f_vnode, f_unique, name),
96063a4681fSDavid Howells 
96163a4681fSDavid Howells 	    TP_STRUCT__entry(
96263a4681fSDavid Howells 		    __field(unsigned int,		vnode		)
96363a4681fSDavid Howells 		    __field(unsigned int,		unique		)
96463a4681fSDavid Howells 		    __field(enum afs_edit_dir_reason,	why		)
96563a4681fSDavid Howells 		    __field(enum afs_edit_dir_op,	op		)
96663a4681fSDavid Howells 		    __field(unsigned int,		block		)
96763a4681fSDavid Howells 		    __field(unsigned short,		slot		)
96863a4681fSDavid Howells 		    __field(unsigned int,		f_vnode		)
96963a4681fSDavid Howells 		    __field(unsigned int,		f_unique	)
97080548b03SDavid Howells 		    __array(char,			name, 24	)
97163a4681fSDavid Howells 			     ),
97263a4681fSDavid Howells 
97363a4681fSDavid Howells 	    TP_fast_assign(
97463a4681fSDavid Howells 		    int __len = strlen(name);
97580548b03SDavid Howells 		    __len = min(__len, 23);
97663a4681fSDavid Howells 		    __entry->vnode	= dvnode->fid.vnode;
97763a4681fSDavid Howells 		    __entry->unique	= dvnode->fid.unique;
97863a4681fSDavid Howells 		    __entry->why	= why;
97963a4681fSDavid Howells 		    __entry->op		= op;
98063a4681fSDavid Howells 		    __entry->block	= block;
98163a4681fSDavid Howells 		    __entry->slot	= slot;
98263a4681fSDavid Howells 		    __entry->f_vnode	= f_vnode;
98363a4681fSDavid Howells 		    __entry->f_unique	= f_unique;
98463a4681fSDavid Howells 		    memcpy(__entry->name, name, __len);
98563a4681fSDavid Howells 		    __entry->name[__len] = 0;
98663a4681fSDavid Howells 			   ),
98763a4681fSDavid Howells 
98880548b03SDavid Howells 	    TP_printk("d=%x:%x %s %s %u[%u] f=%x:%x \"%s\"",
98963a4681fSDavid Howells 		      __entry->vnode, __entry->unique,
99063a4681fSDavid Howells 		      __print_symbolic(__entry->why, afs_edit_dir_reasons),
99163a4681fSDavid Howells 		      __print_symbolic(__entry->op, afs_edit_dir_ops),
99263a4681fSDavid Howells 		      __entry->block, __entry->slot,
99363a4681fSDavid Howells 		      __entry->f_vnode, __entry->f_unique,
99463a4681fSDavid Howells 		      __entry->name)
99563a4681fSDavid Howells 	    );
99663a4681fSDavid Howells 
9975f702c8eSDavid Howells TRACE_EVENT(afs_protocol_error,
9987126ead9SDavid Howells 	    TP_PROTO(struct afs_call *call, enum afs_eproto_cause cause),
9995f702c8eSDavid Howells 
10007126ead9SDavid Howells 	    TP_ARGS(call, cause),
10015f702c8eSDavid Howells 
10025f702c8eSDavid Howells 	    TP_STRUCT__entry(
10035f702c8eSDavid Howells 		    __field(unsigned int,		call		)
1004160cb957SDavid Howells 		    __field(enum afs_eproto_cause,	cause		)
10055f702c8eSDavid Howells 			     ),
10065f702c8eSDavid Howells 
10075f702c8eSDavid Howells 	    TP_fast_assign(
10085f702c8eSDavid Howells 		    __entry->call = call ? call->debug_id : 0;
1009160cb957SDavid Howells 		    __entry->cause = cause;
10105f702c8eSDavid Howells 			   ),
10115f702c8eSDavid Howells 
10127126ead9SDavid Howells 	    TP_printk("c=%08x %s",
10137126ead9SDavid Howells 		      __entry->call,
1014160cb957SDavid Howells 		      __print_symbolic(__entry->cause, afs_eproto_causes))
10155f702c8eSDavid Howells 	    );
10165f702c8eSDavid Howells 
1017f51375cdSDavid Howells TRACE_EVENT(afs_io_error,
1018f51375cdSDavid Howells 	    TP_PROTO(unsigned int call, int error, enum afs_io_error where),
1019f51375cdSDavid Howells 
1020f51375cdSDavid Howells 	    TP_ARGS(call, error, where),
1021f51375cdSDavid Howells 
1022f51375cdSDavid Howells 	    TP_STRUCT__entry(
1023f51375cdSDavid Howells 		    __field(unsigned int,	call		)
1024f51375cdSDavid Howells 		    __field(int,		error		)
1025f51375cdSDavid Howells 		    __field(enum afs_io_error,	where		)
1026f51375cdSDavid Howells 			     ),
1027f51375cdSDavid Howells 
1028f51375cdSDavid Howells 	    TP_fast_assign(
1029f51375cdSDavid Howells 		    __entry->call = call;
1030f51375cdSDavid Howells 		    __entry->error = error;
1031f51375cdSDavid Howells 		    __entry->where = where;
1032f51375cdSDavid Howells 			   ),
1033f51375cdSDavid Howells 
1034f51375cdSDavid Howells 	    TP_printk("c=%08x r=%d %s",
1035f51375cdSDavid Howells 		      __entry->call, __entry->error,
1036f51375cdSDavid Howells 		      __print_symbolic(__entry->where, afs_io_errors))
1037f51375cdSDavid Howells 	    );
1038f51375cdSDavid Howells 
1039f51375cdSDavid Howells TRACE_EVENT(afs_file_error,
1040f51375cdSDavid Howells 	    TP_PROTO(struct afs_vnode *vnode, int error, enum afs_file_error where),
1041f51375cdSDavid Howells 
1042f51375cdSDavid Howells 	    TP_ARGS(vnode, error, where),
1043f51375cdSDavid Howells 
1044f51375cdSDavid Howells 	    TP_STRUCT__entry(
1045f51375cdSDavid Howells 		    __field_struct(struct afs_fid,	fid		)
1046f51375cdSDavid Howells 		    __field(int,			error		)
1047f51375cdSDavid Howells 		    __field(enum afs_file_error,	where		)
1048f51375cdSDavid Howells 			     ),
1049f51375cdSDavid Howells 
1050f51375cdSDavid Howells 	    TP_fast_assign(
1051f51375cdSDavid Howells 		    __entry->fid = vnode->fid;
1052f51375cdSDavid Howells 		    __entry->error = error;
1053f51375cdSDavid Howells 		    __entry->where = where;
1054f51375cdSDavid Howells 			   ),
1055f51375cdSDavid Howells 
10563b6492dfSDavid Howells 	    TP_printk("%llx:%llx:%x r=%d %s",
1057f51375cdSDavid Howells 		      __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1058f51375cdSDavid Howells 		      __entry->error,
1059f51375cdSDavid Howells 		      __print_symbolic(__entry->where, afs_file_errors))
1060f51375cdSDavid Howells 	    );
1061f51375cdSDavid Howells 
10623709a399SDavid Howells TRACE_EVENT(afs_cm_no_server,
10633709a399SDavid Howells 	    TP_PROTO(struct afs_call *call, struct sockaddr_rxrpc *srx),
10643709a399SDavid Howells 
10653709a399SDavid Howells 	    TP_ARGS(call, srx),
10663709a399SDavid Howells 
10673709a399SDavid Howells 	    TP_STRUCT__entry(
10683709a399SDavid Howells 		    __field(unsigned int,			call	)
10693709a399SDavid Howells 		    __field(unsigned int,			op_id	)
10703709a399SDavid Howells 		    __field_struct(struct sockaddr_rxrpc,	srx	)
10713709a399SDavid Howells 			     ),
10723709a399SDavid Howells 
10733709a399SDavid Howells 	    TP_fast_assign(
10743709a399SDavid Howells 		    __entry->call = call->debug_id;
10753709a399SDavid Howells 		    __entry->op_id = call->operation_ID;
10763709a399SDavid Howells 		    memcpy(&__entry->srx, srx, sizeof(__entry->srx));
10773709a399SDavid Howells 			   ),
10783709a399SDavid Howells 
10793709a399SDavid Howells 	    TP_printk("c=%08x op=%u %pISpc",
10803709a399SDavid Howells 		      __entry->call, __entry->op_id, &__entry->srx.transport)
10813709a399SDavid Howells 	    );
10823709a399SDavid Howells 
10833709a399SDavid Howells TRACE_EVENT(afs_cm_no_server_u,
10843709a399SDavid Howells 	    TP_PROTO(struct afs_call *call, const uuid_t *uuid),
10853709a399SDavid Howells 
10863709a399SDavid Howells 	    TP_ARGS(call, uuid),
10873709a399SDavid Howells 
10883709a399SDavid Howells 	    TP_STRUCT__entry(
10893709a399SDavid Howells 		    __field(unsigned int,			call	)
10903709a399SDavid Howells 		    __field(unsigned int,			op_id	)
10913709a399SDavid Howells 		    __field_struct(uuid_t,			uuid	)
10923709a399SDavid Howells 			     ),
10933709a399SDavid Howells 
10943709a399SDavid Howells 	    TP_fast_assign(
10953709a399SDavid Howells 		    __entry->call = call->debug_id;
10963709a399SDavid Howells 		    __entry->op_id = call->operation_ID;
10973709a399SDavid Howells 		    memcpy(&__entry->uuid, uuid, sizeof(__entry->uuid));
10983709a399SDavid Howells 			   ),
10993709a399SDavid Howells 
11003709a399SDavid Howells 	    TP_printk("c=%08x op=%u %pU",
11013709a399SDavid Howells 		      __entry->call, __entry->op_id, &__entry->uuid)
11023709a399SDavid Howells 	    );
11033709a399SDavid Howells 
1104d4696601SDavid Howells TRACE_EVENT(afs_flock_ev,
1105d4696601SDavid Howells 	    TP_PROTO(struct afs_vnode *vnode, struct file_lock *fl,
1106d4696601SDavid Howells 		     enum afs_flock_event event, int error),
1107d4696601SDavid Howells 
1108d4696601SDavid Howells 	    TP_ARGS(vnode, fl, event, error),
1109d4696601SDavid Howells 
1110d4696601SDavid Howells 	    TP_STRUCT__entry(
1111d4696601SDavid Howells 		    __field_struct(struct afs_fid,	fid		)
1112d4696601SDavid Howells 		    __field(enum afs_flock_event,	event		)
1113d4696601SDavid Howells 		    __field(enum afs_lock_state,	state		)
1114d4696601SDavid Howells 		    __field(int,			error		)
1115d4696601SDavid Howells 		    __field(unsigned int,		debug_id	)
1116d4696601SDavid Howells 			     ),
1117d4696601SDavid Howells 
1118d4696601SDavid Howells 	    TP_fast_assign(
1119d4696601SDavid Howells 		    __entry->fid = vnode->fid;
1120d4696601SDavid Howells 		    __entry->event = event;
1121d4696601SDavid Howells 		    __entry->state = vnode->lock_state;
1122d4696601SDavid Howells 		    __entry->error = error;
1123d4696601SDavid Howells 		    __entry->debug_id = fl ? fl->fl_u.afs.debug_id : 0;
1124d4696601SDavid Howells 			   ),
1125d4696601SDavid Howells 
1126d4696601SDavid Howells 	    TP_printk("%llx:%llx:%x %04x %s s=%s e=%d",
1127d4696601SDavid Howells 		      __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1128d4696601SDavid Howells 		      __entry->debug_id,
1129d4696601SDavid Howells 		      __print_symbolic(__entry->event, afs_flock_events),
1130d4696601SDavid Howells 		      __print_symbolic(__entry->state, afs_flock_states),
1131d4696601SDavid Howells 		      __entry->error)
1132d4696601SDavid Howells 	    );
1133d4696601SDavid Howells 
1134d4696601SDavid Howells TRACE_EVENT(afs_flock_op,
1135d4696601SDavid Howells 	    TP_PROTO(struct afs_vnode *vnode, struct file_lock *fl,
1136d4696601SDavid Howells 		     enum afs_flock_operation op),
1137d4696601SDavid Howells 
1138d4696601SDavid Howells 	    TP_ARGS(vnode, fl, op),
1139d4696601SDavid Howells 
1140d4696601SDavid Howells 	    TP_STRUCT__entry(
1141d4696601SDavid Howells 		    __field_struct(struct afs_fid,	fid		)
1142d4696601SDavid Howells 		    __field(loff_t,			from		)
1143d4696601SDavid Howells 		    __field(loff_t,			len		)
1144d4696601SDavid Howells 		    __field(enum afs_flock_operation,	op		)
1145d4696601SDavid Howells 		    __field(unsigned char,		type		)
1146d4696601SDavid Howells 		    __field(unsigned int,		flags		)
1147d4696601SDavid Howells 		    __field(unsigned int,		debug_id	)
1148d4696601SDavid Howells 			     ),
1149d4696601SDavid Howells 
1150d4696601SDavid Howells 	    TP_fast_assign(
1151d4696601SDavid Howells 		    __entry->fid = vnode->fid;
1152d4696601SDavid Howells 		    __entry->from = fl->fl_start;
1153d4696601SDavid Howells 		    __entry->len = fl->fl_end - fl->fl_start + 1;
1154d4696601SDavid Howells 		    __entry->op = op;
1155d4696601SDavid Howells 		    __entry->type = fl->fl_type;
1156d4696601SDavid Howells 		    __entry->flags = fl->fl_flags;
1157d4696601SDavid Howells 		    __entry->debug_id = fl->fl_u.afs.debug_id;
1158d4696601SDavid Howells 			   ),
1159d4696601SDavid Howells 
1160d4696601SDavid Howells 	    TP_printk("%llx:%llx:%x %04x %s t=%s R=%llx/%llx f=%x",
1161d4696601SDavid Howells 		      __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1162d4696601SDavid Howells 		      __entry->debug_id,
1163d4696601SDavid Howells 		      __print_symbolic(__entry->op, afs_flock_operations),
1164d4696601SDavid Howells 		      __print_symbolic(__entry->type, afs_flock_types),
1165d4696601SDavid Howells 		      __entry->from, __entry->len, __entry->flags)
1166d4696601SDavid Howells 	    );
1167d4696601SDavid Howells 
116899987c56SDavid Howells TRACE_EVENT(afs_reload_dir,
116999987c56SDavid Howells 	    TP_PROTO(struct afs_vnode *vnode),
117099987c56SDavid Howells 
117199987c56SDavid Howells 	    TP_ARGS(vnode),
117299987c56SDavid Howells 
117399987c56SDavid Howells 	    TP_STRUCT__entry(
117499987c56SDavid Howells 		    __field_struct(struct afs_fid,	fid		)
117599987c56SDavid Howells 			     ),
117699987c56SDavid Howells 
117799987c56SDavid Howells 	    TP_fast_assign(
117899987c56SDavid Howells 		    __entry->fid = vnode->fid;
117999987c56SDavid Howells 			   ),
118099987c56SDavid Howells 
118199987c56SDavid Howells 	    TP_printk("%llx:%llx:%x",
118299987c56SDavid Howells 		      __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique)
118399987c56SDavid Howells 	    );
118499987c56SDavid Howells 
118579ddbfa5SDavid Howells TRACE_EVENT(afs_silly_rename,
118679ddbfa5SDavid Howells 	    TP_PROTO(struct afs_vnode *vnode, bool done),
118779ddbfa5SDavid Howells 
118879ddbfa5SDavid Howells 	    TP_ARGS(vnode, done),
118979ddbfa5SDavid Howells 
119079ddbfa5SDavid Howells 	    TP_STRUCT__entry(
119179ddbfa5SDavid Howells 		    __field_struct(struct afs_fid,	fid		)
119279ddbfa5SDavid Howells 		    __field(bool,			done		)
119379ddbfa5SDavid Howells 			     ),
119479ddbfa5SDavid Howells 
119579ddbfa5SDavid Howells 	    TP_fast_assign(
119679ddbfa5SDavid Howells 		    __entry->fid = vnode->fid;
119779ddbfa5SDavid Howells 		    __entry->done = done;
119879ddbfa5SDavid Howells 			   ),
119979ddbfa5SDavid Howells 
120079ddbfa5SDavid Howells 	    TP_printk("%llx:%llx:%x done=%u",
120179ddbfa5SDavid Howells 		      __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
120279ddbfa5SDavid Howells 		      __entry->done)
120379ddbfa5SDavid Howells 	    );
120479ddbfa5SDavid Howells 
120580548b03SDavid Howells TRACE_EVENT(afs_get_tree,
120680548b03SDavid Howells 	    TP_PROTO(struct afs_cell *cell, struct afs_volume *volume),
120780548b03SDavid Howells 
120880548b03SDavid Howells 	    TP_ARGS(cell, volume),
120980548b03SDavid Howells 
121080548b03SDavid Howells 	    TP_STRUCT__entry(
121180548b03SDavid Howells 		    __field(u64,			vid		)
121280548b03SDavid Howells 		    __array(char,			cell, 24	)
121380548b03SDavid Howells 		    __array(char,			volume, 24	)
121480548b03SDavid Howells 			     ),
121580548b03SDavid Howells 
121680548b03SDavid Howells 	    TP_fast_assign(
121780548b03SDavid Howells 		    int __len;
121880548b03SDavid Howells 		    __entry->vid = volume->vid;
121980548b03SDavid Howells 		    __len = min_t(int, cell->name_len, 23);
122080548b03SDavid Howells 		    memcpy(__entry->cell, cell->name, __len);
122180548b03SDavid Howells 		    __entry->cell[__len] = 0;
122280548b03SDavid Howells 		    __len = min_t(int, volume->name_len, 23);
122380548b03SDavid Howells 		    memcpy(__entry->volume, volume->name, __len);
122480548b03SDavid Howells 		    __entry->volume[__len] = 0;
122580548b03SDavid Howells 			   ),
122680548b03SDavid Howells 
122780548b03SDavid Howells 	    TP_printk("--- MOUNT %s:%s %llx",
122880548b03SDavid Howells 		      __entry->cell, __entry->volume, __entry->vid)
122980548b03SDavid Howells 	    );
123080548b03SDavid Howells 
1231051d2525SDavid Howells TRACE_EVENT(afs_cb_break,
1232051d2525SDavid Howells 	    TP_PROTO(struct afs_fid *fid, unsigned int cb_break,
1233051d2525SDavid Howells 		     enum afs_cb_break_reason reason, bool skipped),
1234051d2525SDavid Howells 
1235051d2525SDavid Howells 	    TP_ARGS(fid, cb_break, reason, skipped),
1236051d2525SDavid Howells 
1237051d2525SDavid Howells 	    TP_STRUCT__entry(
1238051d2525SDavid Howells 		    __field_struct(struct afs_fid,	fid		)
1239051d2525SDavid Howells 		    __field(unsigned int,		cb_break	)
1240051d2525SDavid Howells 		    __field(enum afs_cb_break_reason,	reason		)
1241051d2525SDavid Howells 		    __field(bool,			skipped		)
1242051d2525SDavid Howells 			     ),
1243051d2525SDavid Howells 
1244051d2525SDavid Howells 	    TP_fast_assign(
1245051d2525SDavid Howells 		    __entry->fid	= *fid;
1246051d2525SDavid Howells 		    __entry->cb_break	= cb_break;
1247051d2525SDavid Howells 		    __entry->reason	= reason;
1248051d2525SDavid Howells 		    __entry->skipped	= skipped;
1249051d2525SDavid Howells 			   ),
1250051d2525SDavid Howells 
1251051d2525SDavid Howells 	    TP_printk("%llx:%llx:%x b=%x s=%u %s",
1252051d2525SDavid Howells 		      __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1253051d2525SDavid Howells 		      __entry->cb_break,
1254051d2525SDavid Howells 		      __entry->skipped,
1255051d2525SDavid Howells 		      __print_symbolic(__entry->reason, afs_cb_break_reasons))
1256051d2525SDavid Howells 	    );
1257051d2525SDavid Howells 
1258051d2525SDavid Howells TRACE_EVENT(afs_cb_miss,
1259051d2525SDavid Howells 	    TP_PROTO(struct afs_fid *fid, enum afs_cb_break_reason reason),
1260051d2525SDavid Howells 
1261051d2525SDavid Howells 	    TP_ARGS(fid, reason),
1262051d2525SDavid Howells 
1263051d2525SDavid Howells 	    TP_STRUCT__entry(
1264051d2525SDavid Howells 		    __field_struct(struct afs_fid,	fid		)
1265051d2525SDavid Howells 		    __field(enum afs_cb_break_reason,	reason		)
1266051d2525SDavid Howells 			     ),
1267051d2525SDavid Howells 
1268051d2525SDavid Howells 	    TP_fast_assign(
1269051d2525SDavid Howells 		    __entry->fid	= *fid;
1270051d2525SDavid Howells 		    __entry->reason	= reason;
1271051d2525SDavid Howells 			   ),
1272051d2525SDavid Howells 
1273051d2525SDavid Howells 	    TP_printk(" %llx:%llx:%x %s",
1274051d2525SDavid Howells 		      __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1275051d2525SDavid Howells 		      __print_symbolic(__entry->reason, afs_cb_break_reasons))
1276051d2525SDavid Howells 	    );
1277051d2525SDavid Howells 
127845218193SDavid Howells TRACE_EVENT(afs_server,
1279977e5f8eSDavid Howells 	    TP_PROTO(struct afs_server *server, int ref, int active,
1280977e5f8eSDavid Howells 		     enum afs_server_trace reason),
128145218193SDavid Howells 
1282977e5f8eSDavid Howells 	    TP_ARGS(server, ref, active, reason),
128345218193SDavid Howells 
128445218193SDavid Howells 	    TP_STRUCT__entry(
128545218193SDavid Howells 		    __field(unsigned int,		server		)
1286977e5f8eSDavid Howells 		    __field(int,			ref		)
1287977e5f8eSDavid Howells 		    __field(int,			active		)
128845218193SDavid Howells 		    __field(int,			reason		)
128945218193SDavid Howells 			     ),
129045218193SDavid Howells 
129145218193SDavid Howells 	    TP_fast_assign(
129245218193SDavid Howells 		    __entry->server = server->debug_id;
1293977e5f8eSDavid Howells 		    __entry->ref = ref;
1294977e5f8eSDavid Howells 		    __entry->active = active;
129545218193SDavid Howells 		    __entry->reason = reason;
129645218193SDavid Howells 			   ),
129745218193SDavid Howells 
1298977e5f8eSDavid Howells 	    TP_printk("s=%08x %s u=%d a=%d",
129945218193SDavid Howells 		      __entry->server,
130045218193SDavid Howells 		      __print_symbolic(__entry->reason, afs_server_traces),
1301977e5f8eSDavid Howells 		      __entry->ref,
1302977e5f8eSDavid Howells 		      __entry->active)
130345218193SDavid Howells 	    );
130445218193SDavid Howells 
13058e8d7f13SDavid Howells #endif /* _TRACE_AFS_H */
13068e8d7f13SDavid Howells 
13078e8d7f13SDavid Howells /* This part must be outside protection */
13088e8d7f13SDavid Howells #include <trace/define_trace.h>
1309