afs: Fix tracepoint string placement with built-in AFS
[linux-2.6-microblaze.git] / include / trace / events / afs.h
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /* AFS tracepoints
3  *
4  * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved.
5  * Written by David Howells (dhowells@redhat.com)
6  */
7 #undef TRACE_SYSTEM
8 #define TRACE_SYSTEM afs
9
10 #if !defined(_TRACE_AFS_H) || defined(TRACE_HEADER_MULTI_READ)
11 #define _TRACE_AFS_H
12
13 #include <linux/tracepoint.h>
14
15 /*
16  * Define enums for tracing information.
17  */
18 #ifndef __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY
19 #define __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY
20
21 enum afs_call_trace {
22         afs_call_trace_alloc,
23         afs_call_trace_free,
24         afs_call_trace_get,
25         afs_call_trace_put,
26         afs_call_trace_wake,
27         afs_call_trace_work,
28 };
29
30 enum afs_server_trace {
31         afs_server_trace_alloc,
32         afs_server_trace_callback,
33         afs_server_trace_destroy,
34         afs_server_trace_free,
35         afs_server_trace_gc,
36         afs_server_trace_get_by_addr,
37         afs_server_trace_get_by_uuid,
38         afs_server_trace_get_caps,
39         afs_server_trace_get_install,
40         afs_server_trace_get_new_cbi,
41         afs_server_trace_get_probe,
42         afs_server_trace_give_up_cb,
43         afs_server_trace_purging,
44         afs_server_trace_put_call,
45         afs_server_trace_put_cbi,
46         afs_server_trace_put_find_rsq,
47         afs_server_trace_put_probe,
48         afs_server_trace_put_slist,
49         afs_server_trace_put_slist_isort,
50         afs_server_trace_put_uuid_rsq,
51         afs_server_trace_update,
52 };
53
54
55 enum afs_volume_trace {
56         afs_volume_trace_alloc,
57         afs_volume_trace_free,
58         afs_volume_trace_get_alloc_sbi,
59         afs_volume_trace_get_cell_insert,
60         afs_volume_trace_get_new_op,
61         afs_volume_trace_get_query_alias,
62         afs_volume_trace_put_cell_dup,
63         afs_volume_trace_put_cell_root,
64         afs_volume_trace_put_destroy_sbi,
65         afs_volume_trace_put_free_fc,
66         afs_volume_trace_put_put_op,
67         afs_volume_trace_put_query_alias,
68         afs_volume_trace_put_validate_fc,
69         afs_volume_trace_remove,
70 };
71
72 enum afs_cell_trace {
73         afs_cell_trace_alloc,
74         afs_cell_trace_free,
75         afs_cell_trace_get_queue_dns,
76         afs_cell_trace_get_queue_manage,
77         afs_cell_trace_get_queue_new,
78         afs_cell_trace_get_vol,
79         afs_cell_trace_insert,
80         afs_cell_trace_manage,
81         afs_cell_trace_put_candidate,
82         afs_cell_trace_put_destroy,
83         afs_cell_trace_put_queue_fail,
84         afs_cell_trace_put_queue_work,
85         afs_cell_trace_put_vol,
86         afs_cell_trace_see_source,
87         afs_cell_trace_see_ws,
88         afs_cell_trace_unuse_alias,
89         afs_cell_trace_unuse_check_alias,
90         afs_cell_trace_unuse_delete,
91         afs_cell_trace_unuse_fc,
92         afs_cell_trace_unuse_lookup,
93         afs_cell_trace_unuse_mntpt,
94         afs_cell_trace_unuse_no_pin,
95         afs_cell_trace_unuse_parse,
96         afs_cell_trace_unuse_pin,
97         afs_cell_trace_unuse_probe,
98         afs_cell_trace_unuse_sbi,
99         afs_cell_trace_unuse_ws,
100         afs_cell_trace_use_alias,
101         afs_cell_trace_use_check_alias,
102         afs_cell_trace_use_fc,
103         afs_cell_trace_use_fc_alias,
104         afs_cell_trace_use_lookup,
105         afs_cell_trace_use_mntpt,
106         afs_cell_trace_use_pin,
107         afs_cell_trace_use_probe,
108         afs_cell_trace_use_sbi,
109         afs_cell_trace_wait,
110 };
111
112 enum afs_fs_operation {
113         afs_FS_FetchData                = 130,  /* AFS Fetch file data */
114         afs_FS_FetchACL                 = 131,  /* AFS Fetch file ACL */
115         afs_FS_FetchStatus              = 132,  /* AFS Fetch file status */
116         afs_FS_StoreData                = 133,  /* AFS Store file data */
117         afs_FS_StoreACL                 = 134,  /* AFS Store file ACL */
118         afs_FS_StoreStatus              = 135,  /* AFS Store file status */
119         afs_FS_RemoveFile               = 136,  /* AFS Remove a file */
120         afs_FS_CreateFile               = 137,  /* AFS Create a file */
121         afs_FS_Rename                   = 138,  /* AFS Rename or move a file or directory */
122         afs_FS_Symlink                  = 139,  /* AFS Create a symbolic link */
123         afs_FS_Link                     = 140,  /* AFS Create a hard link */
124         afs_FS_MakeDir                  = 141,  /* AFS Create a directory */
125         afs_FS_RemoveDir                = 142,  /* AFS Remove a directory */
126         afs_FS_GetVolumeInfo            = 148,  /* AFS Get information about a volume */
127         afs_FS_GetVolumeStatus          = 149,  /* AFS Get volume status information */
128         afs_FS_GetRootVolume            = 151,  /* AFS Get root volume name */
129         afs_FS_SetLock                  = 156,  /* AFS Request a file lock */
130         afs_FS_ExtendLock               = 157,  /* AFS Extend a file lock */
131         afs_FS_ReleaseLock              = 158,  /* AFS Release a file lock */
132         afs_FS_Lookup                   = 161,  /* AFS lookup file in directory */
133         afs_FS_InlineBulkStatus         = 65536, /* AFS Fetch multiple file statuses with errors */
134         afs_FS_FetchData64              = 65537, /* AFS Fetch file data */
135         afs_FS_StoreData64              = 65538, /* AFS Store file data */
136         afs_FS_GiveUpAllCallBacks       = 65539, /* AFS Give up all our callbacks on a server */
137         afs_FS_GetCapabilities          = 65540, /* AFS Get FS server capabilities */
138
139         yfs_FS_FetchData                = 130,   /* YFS Fetch file data */
140         yfs_FS_FetchACL                 = 64131, /* YFS Fetch file ACL */
141         yfs_FS_FetchStatus              = 64132, /* YFS Fetch file status */
142         yfs_FS_StoreACL                 = 64134, /* YFS Store file ACL */
143         yfs_FS_StoreStatus              = 64135, /* YFS Store file status */
144         yfs_FS_RemoveFile               = 64136, /* YFS Remove a file */
145         yfs_FS_CreateFile               = 64137, /* YFS Create a file */
146         yfs_FS_Rename                   = 64138, /* YFS Rename or move a file or directory */
147         yfs_FS_Symlink                  = 64139, /* YFS Create a symbolic link */
148         yfs_FS_Link                     = 64140, /* YFS Create a hard link */
149         yfs_FS_MakeDir                  = 64141, /* YFS Create a directory */
150         yfs_FS_RemoveDir                = 64142, /* YFS Remove a directory */
151         yfs_FS_GetVolumeStatus          = 64149, /* YFS Get volume status information */
152         yfs_FS_SetVolumeStatus          = 64150, /* YFS Set volume status information */
153         yfs_FS_SetLock                  = 64156, /* YFS Request a file lock */
154         yfs_FS_ExtendLock               = 64157, /* YFS Extend a file lock */
155         yfs_FS_ReleaseLock              = 64158, /* YFS Release a file lock */
156         yfs_FS_Lookup                   = 64161, /* YFS lookup file in directory */
157         yfs_FS_FlushCPS                 = 64165,
158         yfs_FS_FetchOpaqueACL           = 64168,
159         yfs_FS_WhoAmI                   = 64170,
160         yfs_FS_RemoveACL                = 64171,
161         yfs_FS_RemoveFile2              = 64173,
162         yfs_FS_StoreOpaqueACL2          = 64174,
163         yfs_FS_InlineBulkStatus         = 64536, /* YFS Fetch multiple file statuses with errors */
164         yfs_FS_FetchData64              = 64537, /* YFS Fetch file data */
165         yfs_FS_StoreData64              = 64538, /* YFS Store file data */
166         yfs_FS_UpdateSymlink            = 64540,
167 };
168
169 enum afs_vl_operation {
170         afs_VL_GetEntryByNameU  = 527,          /* AFS Get Vol Entry By Name operation ID */
171         afs_VL_GetAddrsU        = 533,          /* AFS Get FS server addresses */
172         afs_YFSVL_GetEndpoints  = 64002,        /* YFS Get FS & Vol server addresses */
173         afs_YFSVL_GetCellName   = 64014,        /* YFS Get actual cell name */
174         afs_VL_GetCapabilities  = 65537,        /* AFS Get VL server capabilities */
175 };
176
177 enum afs_cm_operation {
178         afs_CB_CallBack                 = 204,  /* AFS break callback promises */
179         afs_CB_InitCallBackState        = 205,  /* AFS initialise callback state */
180         afs_CB_Probe                    = 206,  /* AFS probe client */
181         afs_CB_GetLock                  = 207,  /* AFS get contents of CM lock table */
182         afs_CB_GetCE                    = 208,  /* AFS get cache file description */
183         afs_CB_GetXStatsVersion         = 209,  /* AFS get version of extended statistics */
184         afs_CB_GetXStats                = 210,  /* AFS get contents of extended statistics data */
185         afs_CB_InitCallBackState3       = 213,  /* AFS initialise callback state, version 3 */
186         afs_CB_ProbeUuid                = 214,  /* AFS check the client hasn't rebooted */
187 };
188
189 enum yfs_cm_operation {
190         yfs_CB_Probe                    = 206,  /* YFS probe client */
191         yfs_CB_GetLock                  = 207,  /* YFS get contents of CM lock table */
192         yfs_CB_XStatsVersion            = 209,  /* YFS get version of extended statistics */
193         yfs_CB_GetXStats                = 210,  /* YFS get contents of extended statistics data */
194         yfs_CB_InitCallBackState3       = 213,  /* YFS initialise callback state, version 3 */
195         yfs_CB_ProbeUuid                = 214,  /* YFS check the client hasn't rebooted */
196         yfs_CB_GetServerPrefs           = 215,
197         yfs_CB_GetCellServDV            = 216,
198         yfs_CB_GetLocalCell             = 217,
199         yfs_CB_GetCacheConfig           = 218,
200         yfs_CB_GetCellByNum             = 65537,
201         yfs_CB_TellMeAboutYourself      = 65538, /* get client capabilities */
202         yfs_CB_CallBack                 = 64204,
203 };
204
205 enum afs_edit_dir_op {
206         afs_edit_dir_create,
207         afs_edit_dir_create_error,
208         afs_edit_dir_create_inval,
209         afs_edit_dir_create_nospc,
210         afs_edit_dir_delete,
211         afs_edit_dir_delete_error,
212         afs_edit_dir_delete_inval,
213         afs_edit_dir_delete_noent,
214 };
215
216 enum afs_edit_dir_reason {
217         afs_edit_dir_for_create,
218         afs_edit_dir_for_link,
219         afs_edit_dir_for_mkdir,
220         afs_edit_dir_for_rename_0,
221         afs_edit_dir_for_rename_1,
222         afs_edit_dir_for_rename_2,
223         afs_edit_dir_for_rmdir,
224         afs_edit_dir_for_silly_0,
225         afs_edit_dir_for_silly_1,
226         afs_edit_dir_for_symlink,
227         afs_edit_dir_for_unlink,
228 };
229
230 enum afs_eproto_cause {
231         afs_eproto_bad_status,
232         afs_eproto_cb_count,
233         afs_eproto_cb_fid_count,
234         afs_eproto_cellname_len,
235         afs_eproto_file_type,
236         afs_eproto_ibulkst_cb_count,
237         afs_eproto_ibulkst_count,
238         afs_eproto_motd_len,
239         afs_eproto_offline_msg_len,
240         afs_eproto_volname_len,
241         afs_eproto_yvl_fsendpt4_len,
242         afs_eproto_yvl_fsendpt6_len,
243         afs_eproto_yvl_fsendpt_num,
244         afs_eproto_yvl_fsendpt_type,
245         afs_eproto_yvl_vlendpt4_len,
246         afs_eproto_yvl_vlendpt6_len,
247         afs_eproto_yvl_vlendpt_type,
248 };
249
250 enum afs_io_error {
251         afs_io_error_cm_reply,
252         afs_io_error_extract,
253         afs_io_error_fs_probe_fail,
254         afs_io_error_vl_lookup_fail,
255         afs_io_error_vl_probe_fail,
256 };
257
258 enum afs_file_error {
259         afs_file_error_dir_bad_magic,
260         afs_file_error_dir_big,
261         afs_file_error_dir_missing_page,
262         afs_file_error_dir_name_too_long,
263         afs_file_error_dir_over_end,
264         afs_file_error_dir_small,
265         afs_file_error_dir_unmarked_ext,
266         afs_file_error_mntpt,
267         afs_file_error_writeback_fail,
268 };
269
270 enum afs_flock_event {
271         afs_flock_acquired,
272         afs_flock_callback_break,
273         afs_flock_defer_unlock,
274         afs_flock_extend_fail,
275         afs_flock_fail_other,
276         afs_flock_fail_perm,
277         afs_flock_no_lockers,
278         afs_flock_release_fail,
279         afs_flock_silly_delete,
280         afs_flock_timestamp,
281         afs_flock_try_to_lock,
282         afs_flock_vfs_lock,
283         afs_flock_vfs_locking,
284         afs_flock_waited,
285         afs_flock_waiting,
286         afs_flock_work_extending,
287         afs_flock_work_retry,
288         afs_flock_work_unlocking,
289         afs_flock_would_block,
290 };
291
292 enum afs_flock_operation {
293         afs_flock_op_copy_lock,
294         afs_flock_op_flock,
295         afs_flock_op_grant,
296         afs_flock_op_lock,
297         afs_flock_op_release_lock,
298         afs_flock_op_return_ok,
299         afs_flock_op_return_eagain,
300         afs_flock_op_return_edeadlk,
301         afs_flock_op_return_error,
302         afs_flock_op_set_lock,
303         afs_flock_op_unlock,
304         afs_flock_op_wake,
305 };
306
307 enum afs_cb_break_reason {
308         afs_cb_break_no_break,
309         afs_cb_break_for_callback,
310         afs_cb_break_for_deleted,
311         afs_cb_break_for_lapsed,
312         afs_cb_break_for_unlink,
313         afs_cb_break_for_vsbreak,
314         afs_cb_break_for_volume_callback,
315         afs_cb_break_for_zap,
316 };
317
318 #endif /* end __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY */
319
320 /*
321  * Declare tracing information enums and their string mappings for display.
322  */
323 #define afs_call_traces \
324         EM(afs_call_trace_alloc,                "ALLOC") \
325         EM(afs_call_trace_free,                 "FREE ") \
326         EM(afs_call_trace_get,                  "GET  ") \
327         EM(afs_call_trace_put,                  "PUT  ") \
328         EM(afs_call_trace_wake,                 "WAKE ") \
329         E_(afs_call_trace_work,                 "QUEUE")
330
331 #define afs_server_traces \
332         EM(afs_server_trace_alloc,              "ALLOC    ") \
333         EM(afs_server_trace_callback,           "CALLBACK ") \
334         EM(afs_server_trace_destroy,            "DESTROY  ") \
335         EM(afs_server_trace_free,               "FREE     ") \
336         EM(afs_server_trace_gc,                 "GC       ") \
337         EM(afs_server_trace_get_by_addr,        "GET addr ") \
338         EM(afs_server_trace_get_by_uuid,        "GET uuid ") \
339         EM(afs_server_trace_get_caps,           "GET caps ") \
340         EM(afs_server_trace_get_install,        "GET inst ") \
341         EM(afs_server_trace_get_new_cbi,        "GET cbi  ") \
342         EM(afs_server_trace_get_probe,          "GET probe") \
343         EM(afs_server_trace_give_up_cb,         "giveup-cb") \
344         EM(afs_server_trace_purging,            "PURGE    ") \
345         EM(afs_server_trace_put_call,           "PUT call ") \
346         EM(afs_server_trace_put_cbi,            "PUT cbi  ") \
347         EM(afs_server_trace_put_find_rsq,       "PUT f-rsq") \
348         EM(afs_server_trace_put_probe,          "PUT probe") \
349         EM(afs_server_trace_put_slist,          "PUT slist") \
350         EM(afs_server_trace_put_slist_isort,    "PUT isort") \
351         EM(afs_server_trace_put_uuid_rsq,       "PUT u-req") \
352         E_(afs_server_trace_update,             "UPDATE")
353
354 #define afs_volume_traces \
355         EM(afs_volume_trace_alloc,              "ALLOC         ") \
356         EM(afs_volume_trace_free,               "FREE          ") \
357         EM(afs_volume_trace_get_alloc_sbi,      "GET sbi-alloc ") \
358         EM(afs_volume_trace_get_cell_insert,    "GET cell-insrt") \
359         EM(afs_volume_trace_get_new_op,         "GET op-new    ") \
360         EM(afs_volume_trace_get_query_alias,    "GET cell-alias") \
361         EM(afs_volume_trace_put_cell_dup,       "PUT cell-dup  ") \
362         EM(afs_volume_trace_put_cell_root,      "PUT cell-root ") \
363         EM(afs_volume_trace_put_destroy_sbi,    "PUT sbi-destry") \
364         EM(afs_volume_trace_put_free_fc,        "PUT fc-free   ") \
365         EM(afs_volume_trace_put_put_op,         "PUT op-put    ") \
366         EM(afs_volume_trace_put_query_alias,    "PUT cell-alias") \
367         EM(afs_volume_trace_put_validate_fc,    "PUT fc-validat") \
368         E_(afs_volume_trace_remove,             "REMOVE        ")
369
370 #define afs_cell_traces \
371         EM(afs_cell_trace_alloc,                "ALLOC     ") \
372         EM(afs_cell_trace_free,                 "FREE      ") \
373         EM(afs_cell_trace_get_queue_dns,        "GET q-dns ") \
374         EM(afs_cell_trace_get_queue_manage,     "GET q-mng ") \
375         EM(afs_cell_trace_get_queue_new,        "GET q-new ") \
376         EM(afs_cell_trace_get_vol,              "GET vol   ") \
377         EM(afs_cell_trace_insert,               "INSERT    ") \
378         EM(afs_cell_trace_manage,               "MANAGE    ") \
379         EM(afs_cell_trace_put_candidate,        "PUT candid") \
380         EM(afs_cell_trace_put_destroy,          "PUT destry") \
381         EM(afs_cell_trace_put_queue_work,       "PUT q-work") \
382         EM(afs_cell_trace_put_queue_fail,       "PUT q-fail") \
383         EM(afs_cell_trace_put_vol,              "PUT vol   ") \
384         EM(afs_cell_trace_see_source,           "SEE source") \
385         EM(afs_cell_trace_see_ws,               "SEE ws    ") \
386         EM(afs_cell_trace_unuse_alias,          "UNU alias ") \
387         EM(afs_cell_trace_unuse_check_alias,    "UNU chk-al") \
388         EM(afs_cell_trace_unuse_delete,         "UNU delete") \
389         EM(afs_cell_trace_unuse_fc,             "UNU fc    ") \
390         EM(afs_cell_trace_unuse_lookup,         "UNU lookup") \
391         EM(afs_cell_trace_unuse_mntpt,          "UNU mntpt ") \
392         EM(afs_cell_trace_unuse_parse,          "UNU parse ") \
393         EM(afs_cell_trace_unuse_pin,            "UNU pin   ") \
394         EM(afs_cell_trace_unuse_probe,          "UNU probe ") \
395         EM(afs_cell_trace_unuse_sbi,            "UNU sbi   ") \
396         EM(afs_cell_trace_unuse_ws,             "UNU ws    ") \
397         EM(afs_cell_trace_use_alias,            "USE alias ") \
398         EM(afs_cell_trace_use_check_alias,      "USE chk-al") \
399         EM(afs_cell_trace_use_fc,               "USE fc    ") \
400         EM(afs_cell_trace_use_fc_alias,         "USE fc-al ") \
401         EM(afs_cell_trace_use_lookup,           "USE lookup") \
402         EM(afs_cell_trace_use_mntpt,            "USE mntpt ") \
403         EM(afs_cell_trace_use_pin,              "USE pin   ") \
404         EM(afs_cell_trace_use_probe,            "USE probe ") \
405         EM(afs_cell_trace_use_sbi,              "USE sbi   ") \
406         E_(afs_cell_trace_wait,                 "WAIT      ")
407
408 #define afs_fs_operations \
409         EM(afs_FS_FetchData,                    "FS.FetchData") \
410         EM(afs_FS_FetchStatus,                  "FS.FetchStatus") \
411         EM(afs_FS_StoreData,                    "FS.StoreData") \
412         EM(afs_FS_StoreStatus,                  "FS.StoreStatus") \
413         EM(afs_FS_RemoveFile,                   "FS.RemoveFile") \
414         EM(afs_FS_CreateFile,                   "FS.CreateFile") \
415         EM(afs_FS_Rename,                       "FS.Rename") \
416         EM(afs_FS_Symlink,                      "FS.Symlink") \
417         EM(afs_FS_Link,                         "FS.Link") \
418         EM(afs_FS_MakeDir,                      "FS.MakeDir") \
419         EM(afs_FS_RemoveDir,                    "FS.RemoveDir") \
420         EM(afs_FS_GetVolumeInfo,                "FS.GetVolumeInfo") \
421         EM(afs_FS_GetVolumeStatus,              "FS.GetVolumeStatus") \
422         EM(afs_FS_GetRootVolume,                "FS.GetRootVolume") \
423         EM(afs_FS_SetLock,                      "FS.SetLock") \
424         EM(afs_FS_ExtendLock,                   "FS.ExtendLock") \
425         EM(afs_FS_ReleaseLock,                  "FS.ReleaseLock") \
426         EM(afs_FS_Lookup,                       "FS.Lookup") \
427         EM(afs_FS_InlineBulkStatus,             "FS.InlineBulkStatus") \
428         EM(afs_FS_FetchData64,                  "FS.FetchData64") \
429         EM(afs_FS_StoreData64,                  "FS.StoreData64") \
430         EM(afs_FS_GiveUpAllCallBacks,           "FS.GiveUpAllCallBacks") \
431         EM(afs_FS_GetCapabilities,              "FS.GetCapabilities") \
432         EM(yfs_FS_FetchACL,                     "YFS.FetchACL") \
433         EM(yfs_FS_FetchStatus,                  "YFS.FetchStatus") \
434         EM(yfs_FS_StoreACL,                     "YFS.StoreACL") \
435         EM(yfs_FS_StoreStatus,                  "YFS.StoreStatus") \
436         EM(yfs_FS_RemoveFile,                   "YFS.RemoveFile") \
437         EM(yfs_FS_CreateFile,                   "YFS.CreateFile") \
438         EM(yfs_FS_Rename,                       "YFS.Rename") \
439         EM(yfs_FS_Symlink,                      "YFS.Symlink") \
440         EM(yfs_FS_Link,                         "YFS.Link") \
441         EM(yfs_FS_MakeDir,                      "YFS.MakeDir") \
442         EM(yfs_FS_RemoveDir,                    "YFS.RemoveDir") \
443         EM(yfs_FS_GetVolumeStatus,              "YFS.GetVolumeStatus") \
444         EM(yfs_FS_SetVolumeStatus,              "YFS.SetVolumeStatus") \
445         EM(yfs_FS_SetLock,                      "YFS.SetLock") \
446         EM(yfs_FS_ExtendLock,                   "YFS.ExtendLock") \
447         EM(yfs_FS_ReleaseLock,                  "YFS.ReleaseLock") \
448         EM(yfs_FS_Lookup,                       "YFS.Lookup") \
449         EM(yfs_FS_FlushCPS,                     "YFS.FlushCPS") \
450         EM(yfs_FS_FetchOpaqueACL,               "YFS.FetchOpaqueACL") \
451         EM(yfs_FS_WhoAmI,                       "YFS.WhoAmI") \
452         EM(yfs_FS_RemoveACL,                    "YFS.RemoveACL") \
453         EM(yfs_FS_RemoveFile2,                  "YFS.RemoveFile2") \
454         EM(yfs_FS_StoreOpaqueACL2,              "YFS.StoreOpaqueACL2") \
455         EM(yfs_FS_InlineBulkStatus,             "YFS.InlineBulkStatus") \
456         EM(yfs_FS_FetchData64,                  "YFS.FetchData64") \
457         EM(yfs_FS_StoreData64,                  "YFS.StoreData64") \
458         E_(yfs_FS_UpdateSymlink,                "YFS.UpdateSymlink")
459
460 #define afs_vl_operations \
461         EM(afs_VL_GetEntryByNameU,              "VL.GetEntryByNameU") \
462         EM(afs_VL_GetAddrsU,                    "VL.GetAddrsU") \
463         EM(afs_YFSVL_GetEndpoints,              "YFSVL.GetEndpoints") \
464         EM(afs_YFSVL_GetCellName,               "YFSVL.GetCellName") \
465         E_(afs_VL_GetCapabilities,              "VL.GetCapabilities")
466
467 #define afs_cm_operations \
468         EM(afs_CB_CallBack,                     "CB.CallBack") \
469         EM(afs_CB_InitCallBackState,            "CB.InitCallBackState") \
470         EM(afs_CB_Probe,                        "CB.Probe") \
471         EM(afs_CB_GetLock,                      "CB.GetLock") \
472         EM(afs_CB_GetCE,                        "CB.GetCE") \
473         EM(afs_CB_GetXStatsVersion,             "CB.GetXStatsVersion") \
474         EM(afs_CB_GetXStats,                    "CB.GetXStats") \
475         EM(afs_CB_InitCallBackState3,           "CB.InitCallBackState3") \
476         E_(afs_CB_ProbeUuid,                    "CB.ProbeUuid")
477
478 #define yfs_cm_operations \
479         EM(yfs_CB_Probe,                        "YFSCB.Probe") \
480         EM(yfs_CB_GetLock,                      "YFSCB.GetLock") \
481         EM(yfs_CB_XStatsVersion,                "YFSCB.XStatsVersion") \
482         EM(yfs_CB_GetXStats,                    "YFSCB.GetXStats") \
483         EM(yfs_CB_InitCallBackState3,           "YFSCB.InitCallBackState3") \
484         EM(yfs_CB_ProbeUuid,                    "YFSCB.ProbeUuid") \
485         EM(yfs_CB_GetServerPrefs,               "YFSCB.GetServerPrefs") \
486         EM(yfs_CB_GetCellServDV,                "YFSCB.GetCellServDV") \
487         EM(yfs_CB_GetLocalCell,                 "YFSCB.GetLocalCell") \
488         EM(yfs_CB_GetCacheConfig,               "YFSCB.GetCacheConfig") \
489         EM(yfs_CB_GetCellByNum,                 "YFSCB.GetCellByNum") \
490         EM(yfs_CB_TellMeAboutYourself,          "YFSCB.TellMeAboutYourself") \
491         E_(yfs_CB_CallBack,                     "YFSCB.CallBack")
492
493 #define afs_edit_dir_ops                                  \
494         EM(afs_edit_dir_create,                 "create") \
495         EM(afs_edit_dir_create_error,           "c_fail") \
496         EM(afs_edit_dir_create_inval,           "c_invl") \
497         EM(afs_edit_dir_create_nospc,           "c_nspc") \
498         EM(afs_edit_dir_delete,                 "delete") \
499         EM(afs_edit_dir_delete_error,           "d_err ") \
500         EM(afs_edit_dir_delete_inval,           "d_invl") \
501         E_(afs_edit_dir_delete_noent,           "d_nent")
502
503 #define afs_edit_dir_reasons                              \
504         EM(afs_edit_dir_for_create,             "Create") \
505         EM(afs_edit_dir_for_link,               "Link  ") \
506         EM(afs_edit_dir_for_mkdir,              "MkDir ") \
507         EM(afs_edit_dir_for_rename_0,           "Renam0") \
508         EM(afs_edit_dir_for_rename_1,           "Renam1") \
509         EM(afs_edit_dir_for_rename_2,           "Renam2") \
510         EM(afs_edit_dir_for_rmdir,              "RmDir ") \
511         EM(afs_edit_dir_for_silly_0,            "S_Ren0") \
512         EM(afs_edit_dir_for_silly_1,            "S_Ren1") \
513         EM(afs_edit_dir_for_symlink,            "Symlnk") \
514         E_(afs_edit_dir_for_unlink,             "Unlink")
515
516 #define afs_eproto_causes                       \
517         EM(afs_eproto_bad_status,       "BadStatus") \
518         EM(afs_eproto_cb_count,         "CbCount") \
519         EM(afs_eproto_cb_fid_count,     "CbFidCount") \
520         EM(afs_eproto_cellname_len,     "CellNameLen") \
521         EM(afs_eproto_file_type,        "FileTYpe") \
522         EM(afs_eproto_ibulkst_cb_count, "IBS.CbCount") \
523         EM(afs_eproto_ibulkst_count,    "IBS.FidCount") \
524         EM(afs_eproto_motd_len,         "MotdLen") \
525         EM(afs_eproto_offline_msg_len,  "OfflineMsgLen") \
526         EM(afs_eproto_volname_len,      "VolNameLen") \
527         EM(afs_eproto_yvl_fsendpt4_len, "YVL.FsEnd4Len") \
528         EM(afs_eproto_yvl_fsendpt6_len, "YVL.FsEnd6Len") \
529         EM(afs_eproto_yvl_fsendpt_num,  "YVL.FsEndCount") \
530         EM(afs_eproto_yvl_fsendpt_type, "YVL.FsEndType") \
531         EM(afs_eproto_yvl_vlendpt4_len, "YVL.VlEnd4Len") \
532         EM(afs_eproto_yvl_vlendpt6_len, "YVL.VlEnd6Len") \
533         E_(afs_eproto_yvl_vlendpt_type, "YVL.VlEndType")
534
535 #define afs_io_errors                                                   \
536         EM(afs_io_error_cm_reply,               "CM_REPLY")             \
537         EM(afs_io_error_extract,                "EXTRACT")              \
538         EM(afs_io_error_fs_probe_fail,          "FS_PROBE_FAIL")        \
539         EM(afs_io_error_vl_lookup_fail,         "VL_LOOKUP_FAIL")       \
540         E_(afs_io_error_vl_probe_fail,          "VL_PROBE_FAIL")
541
542 #define afs_file_errors                                                 \
543         EM(afs_file_error_dir_bad_magic,        "DIR_BAD_MAGIC")        \
544         EM(afs_file_error_dir_big,              "DIR_BIG")              \
545         EM(afs_file_error_dir_missing_page,     "DIR_MISSING_PAGE")     \
546         EM(afs_file_error_dir_name_too_long,    "DIR_NAME_TOO_LONG")    \
547         EM(afs_file_error_dir_over_end,         "DIR_ENT_OVER_END")     \
548         EM(afs_file_error_dir_small,            "DIR_SMALL")            \
549         EM(afs_file_error_dir_unmarked_ext,     "DIR_UNMARKED_EXT")     \
550         EM(afs_file_error_mntpt,                "MNTPT_READ_FAILED")    \
551         E_(afs_file_error_writeback_fail,       "WRITEBACK_FAILED")
552
553 #define afs_flock_types                                                 \
554         EM(F_RDLCK,                             "RDLCK")                \
555         EM(F_WRLCK,                             "WRLCK")                \
556         E_(F_UNLCK,                             "UNLCK")
557
558 #define afs_flock_states                                                \
559         EM(AFS_VNODE_LOCK_NONE,                 "NONE")                 \
560         EM(AFS_VNODE_LOCK_WAITING_FOR_CB,       "WAIT_FOR_CB")          \
561         EM(AFS_VNODE_LOCK_SETTING,              "SETTING")              \
562         EM(AFS_VNODE_LOCK_GRANTED,              "GRANTED")              \
563         EM(AFS_VNODE_LOCK_EXTENDING,            "EXTENDING")            \
564         EM(AFS_VNODE_LOCK_NEED_UNLOCK,          "NEED_UNLOCK")          \
565         EM(AFS_VNODE_LOCK_UNLOCKING,            "UNLOCKING")            \
566         E_(AFS_VNODE_LOCK_DELETED,              "DELETED")
567
568 #define afs_flock_events                                                \
569         EM(afs_flock_acquired,                  "Acquired")             \
570         EM(afs_flock_callback_break,            "Callback")             \
571         EM(afs_flock_defer_unlock,              "D-Unlock")             \
572         EM(afs_flock_extend_fail,               "Ext_Fail")             \
573         EM(afs_flock_fail_other,                "ErrOther")             \
574         EM(afs_flock_fail_perm,                 "ErrPerm ")             \
575         EM(afs_flock_no_lockers,                "NoLocker")             \
576         EM(afs_flock_release_fail,              "Rel_Fail")             \
577         EM(afs_flock_silly_delete,              "SillyDel")             \
578         EM(afs_flock_timestamp,                 "Timestmp")             \
579         EM(afs_flock_try_to_lock,               "TryToLck")             \
580         EM(afs_flock_vfs_lock,                  "VFSLock ")             \
581         EM(afs_flock_vfs_locking,               "VFSLking")             \
582         EM(afs_flock_waited,                    "Waited  ")             \
583         EM(afs_flock_waiting,                   "Waiting ")             \
584         EM(afs_flock_work_extending,            "Extendng")             \
585         EM(afs_flock_work_retry,                "Retry   ")             \
586         EM(afs_flock_work_unlocking,            "Unlcking")             \
587         E_(afs_flock_would_block,               "EWOULDBL")
588
589 #define afs_flock_operations                                            \
590         EM(afs_flock_op_copy_lock,              "COPY    ")             \
591         EM(afs_flock_op_flock,                  "->flock ")             \
592         EM(afs_flock_op_grant,                  "GRANT   ")             \
593         EM(afs_flock_op_lock,                   "->lock  ")             \
594         EM(afs_flock_op_release_lock,           "RELEASE ")             \
595         EM(afs_flock_op_return_ok,              "<-OK    ")             \
596         EM(afs_flock_op_return_edeadlk,         "<-EDEADL")             \
597         EM(afs_flock_op_return_eagain,          "<-EAGAIN")             \
598         EM(afs_flock_op_return_error,           "<-ERROR ")             \
599         EM(afs_flock_op_set_lock,               "SET     ")             \
600         EM(afs_flock_op_unlock,                 "UNLOCK  ")             \
601         E_(afs_flock_op_wake,                   "WAKE    ")
602
603 #define afs_cb_break_reasons                                            \
604         EM(afs_cb_break_no_break,               "no-break")             \
605         EM(afs_cb_break_for_callback,           "break-cb")             \
606         EM(afs_cb_break_for_deleted,            "break-del")            \
607         EM(afs_cb_break_for_lapsed,             "break-lapsed")         \
608         EM(afs_cb_break_for_unlink,             "break-unlink")         \
609         EM(afs_cb_break_for_vsbreak,            "break-vs")             \
610         EM(afs_cb_break_for_volume_callback,    "break-v-cb")           \
611         E_(afs_cb_break_for_zap,                "break-zap")
612
613 /*
614  * Export enum symbols via userspace.
615  */
616 #undef EM
617 #undef E_
618 #define EM(a, b) TRACE_DEFINE_ENUM(a);
619 #define E_(a, b) TRACE_DEFINE_ENUM(a);
620
621 afs_call_traces;
622 afs_server_traces;
623 afs_cell_traces;
624 afs_fs_operations;
625 afs_vl_operations;
626 afs_cm_operations;
627 yfs_cm_operations;
628 afs_edit_dir_ops;
629 afs_edit_dir_reasons;
630 afs_eproto_causes;
631 afs_io_errors;
632 afs_file_errors;
633 afs_flock_types;
634 afs_flock_operations;
635 afs_cb_break_reasons;
636
637 /*
638  * Now redefine the EM() and E_() macros to map the enums to the strings that
639  * will be printed in the output.
640  */
641 #undef EM
642 #undef E_
643 #define EM(a, b)        { a, b },
644 #define E_(a, b)        { a, b }
645
646 TRACE_EVENT(afs_receive_data,
647             TP_PROTO(struct afs_call *call, struct iov_iter *iter,
648                      bool want_more, int ret),
649
650             TP_ARGS(call, iter, want_more, ret),
651
652             TP_STRUCT__entry(
653                     __field(loff_t,                     remain          )
654                     __field(unsigned int,               call            )
655                     __field(enum afs_call_state,        state           )
656                     __field(unsigned short,             unmarshall      )
657                     __field(bool,                       want_more       )
658                     __field(int,                        ret             )
659                              ),
660
661             TP_fast_assign(
662                     __entry->call       = call->debug_id;
663                     __entry->state      = call->state;
664                     __entry->unmarshall = call->unmarshall;
665                     __entry->remain     = iov_iter_count(iter);
666                     __entry->want_more  = want_more;
667                     __entry->ret        = ret;
668                            ),
669
670             TP_printk("c=%08x r=%llu u=%u w=%u s=%u ret=%d",
671                       __entry->call,
672                       __entry->remain,
673                       __entry->unmarshall,
674                       __entry->want_more,
675                       __entry->state,
676                       __entry->ret)
677             );
678
679 TRACE_EVENT(afs_notify_call,
680             TP_PROTO(struct rxrpc_call *rxcall, struct afs_call *call),
681
682             TP_ARGS(rxcall, call),
683
684             TP_STRUCT__entry(
685                     __field(unsigned int,               call            )
686                     __field(enum afs_call_state,        state           )
687                     __field(unsigned short,             unmarshall      )
688                              ),
689
690             TP_fast_assign(
691                     __entry->call       = call->debug_id;
692                     __entry->state      = call->state;
693                     __entry->unmarshall = call->unmarshall;
694                            ),
695
696             TP_printk("c=%08x s=%u u=%u",
697                       __entry->call,
698                       __entry->state, __entry->unmarshall)
699             );
700
701 TRACE_EVENT(afs_cb_call,
702             TP_PROTO(struct afs_call *call),
703
704             TP_ARGS(call),
705
706             TP_STRUCT__entry(
707                     __field(unsigned int,               call            )
708                     __field(u32,                        op              )
709                     __field(u16,                        service_id      )
710                              ),
711
712             TP_fast_assign(
713                     __entry->call       = call->debug_id;
714                     __entry->op         = call->operation_ID;
715                     __entry->service_id = call->service_id;
716                            ),
717
718             TP_printk("c=%08x %s",
719                       __entry->call,
720                       __entry->service_id == 2501 ?
721                       __print_symbolic(__entry->op, yfs_cm_operations) :
722                       __print_symbolic(__entry->op, afs_cm_operations))
723             );
724
725 TRACE_EVENT(afs_call,
726             TP_PROTO(struct afs_call *call, enum afs_call_trace op,
727                      int usage, int outstanding, const void *where),
728
729             TP_ARGS(call, op, usage, outstanding, where),
730
731             TP_STRUCT__entry(
732                     __field(unsigned int,               call            )
733                     __field(int,                        op              )
734                     __field(int,                        usage           )
735                     __field(int,                        outstanding     )
736                     __field(const void *,               where           )
737                              ),
738
739             TP_fast_assign(
740                     __entry->call = call->debug_id;
741                     __entry->op = op;
742                     __entry->usage = usage;
743                     __entry->outstanding = outstanding;
744                     __entry->where = where;
745                            ),
746
747             TP_printk("c=%08x %s u=%d o=%d sp=%pSR",
748                       __entry->call,
749                       __print_symbolic(__entry->op, afs_call_traces),
750                       __entry->usage,
751                       __entry->outstanding,
752                       __entry->where)
753             );
754
755 TRACE_EVENT(afs_make_fs_call,
756             TP_PROTO(struct afs_call *call, const struct afs_fid *fid),
757
758             TP_ARGS(call, fid),
759
760             TP_STRUCT__entry(
761                     __field(unsigned int,               call            )
762                     __field(enum afs_fs_operation,      op              )
763                     __field_struct(struct afs_fid,      fid             )
764                              ),
765
766             TP_fast_assign(
767                     __entry->call = call->debug_id;
768                     __entry->op = call->operation_ID;
769                     if (fid) {
770                             __entry->fid = *fid;
771                     } else {
772                             __entry->fid.vid = 0;
773                             __entry->fid.vnode = 0;
774                             __entry->fid.unique = 0;
775                     }
776                            ),
777
778             TP_printk("c=%08x %06llx:%06llx:%06x %s",
779                       __entry->call,
780                       __entry->fid.vid,
781                       __entry->fid.vnode,
782                       __entry->fid.unique,
783                       __print_symbolic(__entry->op, afs_fs_operations))
784             );
785
786 TRACE_EVENT(afs_make_fs_calli,
787             TP_PROTO(struct afs_call *call, const struct afs_fid *fid,
788                      unsigned int i),
789
790             TP_ARGS(call, fid, i),
791
792             TP_STRUCT__entry(
793                     __field(unsigned int,               call            )
794                     __field(unsigned int,               i               )
795                     __field(enum afs_fs_operation,      op              )
796                     __field_struct(struct afs_fid,      fid             )
797                              ),
798
799             TP_fast_assign(
800                     __entry->call = call->debug_id;
801                     __entry->i = i;
802                     __entry->op = call->operation_ID;
803                     if (fid) {
804                             __entry->fid = *fid;
805                     } else {
806                             __entry->fid.vid = 0;
807                             __entry->fid.vnode = 0;
808                             __entry->fid.unique = 0;
809                     }
810                            ),
811
812             TP_printk("c=%08x %06llx:%06llx:%06x %s i=%u",
813                       __entry->call,
814                       __entry->fid.vid,
815                       __entry->fid.vnode,
816                       __entry->fid.unique,
817                       __print_symbolic(__entry->op, afs_fs_operations),
818                       __entry->i)
819             );
820
821 TRACE_EVENT(afs_make_fs_call1,
822             TP_PROTO(struct afs_call *call, const struct afs_fid *fid,
823                      const struct qstr *name),
824
825             TP_ARGS(call, fid, name),
826
827             TP_STRUCT__entry(
828                     __field(unsigned int,               call            )
829                     __field(enum afs_fs_operation,      op              )
830                     __field_struct(struct afs_fid,      fid             )
831                     __array(char,                       name, 24        )
832                              ),
833
834             TP_fast_assign(
835                     unsigned int __len = min_t(unsigned int, name->len, 23);
836                     __entry->call = call->debug_id;
837                     __entry->op = call->operation_ID;
838                     if (fid) {
839                             __entry->fid = *fid;
840                     } else {
841                             __entry->fid.vid = 0;
842                             __entry->fid.vnode = 0;
843                             __entry->fid.unique = 0;
844                     }
845                     memcpy(__entry->name, name->name, __len);
846                     __entry->name[__len] = 0;
847                            ),
848
849             TP_printk("c=%08x %06llx:%06llx:%06x %s \"%s\"",
850                       __entry->call,
851                       __entry->fid.vid,
852                       __entry->fid.vnode,
853                       __entry->fid.unique,
854                       __print_symbolic(__entry->op, afs_fs_operations),
855                       __entry->name)
856             );
857
858 TRACE_EVENT(afs_make_fs_call2,
859             TP_PROTO(struct afs_call *call, const struct afs_fid *fid,
860                      const struct qstr *name, const struct qstr *name2),
861
862             TP_ARGS(call, fid, name, name2),
863
864             TP_STRUCT__entry(
865                     __field(unsigned int,               call            )
866                     __field(enum afs_fs_operation,      op              )
867                     __field_struct(struct afs_fid,      fid             )
868                     __array(char,                       name, 24        )
869                     __array(char,                       name2, 24       )
870                              ),
871
872             TP_fast_assign(
873                     unsigned int __len = min_t(unsigned int, name->len, 23);
874                     unsigned int __len2 = min_t(unsigned int, name2->len, 23);
875                     __entry->call = call->debug_id;
876                     __entry->op = call->operation_ID;
877                     if (fid) {
878                             __entry->fid = *fid;
879                     } else {
880                             __entry->fid.vid = 0;
881                             __entry->fid.vnode = 0;
882                             __entry->fid.unique = 0;
883                     }
884                     memcpy(__entry->name, name->name, __len);
885                     __entry->name[__len] = 0;
886                     memcpy(__entry->name2, name2->name, __len2);
887                     __entry->name2[__len2] = 0;
888                            ),
889
890             TP_printk("c=%08x %06llx:%06llx:%06x %s \"%s\" \"%s\"",
891                       __entry->call,
892                       __entry->fid.vid,
893                       __entry->fid.vnode,
894                       __entry->fid.unique,
895                       __print_symbolic(__entry->op, afs_fs_operations),
896                       __entry->name,
897                       __entry->name2)
898             );
899
900 TRACE_EVENT(afs_make_vl_call,
901             TP_PROTO(struct afs_call *call),
902
903             TP_ARGS(call),
904
905             TP_STRUCT__entry(
906                     __field(unsigned int,               call            )
907                     __field(enum afs_vl_operation,      op              )
908                              ),
909
910             TP_fast_assign(
911                     __entry->call = call->debug_id;
912                     __entry->op = call->operation_ID;
913                            ),
914
915             TP_printk("c=%08x %s",
916                       __entry->call,
917                       __print_symbolic(__entry->op, afs_vl_operations))
918             );
919
920 TRACE_EVENT(afs_call_done,
921             TP_PROTO(struct afs_call *call),
922
923             TP_ARGS(call),
924
925             TP_STRUCT__entry(
926                     __field(unsigned int,               call            )
927                     __field(struct rxrpc_call *,        rx_call         )
928                     __field(int,                        ret             )
929                     __field(u32,                        abort_code      )
930                              ),
931
932             TP_fast_assign(
933                     __entry->call = call->debug_id;
934                     __entry->rx_call = call->rxcall;
935                     __entry->ret = call->error;
936                     __entry->abort_code = call->abort_code;
937                            ),
938
939             TP_printk("   c=%08x ret=%d ab=%d [%p]",
940                       __entry->call,
941                       __entry->ret,
942                       __entry->abort_code,
943                       __entry->rx_call)
944             );
945
946 TRACE_EVENT(afs_send_data,
947             TP_PROTO(struct afs_call *call, struct msghdr *msg),
948
949             TP_ARGS(call, msg),
950
951             TP_STRUCT__entry(
952                     __field(unsigned int,               call            )
953                     __field(unsigned int,               flags           )
954                     __field(loff_t,                     offset          )
955                     __field(loff_t,                     count           )
956                              ),
957
958             TP_fast_assign(
959                     __entry->call = call->debug_id;
960                     __entry->flags = msg->msg_flags;
961                     __entry->offset = msg->msg_iter.xarray_start + msg->msg_iter.iov_offset;
962                     __entry->count = iov_iter_count(&msg->msg_iter);
963                            ),
964
965             TP_printk(" c=%08x o=%llx n=%llx f=%x",
966                       __entry->call, __entry->offset, __entry->count,
967                       __entry->flags)
968             );
969
970 TRACE_EVENT(afs_sent_data,
971             TP_PROTO(struct afs_call *call, struct msghdr *msg, int ret),
972
973             TP_ARGS(call, msg, ret),
974
975             TP_STRUCT__entry(
976                     __field(unsigned int,               call            )
977                     __field(int,                        ret             )
978                     __field(loff_t,                     offset          )
979                     __field(loff_t,                     count           )
980                              ),
981
982             TP_fast_assign(
983                     __entry->call = call->debug_id;
984                     __entry->ret = ret;
985                     __entry->offset = msg->msg_iter.xarray_start + msg->msg_iter.iov_offset;
986                     __entry->count = iov_iter_count(&msg->msg_iter);
987                            ),
988
989             TP_printk(" c=%08x o=%llx n=%llx r=%x",
990                       __entry->call, __entry->offset, __entry->count,
991                       __entry->ret)
992             );
993
994 TRACE_EVENT(afs_dir_check_failed,
995             TP_PROTO(struct afs_vnode *vnode, loff_t off, loff_t i_size),
996
997             TP_ARGS(vnode, off, i_size),
998
999             TP_STRUCT__entry(
1000                     __field(struct afs_vnode *,         vnode           )
1001                     __field(loff_t,                     off             )
1002                     __field(loff_t,                     i_size          )
1003                              ),
1004
1005             TP_fast_assign(
1006                     __entry->vnode = vnode;
1007                     __entry->off = off;
1008                     __entry->i_size = i_size;
1009                            ),
1010
1011             TP_printk("vn=%p %llx/%llx",
1012                       __entry->vnode, __entry->off, __entry->i_size)
1013             );
1014
1015 TRACE_EVENT(afs_page_dirty,
1016             TP_PROTO(struct afs_vnode *vnode, const char *where, struct page *page),
1017
1018             TP_ARGS(vnode, where, page),
1019
1020             TP_STRUCT__entry(
1021                     __field(struct afs_vnode *,         vnode           )
1022                     __field(const char *,               where           )
1023                     __field(pgoff_t,                    page            )
1024                     __field(unsigned long,              from            )
1025                     __field(unsigned long,              to              )
1026                              ),
1027
1028             TP_fast_assign(
1029                     __entry->vnode = vnode;
1030                     __entry->where = where;
1031                     __entry->page = page->index;
1032                     __entry->from = afs_page_dirty_from(page, page->private);
1033                     __entry->to = afs_page_dirty_to(page, page->private);
1034                     __entry->to |= (afs_is_page_dirty_mmapped(page->private) ?
1035                                     (1UL << (BITS_PER_LONG - 1)) : 0);
1036                            ),
1037
1038             TP_printk("vn=%p %lx %s %lx-%lx%s",
1039                       __entry->vnode, __entry->page, __entry->where,
1040                       __entry->from,
1041                       __entry->to & ~(1UL << (BITS_PER_LONG - 1)),
1042                       __entry->to & (1UL << (BITS_PER_LONG - 1)) ? " M" : "")
1043             );
1044
1045 TRACE_EVENT(afs_call_state,
1046             TP_PROTO(struct afs_call *call,
1047                      enum afs_call_state from,
1048                      enum afs_call_state to,
1049                      int ret, u32 remote_abort),
1050
1051             TP_ARGS(call, from, to, ret, remote_abort),
1052
1053             TP_STRUCT__entry(
1054                     __field(unsigned int,               call            )
1055                     __field(enum afs_call_state,        from            )
1056                     __field(enum afs_call_state,        to              )
1057                     __field(int,                        ret             )
1058                     __field(u32,                        abort           )
1059                              ),
1060
1061             TP_fast_assign(
1062                     __entry->call = call->debug_id;
1063                     __entry->from = from;
1064                     __entry->to = to;
1065                     __entry->ret = ret;
1066                     __entry->abort = remote_abort;
1067                            ),
1068
1069             TP_printk("c=%08x %u->%u r=%d ab=%d",
1070                       __entry->call,
1071                       __entry->from, __entry->to,
1072                       __entry->ret, __entry->abort)
1073             );
1074
1075 TRACE_EVENT(afs_lookup,
1076             TP_PROTO(struct afs_vnode *dvnode, const struct qstr *name,
1077                      struct afs_fid *fid),
1078
1079             TP_ARGS(dvnode, name, fid),
1080
1081             TP_STRUCT__entry(
1082                     __field_struct(struct afs_fid,      dfid            )
1083                     __field_struct(struct afs_fid,      fid             )
1084                     __array(char,                       name, 24        )
1085                              ),
1086
1087             TP_fast_assign(
1088                     int __len = min_t(int, name->len, 23);
1089                     __entry->dfid = dvnode->fid;
1090                     __entry->fid = *fid;
1091                     memcpy(__entry->name, name->name, __len);
1092                     __entry->name[__len] = 0;
1093                            ),
1094
1095             TP_printk("d=%llx:%llx:%x \"%s\" f=%llx:%x",
1096                       __entry->dfid.vid, __entry->dfid.vnode, __entry->dfid.unique,
1097                       __entry->name,
1098                       __entry->fid.vnode, __entry->fid.unique)
1099             );
1100
1101 TRACE_EVENT(afs_edit_dir,
1102             TP_PROTO(struct afs_vnode *dvnode,
1103                      enum afs_edit_dir_reason why,
1104                      enum afs_edit_dir_op op,
1105                      unsigned int block,
1106                      unsigned int slot,
1107                      unsigned int f_vnode,
1108                      unsigned int f_unique,
1109                      const char *name),
1110
1111             TP_ARGS(dvnode, why, op, block, slot, f_vnode, f_unique, name),
1112
1113             TP_STRUCT__entry(
1114                     __field(unsigned int,               vnode           )
1115                     __field(unsigned int,               unique          )
1116                     __field(enum afs_edit_dir_reason,   why             )
1117                     __field(enum afs_edit_dir_op,       op              )
1118                     __field(unsigned int,               block           )
1119                     __field(unsigned short,             slot            )
1120                     __field(unsigned int,               f_vnode         )
1121                     __field(unsigned int,               f_unique        )
1122                     __array(char,                       name, 24        )
1123                              ),
1124
1125             TP_fast_assign(
1126                     int __len = strlen(name);
1127                     __len = min(__len, 23);
1128                     __entry->vnode      = dvnode->fid.vnode;
1129                     __entry->unique     = dvnode->fid.unique;
1130                     __entry->why        = why;
1131                     __entry->op         = op;
1132                     __entry->block      = block;
1133                     __entry->slot       = slot;
1134                     __entry->f_vnode    = f_vnode;
1135                     __entry->f_unique   = f_unique;
1136                     memcpy(__entry->name, name, __len);
1137                     __entry->name[__len] = 0;
1138                            ),
1139
1140             TP_printk("d=%x:%x %s %s %u[%u] f=%x:%x \"%s\"",
1141                       __entry->vnode, __entry->unique,
1142                       __print_symbolic(__entry->why, afs_edit_dir_reasons),
1143                       __print_symbolic(__entry->op, afs_edit_dir_ops),
1144                       __entry->block, __entry->slot,
1145                       __entry->f_vnode, __entry->f_unique,
1146                       __entry->name)
1147             );
1148
1149 TRACE_EVENT(afs_protocol_error,
1150             TP_PROTO(struct afs_call *call, enum afs_eproto_cause cause),
1151
1152             TP_ARGS(call, cause),
1153
1154             TP_STRUCT__entry(
1155                     __field(unsigned int,               call            )
1156                     __field(enum afs_eproto_cause,      cause           )
1157                              ),
1158
1159             TP_fast_assign(
1160                     __entry->call = call ? call->debug_id : 0;
1161                     __entry->cause = cause;
1162                            ),
1163
1164             TP_printk("c=%08x %s",
1165                       __entry->call,
1166                       __print_symbolic(__entry->cause, afs_eproto_causes))
1167             );
1168
1169 TRACE_EVENT(afs_io_error,
1170             TP_PROTO(unsigned int call, int error, enum afs_io_error where),
1171
1172             TP_ARGS(call, error, where),
1173
1174             TP_STRUCT__entry(
1175                     __field(unsigned int,       call            )
1176                     __field(int,                error           )
1177                     __field(enum afs_io_error,  where           )
1178                              ),
1179
1180             TP_fast_assign(
1181                     __entry->call = call;
1182                     __entry->error = error;
1183                     __entry->where = where;
1184                            ),
1185
1186             TP_printk("c=%08x r=%d %s",
1187                       __entry->call, __entry->error,
1188                       __print_symbolic(__entry->where, afs_io_errors))
1189             );
1190
1191 TRACE_EVENT(afs_file_error,
1192             TP_PROTO(struct afs_vnode *vnode, int error, enum afs_file_error where),
1193
1194             TP_ARGS(vnode, error, where),
1195
1196             TP_STRUCT__entry(
1197                     __field_struct(struct afs_fid,      fid             )
1198                     __field(int,                        error           )
1199                     __field(enum afs_file_error,        where           )
1200                              ),
1201
1202             TP_fast_assign(
1203                     __entry->fid = vnode->fid;
1204                     __entry->error = error;
1205                     __entry->where = where;
1206                            ),
1207
1208             TP_printk("%llx:%llx:%x r=%d %s",
1209                       __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1210                       __entry->error,
1211                       __print_symbolic(__entry->where, afs_file_errors))
1212             );
1213
1214 TRACE_EVENT(afs_cm_no_server,
1215             TP_PROTO(struct afs_call *call, struct sockaddr_rxrpc *srx),
1216
1217             TP_ARGS(call, srx),
1218
1219             TP_STRUCT__entry(
1220                     __field(unsigned int,                       call    )
1221                     __field(unsigned int,                       op_id   )
1222                     __field_struct(struct sockaddr_rxrpc,       srx     )
1223                              ),
1224
1225             TP_fast_assign(
1226                     __entry->call = call->debug_id;
1227                     __entry->op_id = call->operation_ID;
1228                     memcpy(&__entry->srx, srx, sizeof(__entry->srx));
1229                            ),
1230
1231             TP_printk("c=%08x op=%u %pISpc",
1232                       __entry->call, __entry->op_id, &__entry->srx.transport)
1233             );
1234
1235 TRACE_EVENT(afs_cm_no_server_u,
1236             TP_PROTO(struct afs_call *call, const uuid_t *uuid),
1237
1238             TP_ARGS(call, uuid),
1239
1240             TP_STRUCT__entry(
1241                     __field(unsigned int,                       call    )
1242                     __field(unsigned int,                       op_id   )
1243                     __field_struct(uuid_t,                      uuid    )
1244                              ),
1245
1246             TP_fast_assign(
1247                     __entry->call = call->debug_id;
1248                     __entry->op_id = call->operation_ID;
1249                     memcpy(&__entry->uuid, uuid, sizeof(__entry->uuid));
1250                            ),
1251
1252             TP_printk("c=%08x op=%u %pU",
1253                       __entry->call, __entry->op_id, &__entry->uuid)
1254             );
1255
1256 TRACE_EVENT(afs_flock_ev,
1257             TP_PROTO(struct afs_vnode *vnode, struct file_lock *fl,
1258                      enum afs_flock_event event, int error),
1259
1260             TP_ARGS(vnode, fl, event, error),
1261
1262             TP_STRUCT__entry(
1263                     __field_struct(struct afs_fid,      fid             )
1264                     __field(enum afs_flock_event,       event           )
1265                     __field(enum afs_lock_state,        state           )
1266                     __field(int,                        error           )
1267                     __field(unsigned int,               debug_id        )
1268                              ),
1269
1270             TP_fast_assign(
1271                     __entry->fid = vnode->fid;
1272                     __entry->event = event;
1273                     __entry->state = vnode->lock_state;
1274                     __entry->error = error;
1275                     __entry->debug_id = fl ? fl->fl_u.afs.debug_id : 0;
1276                            ),
1277
1278             TP_printk("%llx:%llx:%x %04x %s s=%s e=%d",
1279                       __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1280                       __entry->debug_id,
1281                       __print_symbolic(__entry->event, afs_flock_events),
1282                       __print_symbolic(__entry->state, afs_flock_states),
1283                       __entry->error)
1284             );
1285
1286 TRACE_EVENT(afs_flock_op,
1287             TP_PROTO(struct afs_vnode *vnode, struct file_lock *fl,
1288                      enum afs_flock_operation op),
1289
1290             TP_ARGS(vnode, fl, op),
1291
1292             TP_STRUCT__entry(
1293                     __field_struct(struct afs_fid,      fid             )
1294                     __field(loff_t,                     from            )
1295                     __field(loff_t,                     len             )
1296                     __field(enum afs_flock_operation,   op              )
1297                     __field(unsigned char,              type            )
1298                     __field(unsigned int,               flags           )
1299                     __field(unsigned int,               debug_id        )
1300                              ),
1301
1302             TP_fast_assign(
1303                     __entry->fid = vnode->fid;
1304                     __entry->from = fl->fl_start;
1305                     __entry->len = fl->fl_end - fl->fl_start + 1;
1306                     __entry->op = op;
1307                     __entry->type = fl->fl_type;
1308                     __entry->flags = fl->fl_flags;
1309                     __entry->debug_id = fl->fl_u.afs.debug_id;
1310                            ),
1311
1312             TP_printk("%llx:%llx:%x %04x %s t=%s R=%llx/%llx f=%x",
1313                       __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1314                       __entry->debug_id,
1315                       __print_symbolic(__entry->op, afs_flock_operations),
1316                       __print_symbolic(__entry->type, afs_flock_types),
1317                       __entry->from, __entry->len, __entry->flags)
1318             );
1319
1320 TRACE_EVENT(afs_reload_dir,
1321             TP_PROTO(struct afs_vnode *vnode),
1322
1323             TP_ARGS(vnode),
1324
1325             TP_STRUCT__entry(
1326                     __field_struct(struct afs_fid,      fid             )
1327                              ),
1328
1329             TP_fast_assign(
1330                     __entry->fid = vnode->fid;
1331                            ),
1332
1333             TP_printk("%llx:%llx:%x",
1334                       __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique)
1335             );
1336
1337 TRACE_EVENT(afs_silly_rename,
1338             TP_PROTO(struct afs_vnode *vnode, bool done),
1339
1340             TP_ARGS(vnode, done),
1341
1342             TP_STRUCT__entry(
1343                     __field_struct(struct afs_fid,      fid             )
1344                     __field(bool,                       done            )
1345                              ),
1346
1347             TP_fast_assign(
1348                     __entry->fid = vnode->fid;
1349                     __entry->done = done;
1350                            ),
1351
1352             TP_printk("%llx:%llx:%x done=%u",
1353                       __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1354                       __entry->done)
1355             );
1356
1357 TRACE_EVENT(afs_get_tree,
1358             TP_PROTO(struct afs_cell *cell, struct afs_volume *volume),
1359
1360             TP_ARGS(cell, volume),
1361
1362             TP_STRUCT__entry(
1363                     __field(u64,                        vid             )
1364                     __array(char,                       cell, 24        )
1365                     __array(char,                       volume, 24      )
1366                              ),
1367
1368             TP_fast_assign(
1369                     int __len;
1370                     __entry->vid = volume->vid;
1371                     __len = min_t(int, cell->name_len, 23);
1372                     memcpy(__entry->cell, cell->name, __len);
1373                     __entry->cell[__len] = 0;
1374                     __len = min_t(int, volume->name_len, 23);
1375                     memcpy(__entry->volume, volume->name, __len);
1376                     __entry->volume[__len] = 0;
1377                            ),
1378
1379             TP_printk("--- MOUNT %s:%s %llx",
1380                       __entry->cell, __entry->volume, __entry->vid)
1381             );
1382
1383 TRACE_EVENT(afs_cb_break,
1384             TP_PROTO(struct afs_fid *fid, unsigned int cb_break,
1385                      enum afs_cb_break_reason reason, bool skipped),
1386
1387             TP_ARGS(fid, cb_break, reason, skipped),
1388
1389             TP_STRUCT__entry(
1390                     __field_struct(struct afs_fid,      fid             )
1391                     __field(unsigned int,               cb_break        )
1392                     __field(enum afs_cb_break_reason,   reason          )
1393                     __field(bool,                       skipped         )
1394                              ),
1395
1396             TP_fast_assign(
1397                     __entry->fid        = *fid;
1398                     __entry->cb_break   = cb_break;
1399                     __entry->reason     = reason;
1400                     __entry->skipped    = skipped;
1401                            ),
1402
1403             TP_printk("%llx:%llx:%x b=%x s=%u %s",
1404                       __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1405                       __entry->cb_break,
1406                       __entry->skipped,
1407                       __print_symbolic(__entry->reason, afs_cb_break_reasons))
1408             );
1409
1410 TRACE_EVENT(afs_cb_miss,
1411             TP_PROTO(struct afs_fid *fid, enum afs_cb_break_reason reason),
1412
1413             TP_ARGS(fid, reason),
1414
1415             TP_STRUCT__entry(
1416                     __field_struct(struct afs_fid,      fid             )
1417                     __field(enum afs_cb_break_reason,   reason          )
1418                              ),
1419
1420             TP_fast_assign(
1421                     __entry->fid        = *fid;
1422                     __entry->reason     = reason;
1423                            ),
1424
1425             TP_printk(" %llx:%llx:%x %s",
1426                       __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1427                       __print_symbolic(__entry->reason, afs_cb_break_reasons))
1428             );
1429
1430 TRACE_EVENT(afs_server,
1431             TP_PROTO(struct afs_server *server, int ref, int active,
1432                      enum afs_server_trace reason),
1433
1434             TP_ARGS(server, ref, active, reason),
1435
1436             TP_STRUCT__entry(
1437                     __field(unsigned int,               server          )
1438                     __field(int,                        ref             )
1439                     __field(int,                        active          )
1440                     __field(int,                        reason          )
1441                              ),
1442
1443             TP_fast_assign(
1444                     __entry->server = server->debug_id;
1445                     __entry->ref = ref;
1446                     __entry->active = active;
1447                     __entry->reason = reason;
1448                            ),
1449
1450             TP_printk("s=%08x %s u=%d a=%d",
1451                       __entry->server,
1452                       __print_symbolic(__entry->reason, afs_server_traces),
1453                       __entry->ref,
1454                       __entry->active)
1455             );
1456
1457 TRACE_EVENT(afs_volume,
1458             TP_PROTO(afs_volid_t vid, int ref, enum afs_volume_trace reason),
1459
1460             TP_ARGS(vid, ref, reason),
1461
1462             TP_STRUCT__entry(
1463                     __field(afs_volid_t,                vid             )
1464                     __field(int,                        ref             )
1465                     __field(enum afs_volume_trace,      reason          )
1466                              ),
1467
1468             TP_fast_assign(
1469                     __entry->vid = vid;
1470                     __entry->ref = ref;
1471                     __entry->reason = reason;
1472                            ),
1473
1474             TP_printk("V=%llx %s u=%d",
1475                       __entry->vid,
1476                       __print_symbolic(__entry->reason, afs_volume_traces),
1477                       __entry->ref)
1478             );
1479
1480 TRACE_EVENT(afs_cell,
1481             TP_PROTO(unsigned int cell_debug_id, int usage, int active,
1482                      enum afs_cell_trace reason),
1483
1484             TP_ARGS(cell_debug_id, usage, active, reason),
1485
1486             TP_STRUCT__entry(
1487                     __field(unsigned int,               cell            )
1488                     __field(int,                        usage           )
1489                     __field(int,                        active          )
1490                     __field(int,                        reason          )
1491                              ),
1492
1493             TP_fast_assign(
1494                     __entry->cell = cell_debug_id;
1495                     __entry->usage = usage;
1496                     __entry->active = active;
1497                     __entry->reason = reason;
1498                            ),
1499
1500             TP_printk("L=%08x %s u=%d a=%d",
1501                       __entry->cell,
1502                       __print_symbolic(__entry->reason, afs_cell_traces),
1503                       __entry->usage,
1504                       __entry->active)
1505             );
1506
1507 #endif /* _TRACE_AFS_H */
1508
1509 /* This part must be outside protection */
1510 #include <trace/define_trace.h>