xref: /openbmc/linux/include/trace/events/afs.h (revision 30062bd13e3659a309d249a06d5f4ebb4a5c5251)
18e8d7f13SDavid Howells /* AFS tracepoints
28e8d7f13SDavid Howells  *
38e8d7f13SDavid Howells  * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved.
48e8d7f13SDavid Howells  * Written by David Howells (dhowells@redhat.com)
58e8d7f13SDavid Howells  *
68e8d7f13SDavid Howells  * This program is free software; you can redistribute it and/or
78e8d7f13SDavid Howells  * modify it under the terms of the GNU General Public Licence
88e8d7f13SDavid Howells  * as published by the Free Software Foundation; either version
98e8d7f13SDavid Howells  * 2 of the Licence, or (at your option) any later version.
108e8d7f13SDavid Howells  */
118e8d7f13SDavid Howells #undef TRACE_SYSTEM
128e8d7f13SDavid Howells #define TRACE_SYSTEM afs
138e8d7f13SDavid Howells 
148e8d7f13SDavid Howells #if !defined(_TRACE_AFS_H) || defined(TRACE_HEADER_MULTI_READ)
158e8d7f13SDavid Howells #define _TRACE_AFS_H
168e8d7f13SDavid Howells 
178e8d7f13SDavid Howells #include <linux/tracepoint.h>
188e8d7f13SDavid Howells 
19341f741fSDavid Howells /*
20341f741fSDavid Howells  * Define enums for tracing information.
21341f741fSDavid Howells  */
22341f741fSDavid Howells #ifndef __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY
23341f741fSDavid Howells #define __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY
24341f741fSDavid Howells 
25341f741fSDavid Howells enum afs_call_trace {
26341f741fSDavid Howells 	afs_call_trace_alloc,
27341f741fSDavid Howells 	afs_call_trace_free,
28341f741fSDavid Howells 	afs_call_trace_put,
29341f741fSDavid Howells 	afs_call_trace_wake,
30341f741fSDavid Howells 	afs_call_trace_work,
31341f741fSDavid Howells };
32341f741fSDavid Howells 
33025db80cSDavid Howells enum afs_fs_operation {
34025db80cSDavid Howells 	afs_FS_FetchData		= 130,	/* AFS Fetch file data */
35025db80cSDavid Howells 	afs_FS_FetchStatus		= 132,	/* AFS Fetch file status */
36025db80cSDavid Howells 	afs_FS_StoreData		= 133,	/* AFS Store file data */
37025db80cSDavid Howells 	afs_FS_StoreStatus		= 135,	/* AFS Store file status */
38025db80cSDavid Howells 	afs_FS_RemoveFile		= 136,	/* AFS Remove a file */
39025db80cSDavid Howells 	afs_FS_CreateFile		= 137,	/* AFS Create a file */
40025db80cSDavid Howells 	afs_FS_Rename			= 138,	/* AFS Rename or move a file or directory */
41025db80cSDavid Howells 	afs_FS_Symlink			= 139,	/* AFS Create a symbolic link */
42025db80cSDavid Howells 	afs_FS_Link			= 140,	/* AFS Create a hard link */
43025db80cSDavid Howells 	afs_FS_MakeDir			= 141,	/* AFS Create a directory */
44025db80cSDavid Howells 	afs_FS_RemoveDir		= 142,	/* AFS Remove a directory */
45025db80cSDavid Howells 	afs_FS_GetVolumeInfo		= 148,	/* AFS Get information about a volume */
46025db80cSDavid Howells 	afs_FS_GetVolumeStatus		= 149,	/* AFS Get volume status information */
47025db80cSDavid Howells 	afs_FS_GetRootVolume		= 151,	/* AFS Get root volume name */
48025db80cSDavid Howells 	afs_FS_SetLock			= 156,	/* AFS Request a file lock */
49025db80cSDavid Howells 	afs_FS_ExtendLock		= 157,	/* AFS Extend a file lock */
50025db80cSDavid Howells 	afs_FS_ReleaseLock		= 158,	/* AFS Release a file lock */
51025db80cSDavid Howells 	afs_FS_Lookup			= 161,	/* AFS lookup file in directory */
525cf9dd55SDavid Howells 	afs_FS_InlineBulkStatus		= 65536, /* AFS Fetch multiple file statuses with errors */
53025db80cSDavid Howells 	afs_FS_FetchData64		= 65537, /* AFS Fetch file data */
54025db80cSDavid Howells 	afs_FS_StoreData64		= 65538, /* AFS Store file data */
55025db80cSDavid Howells 	afs_FS_GiveUpAllCallBacks	= 65539, /* AFS Give up all our callbacks on a server */
56025db80cSDavid Howells 	afs_FS_GetCapabilities		= 65540, /* AFS Get FS server capabilities */
57*30062bd1SDavid Howells 
58*30062bd1SDavid Howells 	yfs_FS_FetchData		= 130,	 /* YFS Fetch file data */
59*30062bd1SDavid Howells 	yfs_FS_FetchACL			= 64131, /* YFS Fetch file ACL */
60*30062bd1SDavid Howells 	yfs_FS_FetchStatus		= 64132, /* YFS Fetch file status */
61*30062bd1SDavid Howells 	yfs_FS_StoreACL			= 64134, /* YFS Store file ACL */
62*30062bd1SDavid Howells 	yfs_FS_StoreStatus		= 64135, /* YFS Store file status */
63*30062bd1SDavid Howells 	yfs_FS_RemoveFile		= 64136, /* YFS Remove a file */
64*30062bd1SDavid Howells 	yfs_FS_CreateFile		= 64137, /* YFS Create a file */
65*30062bd1SDavid Howells 	yfs_FS_Rename			= 64138, /* YFS Rename or move a file or directory */
66*30062bd1SDavid Howells 	yfs_FS_Symlink			= 64139, /* YFS Create a symbolic link */
67*30062bd1SDavid Howells 	yfs_FS_Link			= 64140, /* YFS Create a hard link */
68*30062bd1SDavid Howells 	yfs_FS_MakeDir			= 64141, /* YFS Create a directory */
69*30062bd1SDavid Howells 	yfs_FS_RemoveDir		= 64142, /* YFS Remove a directory */
70*30062bd1SDavid Howells 	yfs_FS_GetVolumeStatus		= 64149, /* YFS Get volume status information */
71*30062bd1SDavid Howells 	yfs_FS_SetVolumeStatus		= 64150, /* YFS Set volume status information */
72*30062bd1SDavid Howells 	yfs_FS_SetLock			= 64156, /* YFS Request a file lock */
73*30062bd1SDavid Howells 	yfs_FS_ExtendLock		= 64157, /* YFS Extend a file lock */
74*30062bd1SDavid Howells 	yfs_FS_ReleaseLock		= 64158, /* YFS Release a file lock */
75*30062bd1SDavid Howells 	yfs_FS_Lookup			= 64161, /* YFS lookup file in directory */
76*30062bd1SDavid Howells 	yfs_FS_FlushCPS			= 64165,
77*30062bd1SDavid Howells 	yfs_FS_FetchOpaqueACL		= 64168,
78*30062bd1SDavid Howells 	yfs_FS_WhoAmI			= 64170,
79*30062bd1SDavid Howells 	yfs_FS_RemoveACL		= 64171,
80*30062bd1SDavid Howells 	yfs_FS_RemoveFile2		= 64173,
81*30062bd1SDavid Howells 	yfs_FS_StoreOpaqueACL2		= 64174,
82*30062bd1SDavid Howells 	yfs_FS_InlineBulkStatus		= 64536, /* YFS Fetch multiple file statuses with errors */
83*30062bd1SDavid Howells 	yfs_FS_FetchData64		= 64537, /* YFS Fetch file data */
84*30062bd1SDavid Howells 	yfs_FS_StoreData64		= 64538, /* YFS Store file data */
85*30062bd1SDavid Howells 	yfs_FS_UpdateSymlink		= 64540,
86025db80cSDavid Howells };
87025db80cSDavid Howells 
88025db80cSDavid Howells enum afs_vl_operation {
89025db80cSDavid Howells 	afs_VL_GetEntryByNameU	= 527,		/* AFS Get Vol Entry By Name operation ID */
90025db80cSDavid Howells 	afs_VL_GetAddrsU	= 533,		/* AFS Get FS server addresses */
91025db80cSDavid Howells 	afs_YFSVL_GetEndpoints	= 64002,	/* YFS Get FS & Vol server addresses */
92025db80cSDavid Howells 	afs_VL_GetCapabilities	= 65537,	/* AFS Get VL server capabilities */
93025db80cSDavid Howells };
94025db80cSDavid Howells 
9563a4681fSDavid Howells enum afs_edit_dir_op {
9663a4681fSDavid Howells 	afs_edit_dir_create,
9763a4681fSDavid Howells 	afs_edit_dir_create_error,
9863a4681fSDavid Howells 	afs_edit_dir_create_inval,
9963a4681fSDavid Howells 	afs_edit_dir_create_nospc,
10063a4681fSDavid Howells 	afs_edit_dir_delete,
10163a4681fSDavid Howells 	afs_edit_dir_delete_error,
10263a4681fSDavid Howells 	afs_edit_dir_delete_inval,
10363a4681fSDavid Howells 	afs_edit_dir_delete_noent,
10463a4681fSDavid Howells };
10563a4681fSDavid Howells 
10663a4681fSDavid Howells enum afs_edit_dir_reason {
10763a4681fSDavid Howells 	afs_edit_dir_for_create,
10863a4681fSDavid Howells 	afs_edit_dir_for_link,
10963a4681fSDavid Howells 	afs_edit_dir_for_mkdir,
11063a4681fSDavid Howells 	afs_edit_dir_for_rename,
11163a4681fSDavid Howells 	afs_edit_dir_for_rmdir,
11263a4681fSDavid Howells 	afs_edit_dir_for_symlink,
11363a4681fSDavid Howells 	afs_edit_dir_for_unlink,
11463a4681fSDavid Howells };
11563a4681fSDavid Howells 
116160cb957SDavid Howells enum afs_eproto_cause {
117160cb957SDavid Howells 	afs_eproto_bad_status,
118160cb957SDavid Howells 	afs_eproto_cb_count,
119160cb957SDavid Howells 	afs_eproto_cb_fid_count,
120160cb957SDavid Howells 	afs_eproto_file_type,
121160cb957SDavid Howells 	afs_eproto_ibulkst_cb_count,
122160cb957SDavid Howells 	afs_eproto_ibulkst_count,
123160cb957SDavid Howells 	afs_eproto_motd_len,
124160cb957SDavid Howells 	afs_eproto_offline_msg_len,
125160cb957SDavid Howells 	afs_eproto_volname_len,
126160cb957SDavid Howells 	afs_eproto_yvl_fsendpt4_len,
127160cb957SDavid Howells 	afs_eproto_yvl_fsendpt6_len,
128160cb957SDavid Howells 	afs_eproto_yvl_fsendpt_num,
129160cb957SDavid Howells 	afs_eproto_yvl_fsendpt_type,
130160cb957SDavid Howells 	afs_eproto_yvl_vlendpt4_len,
131160cb957SDavid Howells 	afs_eproto_yvl_vlendpt6_len,
132160cb957SDavid Howells 	afs_eproto_yvl_vlendpt_type,
133160cb957SDavid Howells };
134160cb957SDavid Howells 
135f51375cdSDavid Howells enum afs_io_error {
136f51375cdSDavid Howells 	afs_io_error_cm_reply,
137f51375cdSDavid Howells 	afs_io_error_extract,
138f51375cdSDavid Howells 	afs_io_error_fs_probe_fail,
139f51375cdSDavid Howells 	afs_io_error_vl_lookup_fail,
140f51375cdSDavid Howells };
141f51375cdSDavid Howells 
142f51375cdSDavid Howells enum afs_file_error {
143f51375cdSDavid Howells 	afs_file_error_dir_bad_magic,
144f51375cdSDavid Howells 	afs_file_error_dir_big,
145f51375cdSDavid Howells 	afs_file_error_dir_missing_page,
146f51375cdSDavid Howells 	afs_file_error_dir_over_end,
147f51375cdSDavid Howells 	afs_file_error_dir_small,
148f51375cdSDavid Howells 	afs_file_error_dir_unmarked_ext,
149f51375cdSDavid Howells 	afs_file_error_mntpt,
150f51375cdSDavid Howells 	afs_file_error_writeback_fail,
151f51375cdSDavid Howells };
152f51375cdSDavid Howells 
153341f741fSDavid Howells #endif /* end __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY */
154341f741fSDavid Howells 
155341f741fSDavid Howells /*
156341f741fSDavid Howells  * Declare tracing information enums and their string mappings for display.
157341f741fSDavid Howells  */
158341f741fSDavid Howells #define afs_call_traces \
159341f741fSDavid Howells 	EM(afs_call_trace_alloc,		"ALLOC") \
160341f741fSDavid Howells 	EM(afs_call_trace_free,			"FREE ") \
161341f741fSDavid Howells 	EM(afs_call_trace_put,			"PUT  ") \
162341f741fSDavid Howells 	EM(afs_call_trace_wake,			"WAKE ") \
163341f741fSDavid Howells 	E_(afs_call_trace_work,			"WORK ")
164341f741fSDavid Howells 
165025db80cSDavid Howells #define afs_fs_operations \
166025db80cSDavid Howells 	EM(afs_FS_FetchData,			"FS.FetchData") \
167025db80cSDavid Howells 	EM(afs_FS_FetchStatus,			"FS.FetchStatus") \
168025db80cSDavid Howells 	EM(afs_FS_StoreData,			"FS.StoreData") \
169025db80cSDavid Howells 	EM(afs_FS_StoreStatus,			"FS.StoreStatus") \
170025db80cSDavid Howells 	EM(afs_FS_RemoveFile,			"FS.RemoveFile") \
171025db80cSDavid Howells 	EM(afs_FS_CreateFile,			"FS.CreateFile") \
172025db80cSDavid Howells 	EM(afs_FS_Rename,			"FS.Rename") \
173025db80cSDavid Howells 	EM(afs_FS_Symlink,			"FS.Symlink") \
174025db80cSDavid Howells 	EM(afs_FS_Link,				"FS.Link") \
175025db80cSDavid Howells 	EM(afs_FS_MakeDir,			"FS.MakeDir") \
176025db80cSDavid Howells 	EM(afs_FS_RemoveDir,			"FS.RemoveDir") \
177025db80cSDavid Howells 	EM(afs_FS_GetVolumeInfo,		"FS.GetVolumeInfo") \
178025db80cSDavid Howells 	EM(afs_FS_GetVolumeStatus,		"FS.GetVolumeStatus") \
179025db80cSDavid Howells 	EM(afs_FS_GetRootVolume,		"FS.GetRootVolume") \
180025db80cSDavid Howells 	EM(afs_FS_SetLock,			"FS.SetLock") \
181025db80cSDavid Howells 	EM(afs_FS_ExtendLock,			"FS.ExtendLock") \
182025db80cSDavid Howells 	EM(afs_FS_ReleaseLock,			"FS.ReleaseLock") \
183025db80cSDavid Howells 	EM(afs_FS_Lookup,			"FS.Lookup") \
1845cf9dd55SDavid Howells 	EM(afs_FS_InlineBulkStatus,		"FS.InlineBulkStatus") \
185025db80cSDavid Howells 	EM(afs_FS_FetchData64,			"FS.FetchData64") \
186025db80cSDavid Howells 	EM(afs_FS_StoreData64,			"FS.StoreData64") \
187025db80cSDavid Howells 	EM(afs_FS_GiveUpAllCallBacks,		"FS.GiveUpAllCallBacks") \
188*30062bd1SDavid Howells 	EM(afs_FS_GetCapabilities,		"FS.GetCapabilities") \
189*30062bd1SDavid Howells 	EM(yfs_FS_FetchACL,			"YFS.FetchACL") \
190*30062bd1SDavid Howells 	EM(yfs_FS_FetchStatus,			"YFS.FetchStatus") \
191*30062bd1SDavid Howells 	EM(yfs_FS_StoreACL,			"YFS.StoreACL") \
192*30062bd1SDavid Howells 	EM(yfs_FS_StoreStatus,			"YFS.StoreStatus") \
193*30062bd1SDavid Howells 	EM(yfs_FS_RemoveFile,			"YFS.RemoveFile") \
194*30062bd1SDavid Howells 	EM(yfs_FS_CreateFile,			"YFS.CreateFile") \
195*30062bd1SDavid Howells 	EM(yfs_FS_Rename,			"YFS.Rename") \
196*30062bd1SDavid Howells 	EM(yfs_FS_Symlink,			"YFS.Symlink") \
197*30062bd1SDavid Howells 	EM(yfs_FS_Link,				"YFS.Link") \
198*30062bd1SDavid Howells 	EM(yfs_FS_MakeDir,			"YFS.MakeDir") \
199*30062bd1SDavid Howells 	EM(yfs_FS_RemoveDir,			"YFS.RemoveDir") \
200*30062bd1SDavid Howells 	EM(yfs_FS_GetVolumeStatus,		"YFS.GetVolumeStatus") \
201*30062bd1SDavid Howells 	EM(yfs_FS_SetVolumeStatus,		"YFS.SetVolumeStatus") \
202*30062bd1SDavid Howells 	EM(yfs_FS_SetLock,			"YFS.SetLock") \
203*30062bd1SDavid Howells 	EM(yfs_FS_ExtendLock,			"YFS.ExtendLock") \
204*30062bd1SDavid Howells 	EM(yfs_FS_ReleaseLock,			"YFS.ReleaseLock") \
205*30062bd1SDavid Howells 	EM(yfs_FS_Lookup,			"YFS.Lookup") \
206*30062bd1SDavid Howells 	EM(yfs_FS_FlushCPS,			"YFS.FlushCPS") \
207*30062bd1SDavid Howells 	EM(yfs_FS_FetchOpaqueACL,		"YFS.FetchOpaqueACL") \
208*30062bd1SDavid Howells 	EM(yfs_FS_WhoAmI,			"YFS.WhoAmI") \
209*30062bd1SDavid Howells 	EM(yfs_FS_RemoveACL,			"YFS.RemoveACL") \
210*30062bd1SDavid Howells 	EM(yfs_FS_RemoveFile2,			"YFS.RemoveFile2") \
211*30062bd1SDavid Howells 	EM(yfs_FS_StoreOpaqueACL2,		"YFS.StoreOpaqueACL2") \
212*30062bd1SDavid Howells 	EM(yfs_FS_InlineBulkStatus,		"YFS.InlineBulkStatus") \
213*30062bd1SDavid Howells 	EM(yfs_FS_FetchData64,			"YFS.FetchData64") \
214*30062bd1SDavid Howells 	EM(yfs_FS_StoreData64,			"YFS.StoreData64") \
215*30062bd1SDavid Howells 	E_(yfs_FS_UpdateSymlink,		"YFS.UpdateSymlink")
216025db80cSDavid Howells 
217025db80cSDavid Howells #define afs_vl_operations \
218025db80cSDavid Howells 	EM(afs_VL_GetEntryByNameU,		"VL.GetEntryByNameU") \
219025db80cSDavid Howells 	EM(afs_VL_GetAddrsU,			"VL.GetAddrsU") \
220025db80cSDavid Howells 	EM(afs_YFSVL_GetEndpoints,		"YFSVL.GetEndpoints") \
221025db80cSDavid Howells 	E_(afs_VL_GetCapabilities,		"VL.GetCapabilities")
222025db80cSDavid Howells 
22363a4681fSDavid Howells #define afs_edit_dir_ops				  \
22463a4681fSDavid Howells 	EM(afs_edit_dir_create,			"create") \
22563a4681fSDavid Howells 	EM(afs_edit_dir_create_error,		"c_fail") \
22663a4681fSDavid Howells 	EM(afs_edit_dir_create_inval,		"c_invl") \
22763a4681fSDavid Howells 	EM(afs_edit_dir_create_nospc,		"c_nspc") \
22863a4681fSDavid Howells 	EM(afs_edit_dir_delete,			"delete") \
22963a4681fSDavid Howells 	EM(afs_edit_dir_delete_error,		"d_err ") \
23063a4681fSDavid Howells 	EM(afs_edit_dir_delete_inval,		"d_invl") \
23163a4681fSDavid Howells 	E_(afs_edit_dir_delete_noent,		"d_nent")
23263a4681fSDavid Howells 
23363a4681fSDavid Howells #define afs_edit_dir_reasons				  \
23463a4681fSDavid Howells 	EM(afs_edit_dir_for_create,		"Create") \
23563a4681fSDavid Howells 	EM(afs_edit_dir_for_link,		"Link  ") \
23663a4681fSDavid Howells 	EM(afs_edit_dir_for_mkdir,		"MkDir ") \
23763a4681fSDavid Howells 	EM(afs_edit_dir_for_rename,		"Rename") \
23863a4681fSDavid Howells 	EM(afs_edit_dir_for_rmdir,		"RmDir ") \
23963a4681fSDavid Howells 	EM(afs_edit_dir_for_symlink,		"Symlnk") \
24063a4681fSDavid Howells 	E_(afs_edit_dir_for_unlink,		"Unlink")
24163a4681fSDavid Howells 
242160cb957SDavid Howells #define afs_eproto_causes			\
243160cb957SDavid Howells 	EM(afs_eproto_bad_status,	"BadStatus") \
244160cb957SDavid Howells 	EM(afs_eproto_cb_count,		"CbCount") \
245160cb957SDavid Howells 	EM(afs_eproto_cb_fid_count,	"CbFidCount") \
246160cb957SDavid Howells 	EM(afs_eproto_file_type,	"FileTYpe") \
247160cb957SDavid Howells 	EM(afs_eproto_ibulkst_cb_count,	"IBS.CbCount") \
248160cb957SDavid Howells 	EM(afs_eproto_ibulkst_count,	"IBS.FidCount") \
249160cb957SDavid Howells 	EM(afs_eproto_motd_len,		"MotdLen") \
250160cb957SDavid Howells 	EM(afs_eproto_offline_msg_len,	"OfflineMsgLen") \
251160cb957SDavid Howells 	EM(afs_eproto_volname_len,	"VolNameLen") \
252160cb957SDavid Howells 	EM(afs_eproto_yvl_fsendpt4_len,	"YVL.FsEnd4Len") \
253160cb957SDavid Howells 	EM(afs_eproto_yvl_fsendpt6_len,	"YVL.FsEnd6Len") \
254160cb957SDavid Howells 	EM(afs_eproto_yvl_fsendpt_num,	"YVL.FsEndCount") \
255160cb957SDavid Howells 	EM(afs_eproto_yvl_fsendpt_type,	"YVL.FsEndType") \
256160cb957SDavid Howells 	EM(afs_eproto_yvl_vlendpt4_len,	"YVL.VlEnd4Len") \
257160cb957SDavid Howells 	EM(afs_eproto_yvl_vlendpt6_len,	"YVL.VlEnd6Len") \
258160cb957SDavid Howells 	E_(afs_eproto_yvl_vlendpt_type,	"YVL.VlEndType")
259160cb957SDavid Howells 
260f51375cdSDavid Howells #define afs_io_errors							\
261f51375cdSDavid Howells 	EM(afs_io_error_cm_reply,		"CM_REPLY")		\
262f51375cdSDavid Howells 	EM(afs_io_error_extract,		"EXTRACT")		\
263f51375cdSDavid Howells 	EM(afs_io_error_fs_probe_fail,		"FS_PROBE_FAIL")	\
264f51375cdSDavid Howells 	E_(afs_io_error_vl_lookup_fail,		"VL_LOOKUP_FAIL")
265f51375cdSDavid Howells 
266f51375cdSDavid Howells #define afs_file_errors							\
267f51375cdSDavid Howells 	EM(afs_file_error_dir_bad_magic,	"DIR_BAD_MAGIC")	\
268f51375cdSDavid Howells 	EM(afs_file_error_dir_big,		"DIR_BIG")		\
269f51375cdSDavid Howells 	EM(afs_file_error_dir_missing_page,	"DIR_MISSING_PAGE")	\
270f51375cdSDavid Howells 	EM(afs_file_error_dir_over_end,		"DIR_ENT_OVER_END")	\
271f51375cdSDavid Howells 	EM(afs_file_error_dir_small,		"DIR_SMALL")		\
272f51375cdSDavid Howells 	EM(afs_file_error_dir_unmarked_ext,	"DIR_UNMARKED_EXT")	\
273f51375cdSDavid Howells 	EM(afs_file_error_mntpt,		"MNTPT_READ_FAILED")	\
274f51375cdSDavid Howells 	E_(afs_file_error_writeback_fail,	"WRITEBACK_FAILED")
275025db80cSDavid Howells 
276341f741fSDavid Howells /*
277341f741fSDavid Howells  * Export enum symbols via userspace.
278341f741fSDavid Howells  */
279341f741fSDavid Howells #undef EM
280341f741fSDavid Howells #undef E_
281341f741fSDavid Howells #define EM(a, b) TRACE_DEFINE_ENUM(a);
282341f741fSDavid Howells #define E_(a, b) TRACE_DEFINE_ENUM(a);
283341f741fSDavid Howells 
284341f741fSDavid Howells afs_call_traces;
285025db80cSDavid Howells afs_fs_operations;
286025db80cSDavid Howells afs_vl_operations;
28763a4681fSDavid Howells afs_edit_dir_ops;
28863a4681fSDavid Howells afs_edit_dir_reasons;
289f51375cdSDavid Howells afs_eproto_causes;
290f51375cdSDavid Howells afs_io_errors;
291f51375cdSDavid Howells afs_file_errors;
292341f741fSDavid Howells 
293341f741fSDavid Howells /*
294341f741fSDavid Howells  * Now redefine the EM() and E_() macros to map the enums to the strings that
295341f741fSDavid Howells  * will be printed in the output.
296341f741fSDavid Howells  */
297341f741fSDavid Howells #undef EM
298341f741fSDavid Howells #undef E_
299341f741fSDavid Howells #define EM(a, b)	{ a, b },
300341f741fSDavid Howells #define E_(a, b)	{ a, b }
301341f741fSDavid Howells 
30212bdcf33SDavid Howells TRACE_EVENT(afs_receive_data,
30312bdcf33SDavid Howells 	    TP_PROTO(struct afs_call *call, struct iov_iter *iter,
3048e8d7f13SDavid Howells 		     bool want_more, int ret),
3058e8d7f13SDavid Howells 
30612bdcf33SDavid Howells 	    TP_ARGS(call, iter, want_more, ret),
3078e8d7f13SDavid Howells 
3088e8d7f13SDavid Howells 	    TP_STRUCT__entry(
30912bdcf33SDavid Howells 		    __field(loff_t,			remain		)
310a25e21f0SDavid Howells 		    __field(unsigned int,		call		)
3118e8d7f13SDavid Howells 		    __field(enum afs_call_state,	state		)
3128e8d7f13SDavid Howells 		    __field(unsigned short,		unmarshall	)
3138e8d7f13SDavid Howells 		    __field(bool,			want_more	)
3148e8d7f13SDavid Howells 		    __field(int,			ret		)
3158e8d7f13SDavid Howells 			     ),
3168e8d7f13SDavid Howells 
3178e8d7f13SDavid Howells 	    TP_fast_assign(
318a25e21f0SDavid Howells 		    __entry->call	= call->debug_id;
3198e8d7f13SDavid Howells 		    __entry->state	= call->state;
3208e8d7f13SDavid Howells 		    __entry->unmarshall	= call->unmarshall;
32112bdcf33SDavid Howells 		    __entry->remain	= iov_iter_count(iter);
3228e8d7f13SDavid Howells 		    __entry->want_more	= want_more;
3238e8d7f13SDavid Howells 		    __entry->ret	= ret;
3248e8d7f13SDavid Howells 			   ),
3258e8d7f13SDavid Howells 
32612bdcf33SDavid Howells 	    TP_printk("c=%08x r=%llu u=%u w=%u s=%u ret=%d",
3278e8d7f13SDavid Howells 		      __entry->call,
32812bdcf33SDavid Howells 		      __entry->remain,
32912bdcf33SDavid Howells 		      __entry->unmarshall,
33012bdcf33SDavid Howells 		      __entry->want_more,
33112bdcf33SDavid Howells 		      __entry->state,
33212bdcf33SDavid Howells 		      __entry->ret)
3338e8d7f13SDavid Howells 	    );
3348e8d7f13SDavid Howells 
3358e8d7f13SDavid Howells TRACE_EVENT(afs_notify_call,
3368e8d7f13SDavid Howells 	    TP_PROTO(struct rxrpc_call *rxcall, struct afs_call *call),
3378e8d7f13SDavid Howells 
3388e8d7f13SDavid Howells 	    TP_ARGS(rxcall, call),
3398e8d7f13SDavid Howells 
3408e8d7f13SDavid Howells 	    TP_STRUCT__entry(
341a25e21f0SDavid Howells 		    __field(unsigned int,		call		)
3428e8d7f13SDavid Howells 		    __field(enum afs_call_state,	state		)
3438e8d7f13SDavid Howells 		    __field(unsigned short,		unmarshall	)
3448e8d7f13SDavid Howells 			     ),
3458e8d7f13SDavid Howells 
3468e8d7f13SDavid Howells 	    TP_fast_assign(
347a25e21f0SDavid Howells 		    __entry->call	= call->debug_id;
3488e8d7f13SDavid Howells 		    __entry->state	= call->state;
3498e8d7f13SDavid Howells 		    __entry->unmarshall	= call->unmarshall;
3508e8d7f13SDavid Howells 			   ),
3518e8d7f13SDavid Howells 
352a25e21f0SDavid Howells 	    TP_printk("c=%08x s=%u u=%u",
3538e8d7f13SDavid Howells 		      __entry->call,
3548e8d7f13SDavid Howells 		      __entry->state, __entry->unmarshall)
3558e8d7f13SDavid Howells 	    );
3568e8d7f13SDavid Howells 
3578e8d7f13SDavid Howells TRACE_EVENT(afs_cb_call,
3588e8d7f13SDavid Howells 	    TP_PROTO(struct afs_call *call),
3598e8d7f13SDavid Howells 
3608e8d7f13SDavid Howells 	    TP_ARGS(call),
3618e8d7f13SDavid Howells 
3628e8d7f13SDavid Howells 	    TP_STRUCT__entry(
363a25e21f0SDavid Howells 		    __field(unsigned int,		call		)
3648e8d7f13SDavid Howells 		    __field(const char *,		name		)
3658e8d7f13SDavid Howells 		    __field(u32,			op		)
3668e8d7f13SDavid Howells 			     ),
3678e8d7f13SDavid Howells 
3688e8d7f13SDavid Howells 	    TP_fast_assign(
369a25e21f0SDavid Howells 		    __entry->call	= call->debug_id;
3708e8d7f13SDavid Howells 		    __entry->name	= call->type->name;
3718e8d7f13SDavid Howells 		    __entry->op		= call->operation_ID;
3728e8d7f13SDavid Howells 			   ),
3738e8d7f13SDavid Howells 
374a25e21f0SDavid Howells 	    TP_printk("c=%08x %s o=%u",
3758e8d7f13SDavid Howells 		      __entry->call,
3768e8d7f13SDavid Howells 		      __entry->name,
3778e8d7f13SDavid Howells 		      __entry->op)
3788e8d7f13SDavid Howells 	    );
3798e8d7f13SDavid Howells 
380341f741fSDavid Howells TRACE_EVENT(afs_call,
381341f741fSDavid Howells 	    TP_PROTO(struct afs_call *call, enum afs_call_trace op,
382341f741fSDavid Howells 		     int usage, int outstanding, const void *where),
383341f741fSDavid Howells 
384341f741fSDavid Howells 	    TP_ARGS(call, op, usage, outstanding, where),
385341f741fSDavid Howells 
386341f741fSDavid Howells 	    TP_STRUCT__entry(
387a25e21f0SDavid Howells 		    __field(unsigned int,		call		)
388341f741fSDavid Howells 		    __field(int,			op		)
389341f741fSDavid Howells 		    __field(int,			usage		)
390341f741fSDavid Howells 		    __field(int,			outstanding	)
391341f741fSDavid Howells 		    __field(const void *,		where		)
392341f741fSDavid Howells 			     ),
393341f741fSDavid Howells 
394341f741fSDavid Howells 	    TP_fast_assign(
395a25e21f0SDavid Howells 		    __entry->call = call->debug_id;
396341f741fSDavid Howells 		    __entry->op = op;
397341f741fSDavid Howells 		    __entry->usage = usage;
398341f741fSDavid Howells 		    __entry->outstanding = outstanding;
399341f741fSDavid Howells 		    __entry->where = where;
400341f741fSDavid Howells 			   ),
401341f741fSDavid Howells 
402a25e21f0SDavid Howells 	    TP_printk("c=%08x %s u=%d o=%d sp=%pSR",
403341f741fSDavid Howells 		      __entry->call,
404341f741fSDavid Howells 		      __print_symbolic(__entry->op, afs_call_traces),
405341f741fSDavid Howells 		      __entry->usage,
406341f741fSDavid Howells 		      __entry->outstanding,
407341f741fSDavid Howells 		      __entry->where)
408341f741fSDavid Howells 	    );
409341f741fSDavid Howells 
410025db80cSDavid Howells TRACE_EVENT(afs_make_fs_call,
411025db80cSDavid Howells 	    TP_PROTO(struct afs_call *call, const struct afs_fid *fid),
412025db80cSDavid Howells 
413025db80cSDavid Howells 	    TP_ARGS(call, fid),
414025db80cSDavid Howells 
415025db80cSDavid Howells 	    TP_STRUCT__entry(
416a25e21f0SDavid Howells 		    __field(unsigned int,		call		)
417025db80cSDavid Howells 		    __field(enum afs_fs_operation,	op		)
418025db80cSDavid Howells 		    __field_struct(struct afs_fid,	fid		)
419025db80cSDavid Howells 			     ),
420025db80cSDavid Howells 
421025db80cSDavid Howells 	    TP_fast_assign(
422a25e21f0SDavid Howells 		    __entry->call = call->debug_id;
423025db80cSDavid Howells 		    __entry->op = call->operation_ID;
424025db80cSDavid Howells 		    if (fid) {
425025db80cSDavid Howells 			    __entry->fid = *fid;
426025db80cSDavid Howells 		    } else {
427025db80cSDavid Howells 			    __entry->fid.vid = 0;
428025db80cSDavid Howells 			    __entry->fid.vnode = 0;
429025db80cSDavid Howells 			    __entry->fid.unique = 0;
430025db80cSDavid Howells 		    }
431025db80cSDavid Howells 			   ),
432025db80cSDavid Howells 
4333b6492dfSDavid Howells 	    TP_printk("c=%08x %06llx:%06llx:%06x %s",
434025db80cSDavid Howells 		      __entry->call,
435025db80cSDavid Howells 		      __entry->fid.vid,
436025db80cSDavid Howells 		      __entry->fid.vnode,
437025db80cSDavid Howells 		      __entry->fid.unique,
438025db80cSDavid Howells 		      __print_symbolic(__entry->op, afs_fs_operations))
439025db80cSDavid Howells 	    );
440025db80cSDavid Howells 
441025db80cSDavid Howells TRACE_EVENT(afs_make_vl_call,
442025db80cSDavid Howells 	    TP_PROTO(struct afs_call *call),
443025db80cSDavid Howells 
444025db80cSDavid Howells 	    TP_ARGS(call),
445025db80cSDavid Howells 
446025db80cSDavid Howells 	    TP_STRUCT__entry(
447a25e21f0SDavid Howells 		    __field(unsigned int,		call		)
448025db80cSDavid Howells 		    __field(enum afs_vl_operation,	op		)
449025db80cSDavid Howells 			     ),
450025db80cSDavid Howells 
451025db80cSDavid Howells 	    TP_fast_assign(
452a25e21f0SDavid Howells 		    __entry->call = call->debug_id;
453025db80cSDavid Howells 		    __entry->op = call->operation_ID;
454025db80cSDavid Howells 			   ),
455025db80cSDavid Howells 
456a25e21f0SDavid Howells 	    TP_printk("c=%08x %s",
457025db80cSDavid Howells 		      __entry->call,
458025db80cSDavid Howells 		      __print_symbolic(__entry->op, afs_vl_operations))
459025db80cSDavid Howells 	    );
460025db80cSDavid Howells 
461025db80cSDavid Howells TRACE_EVENT(afs_call_done,
462025db80cSDavid Howells 	    TP_PROTO(struct afs_call *call),
463025db80cSDavid Howells 
464025db80cSDavid Howells 	    TP_ARGS(call),
465025db80cSDavid Howells 
466025db80cSDavid Howells 	    TP_STRUCT__entry(
467a25e21f0SDavid Howells 		    __field(unsigned int,		call		)
468025db80cSDavid Howells 		    __field(struct rxrpc_call *,	rx_call		)
469025db80cSDavid Howells 		    __field(int,			ret		)
470025db80cSDavid Howells 		    __field(u32,			abort_code	)
471025db80cSDavid Howells 			     ),
472025db80cSDavid Howells 
473025db80cSDavid Howells 	    TP_fast_assign(
474a25e21f0SDavid Howells 		    __entry->call = call->debug_id;
475025db80cSDavid Howells 		    __entry->rx_call = call->rxcall;
476025db80cSDavid Howells 		    __entry->ret = call->error;
477025db80cSDavid Howells 		    __entry->abort_code = call->abort_code;
478025db80cSDavid Howells 			   ),
479025db80cSDavid Howells 
480a25e21f0SDavid Howells 	    TP_printk("   c=%08x ret=%d ab=%d [%p]",
481025db80cSDavid Howells 		      __entry->call,
482025db80cSDavid Howells 		      __entry->ret,
483025db80cSDavid Howells 		      __entry->abort_code,
484025db80cSDavid Howells 		      __entry->rx_call)
485025db80cSDavid Howells 	    );
486025db80cSDavid Howells 
4872c099014SDavid Howells TRACE_EVENT(afs_send_pages,
4882c099014SDavid Howells 	    TP_PROTO(struct afs_call *call, struct msghdr *msg,
4892c099014SDavid Howells 		     pgoff_t first, pgoff_t last, unsigned int offset),
4902c099014SDavid Howells 
4912c099014SDavid Howells 	    TP_ARGS(call, msg, first, last, offset),
4922c099014SDavid Howells 
4932c099014SDavid Howells 	    TP_STRUCT__entry(
494a25e21f0SDavid Howells 		    __field(unsigned int,		call		)
4952c099014SDavid Howells 		    __field(pgoff_t,			first		)
4962c099014SDavid Howells 		    __field(pgoff_t,			last		)
4972c099014SDavid Howells 		    __field(unsigned int,		nr		)
4982c099014SDavid Howells 		    __field(unsigned int,		bytes		)
4992c099014SDavid Howells 		    __field(unsigned int,		offset		)
5002c099014SDavid Howells 		    __field(unsigned int,		flags		)
5012c099014SDavid Howells 			     ),
5022c099014SDavid Howells 
5032c099014SDavid Howells 	    TP_fast_assign(
504a25e21f0SDavid Howells 		    __entry->call = call->debug_id;
5052c099014SDavid Howells 		    __entry->first = first;
5062c099014SDavid Howells 		    __entry->last = last;
5072c099014SDavid Howells 		    __entry->nr = msg->msg_iter.nr_segs;
5082c099014SDavid Howells 		    __entry->bytes = msg->msg_iter.count;
5092c099014SDavid Howells 		    __entry->offset = offset;
5102c099014SDavid Howells 		    __entry->flags = msg->msg_flags;
5112c099014SDavid Howells 			   ),
5122c099014SDavid Howells 
513a25e21f0SDavid Howells 	    TP_printk(" c=%08x %lx-%lx-%lx b=%x o=%x f=%x",
5142c099014SDavid Howells 		      __entry->call,
5152c099014SDavid Howells 		      __entry->first, __entry->first + __entry->nr - 1, __entry->last,
5162c099014SDavid Howells 		      __entry->bytes, __entry->offset,
5172c099014SDavid Howells 		      __entry->flags)
5182c099014SDavid Howells 	    );
5192c099014SDavid Howells 
5202c099014SDavid Howells TRACE_EVENT(afs_sent_pages,
5212c099014SDavid Howells 	    TP_PROTO(struct afs_call *call, pgoff_t first, pgoff_t last,
5222c099014SDavid Howells 		     pgoff_t cursor, int ret),
5232c099014SDavid Howells 
5242c099014SDavid Howells 	    TP_ARGS(call, first, last, cursor, ret),
5252c099014SDavid Howells 
5262c099014SDavid Howells 	    TP_STRUCT__entry(
527a25e21f0SDavid Howells 		    __field(unsigned int,		call		)
5282c099014SDavid Howells 		    __field(pgoff_t,			first		)
5292c099014SDavid Howells 		    __field(pgoff_t,			last		)
5302c099014SDavid Howells 		    __field(pgoff_t,			cursor		)
5312c099014SDavid Howells 		    __field(int,			ret		)
5322c099014SDavid Howells 			     ),
5332c099014SDavid Howells 
5342c099014SDavid Howells 	    TP_fast_assign(
535a25e21f0SDavid Howells 		    __entry->call = call->debug_id;
5362c099014SDavid Howells 		    __entry->first = first;
5372c099014SDavid Howells 		    __entry->last = last;
5382c099014SDavid Howells 		    __entry->cursor = cursor;
5392c099014SDavid Howells 		    __entry->ret = ret;
5402c099014SDavid Howells 			   ),
5412c099014SDavid Howells 
542a25e21f0SDavid Howells 	    TP_printk(" c=%08x %lx-%lx c=%lx r=%d",
5432c099014SDavid Howells 		      __entry->call,
5442c099014SDavid Howells 		      __entry->first, __entry->last,
5452c099014SDavid Howells 		      __entry->cursor, __entry->ret)
5462c099014SDavid Howells 	    );
5472c099014SDavid Howells 
548dab17c1aSDavid Howells TRACE_EVENT(afs_dir_check_failed,
549dab17c1aSDavid Howells 	    TP_PROTO(struct afs_vnode *vnode, loff_t off, loff_t i_size),
550dab17c1aSDavid Howells 
551dab17c1aSDavid Howells 	    TP_ARGS(vnode, off, i_size),
552dab17c1aSDavid Howells 
553dab17c1aSDavid Howells 	    TP_STRUCT__entry(
554dab17c1aSDavid Howells 		    __field(struct afs_vnode *,		vnode		)
555dab17c1aSDavid Howells 		    __field(loff_t,			off		)
556dab17c1aSDavid Howells 		    __field(loff_t,			i_size		)
557dab17c1aSDavid Howells 			     ),
558dab17c1aSDavid Howells 
559dab17c1aSDavid Howells 	    TP_fast_assign(
560dab17c1aSDavid Howells 		    __entry->vnode = vnode;
561dab17c1aSDavid Howells 		    __entry->off = off;
562dab17c1aSDavid Howells 		    __entry->i_size = i_size;
563dab17c1aSDavid Howells 			   ),
564dab17c1aSDavid Howells 
565dab17c1aSDavid Howells 	    TP_printk("vn=%p %llx/%llx",
566dab17c1aSDavid Howells 		      __entry->vnode, __entry->off, __entry->i_size)
567dab17c1aSDavid Howells 	    );
568dab17c1aSDavid Howells 
56913524ab3SDavid Howells /*
57013524ab3SDavid Howells  * We use page->private to hold the amount of the page that we've written to,
57113524ab3SDavid Howells  * splitting the field into two parts.  However, we need to represent a range
57213524ab3SDavid Howells  * 0...PAGE_SIZE inclusive, so we can't support 64K pages on a 32-bit system.
57313524ab3SDavid Howells  */
57413524ab3SDavid Howells #if PAGE_SIZE > 32768
57513524ab3SDavid Howells #define AFS_PRIV_MAX	0xffffffff
57613524ab3SDavid Howells #define AFS_PRIV_SHIFT	32
57713524ab3SDavid Howells #else
57813524ab3SDavid Howells #define AFS_PRIV_MAX	0xffff
57913524ab3SDavid Howells #define AFS_PRIV_SHIFT	16
58013524ab3SDavid Howells #endif
58113524ab3SDavid Howells 
58213524ab3SDavid Howells TRACE_EVENT(afs_page_dirty,
58313524ab3SDavid Howells 	    TP_PROTO(struct afs_vnode *vnode, const char *where,
58413524ab3SDavid Howells 		     pgoff_t page, unsigned long priv),
58513524ab3SDavid Howells 
58613524ab3SDavid Howells 	    TP_ARGS(vnode, where, page, priv),
58713524ab3SDavid Howells 
58813524ab3SDavid Howells 	    TP_STRUCT__entry(
58913524ab3SDavid Howells 		    __field(struct afs_vnode *,		vnode		)
59013524ab3SDavid Howells 		    __field(const char *,		where		)
59113524ab3SDavid Howells 		    __field(pgoff_t,			page		)
59213524ab3SDavid Howells 		    __field(unsigned long,		priv		)
59313524ab3SDavid Howells 			     ),
59413524ab3SDavid Howells 
59513524ab3SDavid Howells 	    TP_fast_assign(
59613524ab3SDavid Howells 		    __entry->vnode = vnode;
59713524ab3SDavid Howells 		    __entry->where = where;
59813524ab3SDavid Howells 		    __entry->page = page;
59913524ab3SDavid Howells 		    __entry->priv = priv;
60013524ab3SDavid Howells 			   ),
60113524ab3SDavid Howells 
60213524ab3SDavid Howells 	    TP_printk("vn=%p %lx %s %lu-%lu",
60313524ab3SDavid Howells 		      __entry->vnode, __entry->page, __entry->where,
60413524ab3SDavid Howells 		      __entry->priv & AFS_PRIV_MAX,
60513524ab3SDavid Howells 		      __entry->priv >> AFS_PRIV_SHIFT)
60613524ab3SDavid Howells 	    );
60713524ab3SDavid Howells 
60898bf40cdSDavid Howells TRACE_EVENT(afs_call_state,
60998bf40cdSDavid Howells 	    TP_PROTO(struct afs_call *call,
61098bf40cdSDavid Howells 		     enum afs_call_state from,
61198bf40cdSDavid Howells 		     enum afs_call_state to,
61298bf40cdSDavid Howells 		     int ret, u32 remote_abort),
61398bf40cdSDavid Howells 
61498bf40cdSDavid Howells 	    TP_ARGS(call, from, to, ret, remote_abort),
61598bf40cdSDavid Howells 
61698bf40cdSDavid Howells 	    TP_STRUCT__entry(
617a25e21f0SDavid Howells 		    __field(unsigned int,		call		)
61898bf40cdSDavid Howells 		    __field(enum afs_call_state,	from		)
61998bf40cdSDavid Howells 		    __field(enum afs_call_state,	to		)
62098bf40cdSDavid Howells 		    __field(int,			ret		)
62198bf40cdSDavid Howells 		    __field(u32,			abort		)
62298bf40cdSDavid Howells 			     ),
62398bf40cdSDavid Howells 
62498bf40cdSDavid Howells 	    TP_fast_assign(
625a25e21f0SDavid Howells 		    __entry->call = call->debug_id;
62698bf40cdSDavid Howells 		    __entry->from = from;
62798bf40cdSDavid Howells 		    __entry->to = to;
62898bf40cdSDavid Howells 		    __entry->ret = ret;
62998bf40cdSDavid Howells 		    __entry->abort = remote_abort;
63098bf40cdSDavid Howells 			   ),
63198bf40cdSDavid Howells 
632a25e21f0SDavid Howells 	    TP_printk("c=%08x %u->%u r=%d ab=%d",
63398bf40cdSDavid Howells 		      __entry->call,
63498bf40cdSDavid Howells 		      __entry->from, __entry->to,
63598bf40cdSDavid Howells 		      __entry->ret, __entry->abort)
63698bf40cdSDavid Howells 	    );
63798bf40cdSDavid Howells 
63863a4681fSDavid Howells TRACE_EVENT(afs_edit_dir,
63963a4681fSDavid Howells 	    TP_PROTO(struct afs_vnode *dvnode,
64063a4681fSDavid Howells 		     enum afs_edit_dir_reason why,
64163a4681fSDavid Howells 		     enum afs_edit_dir_op op,
64263a4681fSDavid Howells 		     unsigned int block,
64363a4681fSDavid Howells 		     unsigned int slot,
64463a4681fSDavid Howells 		     unsigned int f_vnode,
64563a4681fSDavid Howells 		     unsigned int f_unique,
64663a4681fSDavid Howells 		     const char *name),
64763a4681fSDavid Howells 
64863a4681fSDavid Howells 	    TP_ARGS(dvnode, why, op, block, slot, f_vnode, f_unique, name),
64963a4681fSDavid Howells 
65063a4681fSDavid Howells 	    TP_STRUCT__entry(
65163a4681fSDavid Howells 		    __field(unsigned int,		vnode		)
65263a4681fSDavid Howells 		    __field(unsigned int,		unique		)
65363a4681fSDavid Howells 		    __field(enum afs_edit_dir_reason,	why		)
65463a4681fSDavid Howells 		    __field(enum afs_edit_dir_op,	op		)
65563a4681fSDavid Howells 		    __field(unsigned int,		block		)
65663a4681fSDavid Howells 		    __field(unsigned short,		slot		)
65763a4681fSDavid Howells 		    __field(unsigned int,		f_vnode		)
65863a4681fSDavid Howells 		    __field(unsigned int,		f_unique	)
65963a4681fSDavid Howells 		    __array(char,			name, 18	)
66063a4681fSDavid Howells 			     ),
66163a4681fSDavid Howells 
66263a4681fSDavid Howells 	    TP_fast_assign(
66363a4681fSDavid Howells 		    int __len = strlen(name);
66463a4681fSDavid Howells 		    __len = min(__len, 17);
66563a4681fSDavid Howells 		    __entry->vnode	= dvnode->fid.vnode;
66663a4681fSDavid Howells 		    __entry->unique	= dvnode->fid.unique;
66763a4681fSDavid Howells 		    __entry->why	= why;
66863a4681fSDavid Howells 		    __entry->op		= op;
66963a4681fSDavid Howells 		    __entry->block	= block;
67063a4681fSDavid Howells 		    __entry->slot	= slot;
67163a4681fSDavid Howells 		    __entry->f_vnode	= f_vnode;
67263a4681fSDavid Howells 		    __entry->f_unique	= f_unique;
67363a4681fSDavid Howells 		    memcpy(__entry->name, name, __len);
67463a4681fSDavid Howells 		    __entry->name[__len] = 0;
67563a4681fSDavid Howells 			   ),
67663a4681fSDavid Howells 
67763a4681fSDavid Howells 	    TP_printk("d=%x:%x %s %s %u[%u] f=%x:%x %s",
67863a4681fSDavid Howells 		      __entry->vnode, __entry->unique,
67963a4681fSDavid Howells 		      __print_symbolic(__entry->why, afs_edit_dir_reasons),
68063a4681fSDavid Howells 		      __print_symbolic(__entry->op, afs_edit_dir_ops),
68163a4681fSDavid Howells 		      __entry->block, __entry->slot,
68263a4681fSDavid Howells 		      __entry->f_vnode, __entry->f_unique,
68363a4681fSDavid Howells 		      __entry->name)
68463a4681fSDavid Howells 	    );
68563a4681fSDavid Howells 
6865f702c8eSDavid Howells TRACE_EVENT(afs_protocol_error,
687160cb957SDavid Howells 	    TP_PROTO(struct afs_call *call, int error, enum afs_eproto_cause cause),
6885f702c8eSDavid Howells 
689160cb957SDavid Howells 	    TP_ARGS(call, error, cause),
6905f702c8eSDavid Howells 
6915f702c8eSDavid Howells 	    TP_STRUCT__entry(
6925f702c8eSDavid Howells 		    __field(unsigned int,		call		)
6935f702c8eSDavid Howells 		    __field(int,			error		)
694160cb957SDavid Howells 		    __field(enum afs_eproto_cause,	cause		)
6955f702c8eSDavid Howells 			     ),
6965f702c8eSDavid Howells 
6975f702c8eSDavid Howells 	    TP_fast_assign(
6985f702c8eSDavid Howells 		    __entry->call = call ? call->debug_id : 0;
6995f702c8eSDavid Howells 		    __entry->error = error;
700160cb957SDavid Howells 		    __entry->cause = cause;
7015f702c8eSDavid Howells 			   ),
7025f702c8eSDavid Howells 
703160cb957SDavid Howells 	    TP_printk("c=%08x r=%d %s",
704160cb957SDavid Howells 		      __entry->call, __entry->error,
705160cb957SDavid Howells 		      __print_symbolic(__entry->cause, afs_eproto_causes))
7065f702c8eSDavid Howells 	    );
7075f702c8eSDavid Howells 
708f51375cdSDavid Howells TRACE_EVENT(afs_io_error,
709f51375cdSDavid Howells 	    TP_PROTO(unsigned int call, int error, enum afs_io_error where),
710f51375cdSDavid Howells 
711f51375cdSDavid Howells 	    TP_ARGS(call, error, where),
712f51375cdSDavid Howells 
713f51375cdSDavid Howells 	    TP_STRUCT__entry(
714f51375cdSDavid Howells 		    __field(unsigned int,	call		)
715f51375cdSDavid Howells 		    __field(int,		error		)
716f51375cdSDavid Howells 		    __field(enum afs_io_error,	where		)
717f51375cdSDavid Howells 			     ),
718f51375cdSDavid Howells 
719f51375cdSDavid Howells 	    TP_fast_assign(
720f51375cdSDavid Howells 		    __entry->call = call;
721f51375cdSDavid Howells 		    __entry->error = error;
722f51375cdSDavid Howells 		    __entry->where = where;
723f51375cdSDavid Howells 			   ),
724f51375cdSDavid Howells 
725f51375cdSDavid Howells 	    TP_printk("c=%08x r=%d %s",
726f51375cdSDavid Howells 		      __entry->call, __entry->error,
727f51375cdSDavid Howells 		      __print_symbolic(__entry->where, afs_io_errors))
728f51375cdSDavid Howells 	    );
729f51375cdSDavid Howells 
730f51375cdSDavid Howells TRACE_EVENT(afs_file_error,
731f51375cdSDavid Howells 	    TP_PROTO(struct afs_vnode *vnode, int error, enum afs_file_error where),
732f51375cdSDavid Howells 
733f51375cdSDavid Howells 	    TP_ARGS(vnode, error, where),
734f51375cdSDavid Howells 
735f51375cdSDavid Howells 	    TP_STRUCT__entry(
736f51375cdSDavid Howells 		    __field_struct(struct afs_fid,	fid		)
737f51375cdSDavid Howells 		    __field(int,			error		)
738f51375cdSDavid Howells 		    __field(enum afs_file_error,	where		)
739f51375cdSDavid Howells 			     ),
740f51375cdSDavid Howells 
741f51375cdSDavid Howells 	    TP_fast_assign(
742f51375cdSDavid Howells 		    __entry->fid = vnode->fid;
743f51375cdSDavid Howells 		    __entry->error = error;
744f51375cdSDavid Howells 		    __entry->where = where;
745f51375cdSDavid Howells 			   ),
746f51375cdSDavid Howells 
7473b6492dfSDavid Howells 	    TP_printk("%llx:%llx:%x r=%d %s",
748f51375cdSDavid Howells 		      __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
749f51375cdSDavid Howells 		      __entry->error,
750f51375cdSDavid Howells 		      __print_symbolic(__entry->where, afs_file_errors))
751f51375cdSDavid Howells 	    );
752f51375cdSDavid Howells 
7533709a399SDavid Howells TRACE_EVENT(afs_cm_no_server,
7543709a399SDavid Howells 	    TP_PROTO(struct afs_call *call, struct sockaddr_rxrpc *srx),
7553709a399SDavid Howells 
7563709a399SDavid Howells 	    TP_ARGS(call, srx),
7573709a399SDavid Howells 
7583709a399SDavid Howells 	    TP_STRUCT__entry(
7593709a399SDavid Howells 		    __field(unsigned int,			call	)
7603709a399SDavid Howells 		    __field(unsigned int,			op_id	)
7613709a399SDavid Howells 		    __field_struct(struct sockaddr_rxrpc,	srx	)
7623709a399SDavid Howells 			     ),
7633709a399SDavid Howells 
7643709a399SDavid Howells 	    TP_fast_assign(
7653709a399SDavid Howells 		    __entry->call = call->debug_id;
7663709a399SDavid Howells 		    __entry->op_id = call->operation_ID;
7673709a399SDavid Howells 		    memcpy(&__entry->srx, srx, sizeof(__entry->srx));
7683709a399SDavid Howells 			   ),
7693709a399SDavid Howells 
7703709a399SDavid Howells 	    TP_printk("c=%08x op=%u %pISpc",
7713709a399SDavid Howells 		      __entry->call, __entry->op_id, &__entry->srx.transport)
7723709a399SDavid Howells 	    );
7733709a399SDavid Howells 
7743709a399SDavid Howells TRACE_EVENT(afs_cm_no_server_u,
7753709a399SDavid Howells 	    TP_PROTO(struct afs_call *call, const uuid_t *uuid),
7763709a399SDavid Howells 
7773709a399SDavid Howells 	    TP_ARGS(call, uuid),
7783709a399SDavid Howells 
7793709a399SDavid Howells 	    TP_STRUCT__entry(
7803709a399SDavid Howells 		    __field(unsigned int,			call	)
7813709a399SDavid Howells 		    __field(unsigned int,			op_id	)
7823709a399SDavid Howells 		    __field_struct(uuid_t,			uuid	)
7833709a399SDavid Howells 			     ),
7843709a399SDavid Howells 
7853709a399SDavid Howells 	    TP_fast_assign(
7863709a399SDavid Howells 		    __entry->call = call->debug_id;
7873709a399SDavid Howells 		    __entry->op_id = call->operation_ID;
7883709a399SDavid Howells 		    memcpy(&__entry->uuid, uuid, sizeof(__entry->uuid));
7893709a399SDavid Howells 			   ),
7903709a399SDavid Howells 
7913709a399SDavid Howells 	    TP_printk("c=%08x op=%u %pU",
7923709a399SDavid Howells 		      __entry->call, __entry->op_id, &__entry->uuid)
7933709a399SDavid Howells 	    );
7943709a399SDavid Howells 
7958e8d7f13SDavid Howells #endif /* _TRACE_AFS_H */
7968e8d7f13SDavid Howells 
7978e8d7f13SDavid Howells /* This part must be outside protection */
7988e8d7f13SDavid Howells #include <trace/define_trace.h>
799