Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /* AFS tracepoints
0003  *
0004  * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved.
0005  * Written by David Howells (dhowells@redhat.com)
0006  */
0007 #undef TRACE_SYSTEM
0008 #define TRACE_SYSTEM afs
0009 
0010 #if !defined(_TRACE_AFS_H) || defined(TRACE_HEADER_MULTI_READ)
0011 #define _TRACE_AFS_H
0012 
0013 #include <linux/tracepoint.h>
0014 
0015 /*
0016  * Define enums for tracing information.
0017  */
0018 #ifndef __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY
0019 #define __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY
0020 
0021 enum afs_call_trace {
0022     afs_call_trace_alloc,
0023     afs_call_trace_free,
0024     afs_call_trace_get,
0025     afs_call_trace_put,
0026     afs_call_trace_wake,
0027     afs_call_trace_work,
0028 };
0029 
0030 enum afs_server_trace {
0031     afs_server_trace_alloc,
0032     afs_server_trace_callback,
0033     afs_server_trace_destroy,
0034     afs_server_trace_free,
0035     afs_server_trace_gc,
0036     afs_server_trace_get_by_addr,
0037     afs_server_trace_get_by_uuid,
0038     afs_server_trace_get_caps,
0039     afs_server_trace_get_install,
0040     afs_server_trace_get_new_cbi,
0041     afs_server_trace_get_probe,
0042     afs_server_trace_give_up_cb,
0043     afs_server_trace_purging,
0044     afs_server_trace_put_call,
0045     afs_server_trace_put_cbi,
0046     afs_server_trace_put_find_rsq,
0047     afs_server_trace_put_probe,
0048     afs_server_trace_put_slist,
0049     afs_server_trace_put_slist_isort,
0050     afs_server_trace_put_uuid_rsq,
0051     afs_server_trace_update,
0052 };
0053 
0054 
0055 enum afs_volume_trace {
0056     afs_volume_trace_alloc,
0057     afs_volume_trace_free,
0058     afs_volume_trace_get_alloc_sbi,
0059     afs_volume_trace_get_cell_insert,
0060     afs_volume_trace_get_new_op,
0061     afs_volume_trace_get_query_alias,
0062     afs_volume_trace_put_cell_dup,
0063     afs_volume_trace_put_cell_root,
0064     afs_volume_trace_put_destroy_sbi,
0065     afs_volume_trace_put_free_fc,
0066     afs_volume_trace_put_put_op,
0067     afs_volume_trace_put_query_alias,
0068     afs_volume_trace_put_validate_fc,
0069     afs_volume_trace_remove,
0070 };
0071 
0072 enum afs_cell_trace {
0073     afs_cell_trace_alloc,
0074     afs_cell_trace_free,
0075     afs_cell_trace_get_queue_dns,
0076     afs_cell_trace_get_queue_manage,
0077     afs_cell_trace_get_queue_new,
0078     afs_cell_trace_get_vol,
0079     afs_cell_trace_insert,
0080     afs_cell_trace_manage,
0081     afs_cell_trace_put_candidate,
0082     afs_cell_trace_put_destroy,
0083     afs_cell_trace_put_queue_fail,
0084     afs_cell_trace_put_queue_work,
0085     afs_cell_trace_put_vol,
0086     afs_cell_trace_see_source,
0087     afs_cell_trace_see_ws,
0088     afs_cell_trace_unuse_alias,
0089     afs_cell_trace_unuse_check_alias,
0090     afs_cell_trace_unuse_delete,
0091     afs_cell_trace_unuse_fc,
0092     afs_cell_trace_unuse_lookup,
0093     afs_cell_trace_unuse_mntpt,
0094     afs_cell_trace_unuse_no_pin,
0095     afs_cell_trace_unuse_parse,
0096     afs_cell_trace_unuse_pin,
0097     afs_cell_trace_unuse_probe,
0098     afs_cell_trace_unuse_sbi,
0099     afs_cell_trace_unuse_ws,
0100     afs_cell_trace_use_alias,
0101     afs_cell_trace_use_check_alias,
0102     afs_cell_trace_use_fc,
0103     afs_cell_trace_use_fc_alias,
0104     afs_cell_trace_use_lookup,
0105     afs_cell_trace_use_mntpt,
0106     afs_cell_trace_use_pin,
0107     afs_cell_trace_use_probe,
0108     afs_cell_trace_use_sbi,
0109     afs_cell_trace_wait,
0110 };
0111 
0112 enum afs_fs_operation {
0113     afs_FS_FetchData        = 130,  /* AFS Fetch file data */
0114     afs_FS_FetchACL         = 131,  /* AFS Fetch file ACL */
0115     afs_FS_FetchStatus      = 132,  /* AFS Fetch file status */
0116     afs_FS_StoreData        = 133,  /* AFS Store file data */
0117     afs_FS_StoreACL         = 134,  /* AFS Store file ACL */
0118     afs_FS_StoreStatus      = 135,  /* AFS Store file status */
0119     afs_FS_RemoveFile       = 136,  /* AFS Remove a file */
0120     afs_FS_CreateFile       = 137,  /* AFS Create a file */
0121     afs_FS_Rename           = 138,  /* AFS Rename or move a file or directory */
0122     afs_FS_Symlink          = 139,  /* AFS Create a symbolic link */
0123     afs_FS_Link         = 140,  /* AFS Create a hard link */
0124     afs_FS_MakeDir          = 141,  /* AFS Create a directory */
0125     afs_FS_RemoveDir        = 142,  /* AFS Remove a directory */
0126     afs_FS_GetVolumeInfo        = 148,  /* AFS Get information about a volume */
0127     afs_FS_GetVolumeStatus      = 149,  /* AFS Get volume status information */
0128     afs_FS_GetRootVolume        = 151,  /* AFS Get root volume name */
0129     afs_FS_SetLock          = 156,  /* AFS Request a file lock */
0130     afs_FS_ExtendLock       = 157,  /* AFS Extend a file lock */
0131     afs_FS_ReleaseLock      = 158,  /* AFS Release a file lock */
0132     afs_FS_Lookup           = 161,  /* AFS lookup file in directory */
0133     afs_FS_InlineBulkStatus     = 65536, /* AFS Fetch multiple file statuses with errors */
0134     afs_FS_FetchData64      = 65537, /* AFS Fetch file data */
0135     afs_FS_StoreData64      = 65538, /* AFS Store file data */
0136     afs_FS_GiveUpAllCallBacks   = 65539, /* AFS Give up all our callbacks on a server */
0137     afs_FS_GetCapabilities      = 65540, /* AFS Get FS server capabilities */
0138 
0139     yfs_FS_FetchData        = 130,   /* YFS Fetch file data */
0140     yfs_FS_FetchACL         = 64131, /* YFS Fetch file ACL */
0141     yfs_FS_FetchStatus      = 64132, /* YFS Fetch file status */
0142     yfs_FS_StoreACL         = 64134, /* YFS Store file ACL */
0143     yfs_FS_StoreStatus      = 64135, /* YFS Store file status */
0144     yfs_FS_RemoveFile       = 64136, /* YFS Remove a file */
0145     yfs_FS_CreateFile       = 64137, /* YFS Create a file */
0146     yfs_FS_Rename           = 64138, /* YFS Rename or move a file or directory */
0147     yfs_FS_Symlink          = 64139, /* YFS Create a symbolic link */
0148     yfs_FS_Link         = 64140, /* YFS Create a hard link */
0149     yfs_FS_MakeDir          = 64141, /* YFS Create a directory */
0150     yfs_FS_RemoveDir        = 64142, /* YFS Remove a directory */
0151     yfs_FS_GetVolumeStatus      = 64149, /* YFS Get volume status information */
0152     yfs_FS_SetVolumeStatus      = 64150, /* YFS Set volume status information */
0153     yfs_FS_SetLock          = 64156, /* YFS Request a file lock */
0154     yfs_FS_ExtendLock       = 64157, /* YFS Extend a file lock */
0155     yfs_FS_ReleaseLock      = 64158, /* YFS Release a file lock */
0156     yfs_FS_Lookup           = 64161, /* YFS lookup file in directory */
0157     yfs_FS_FlushCPS         = 64165,
0158     yfs_FS_FetchOpaqueACL       = 64168,
0159     yfs_FS_WhoAmI           = 64170,
0160     yfs_FS_RemoveACL        = 64171,
0161     yfs_FS_RemoveFile2      = 64173,
0162     yfs_FS_StoreOpaqueACL2      = 64174,
0163     yfs_FS_InlineBulkStatus     = 64536, /* YFS Fetch multiple file statuses with errors */
0164     yfs_FS_FetchData64      = 64537, /* YFS Fetch file data */
0165     yfs_FS_StoreData64      = 64538, /* YFS Store file data */
0166     yfs_FS_UpdateSymlink        = 64540,
0167 };
0168 
0169 enum afs_vl_operation {
0170     afs_VL_GetEntryByNameU  = 527,      /* AFS Get Vol Entry By Name operation ID */
0171     afs_VL_GetAddrsU    = 533,      /* AFS Get FS server addresses */
0172     afs_YFSVL_GetEndpoints  = 64002,    /* YFS Get FS & Vol server addresses */
0173     afs_YFSVL_GetCellName   = 64014,    /* YFS Get actual cell name */
0174     afs_VL_GetCapabilities  = 65537,    /* AFS Get VL server capabilities */
0175 };
0176 
0177 enum afs_cm_operation {
0178     afs_CB_CallBack         = 204,  /* AFS break callback promises */
0179     afs_CB_InitCallBackState    = 205,  /* AFS initialise callback state */
0180     afs_CB_Probe            = 206,  /* AFS probe client */
0181     afs_CB_GetLock          = 207,  /* AFS get contents of CM lock table */
0182     afs_CB_GetCE            = 208,  /* AFS get cache file description */
0183     afs_CB_GetXStatsVersion     = 209,  /* AFS get version of extended statistics */
0184     afs_CB_GetXStats        = 210,  /* AFS get contents of extended statistics data */
0185     afs_CB_InitCallBackState3   = 213,  /* AFS initialise callback state, version 3 */
0186     afs_CB_ProbeUuid        = 214,  /* AFS check the client hasn't rebooted */
0187 };
0188 
0189 enum yfs_cm_operation {
0190     yfs_CB_Probe            = 206,  /* YFS probe client */
0191     yfs_CB_GetLock          = 207,  /* YFS get contents of CM lock table */
0192     yfs_CB_XStatsVersion        = 209,  /* YFS get version of extended statistics */
0193     yfs_CB_GetXStats        = 210,  /* YFS get contents of extended statistics data */
0194     yfs_CB_InitCallBackState3   = 213,  /* YFS initialise callback state, version 3 */
0195     yfs_CB_ProbeUuid        = 214,  /* YFS check the client hasn't rebooted */
0196     yfs_CB_GetServerPrefs       = 215,
0197     yfs_CB_GetCellServDV        = 216,
0198     yfs_CB_GetLocalCell     = 217,
0199     yfs_CB_GetCacheConfig       = 218,
0200     yfs_CB_GetCellByNum     = 65537,
0201     yfs_CB_TellMeAboutYourself  = 65538, /* get client capabilities */
0202     yfs_CB_CallBack         = 64204,
0203 };
0204 
0205 enum afs_edit_dir_op {
0206     afs_edit_dir_create,
0207     afs_edit_dir_create_error,
0208     afs_edit_dir_create_inval,
0209     afs_edit_dir_create_nospc,
0210     afs_edit_dir_delete,
0211     afs_edit_dir_delete_error,
0212     afs_edit_dir_delete_inval,
0213     afs_edit_dir_delete_noent,
0214 };
0215 
0216 enum afs_edit_dir_reason {
0217     afs_edit_dir_for_create,
0218     afs_edit_dir_for_link,
0219     afs_edit_dir_for_mkdir,
0220     afs_edit_dir_for_rename_0,
0221     afs_edit_dir_for_rename_1,
0222     afs_edit_dir_for_rename_2,
0223     afs_edit_dir_for_rmdir,
0224     afs_edit_dir_for_silly_0,
0225     afs_edit_dir_for_silly_1,
0226     afs_edit_dir_for_symlink,
0227     afs_edit_dir_for_unlink,
0228 };
0229 
0230 enum afs_eproto_cause {
0231     afs_eproto_bad_status,
0232     afs_eproto_cb_count,
0233     afs_eproto_cb_fid_count,
0234     afs_eproto_cellname_len,
0235     afs_eproto_file_type,
0236     afs_eproto_ibulkst_cb_count,
0237     afs_eproto_ibulkst_count,
0238     afs_eproto_motd_len,
0239     afs_eproto_offline_msg_len,
0240     afs_eproto_volname_len,
0241     afs_eproto_yvl_fsendpt4_len,
0242     afs_eproto_yvl_fsendpt6_len,
0243     afs_eproto_yvl_fsendpt_num,
0244     afs_eproto_yvl_fsendpt_type,
0245     afs_eproto_yvl_vlendpt4_len,
0246     afs_eproto_yvl_vlendpt6_len,
0247     afs_eproto_yvl_vlendpt_type,
0248 };
0249 
0250 enum afs_io_error {
0251     afs_io_error_cm_reply,
0252     afs_io_error_extract,
0253     afs_io_error_fs_probe_fail,
0254     afs_io_error_vl_lookup_fail,
0255     afs_io_error_vl_probe_fail,
0256 };
0257 
0258 enum afs_file_error {
0259     afs_file_error_dir_bad_magic,
0260     afs_file_error_dir_big,
0261     afs_file_error_dir_missing_page,
0262     afs_file_error_dir_name_too_long,
0263     afs_file_error_dir_over_end,
0264     afs_file_error_dir_small,
0265     afs_file_error_dir_unmarked_ext,
0266     afs_file_error_mntpt,
0267     afs_file_error_writeback_fail,
0268 };
0269 
0270 enum afs_flock_event {
0271     afs_flock_acquired,
0272     afs_flock_callback_break,
0273     afs_flock_defer_unlock,
0274     afs_flock_extend_fail,
0275     afs_flock_fail_other,
0276     afs_flock_fail_perm,
0277     afs_flock_no_lockers,
0278     afs_flock_release_fail,
0279     afs_flock_silly_delete,
0280     afs_flock_timestamp,
0281     afs_flock_try_to_lock,
0282     afs_flock_vfs_lock,
0283     afs_flock_vfs_locking,
0284     afs_flock_waited,
0285     afs_flock_waiting,
0286     afs_flock_work_extending,
0287     afs_flock_work_retry,
0288     afs_flock_work_unlocking,
0289     afs_flock_would_block,
0290 };
0291 
0292 enum afs_flock_operation {
0293     afs_flock_op_copy_lock,
0294     afs_flock_op_flock,
0295     afs_flock_op_grant,
0296     afs_flock_op_lock,
0297     afs_flock_op_release_lock,
0298     afs_flock_op_return_ok,
0299     afs_flock_op_return_eagain,
0300     afs_flock_op_return_edeadlk,
0301     afs_flock_op_return_error,
0302     afs_flock_op_set_lock,
0303     afs_flock_op_unlock,
0304     afs_flock_op_wake,
0305 };
0306 
0307 enum afs_cb_break_reason {
0308     afs_cb_break_no_break,
0309     afs_cb_break_no_promise,
0310     afs_cb_break_for_callback,
0311     afs_cb_break_for_deleted,
0312     afs_cb_break_for_lapsed,
0313     afs_cb_break_for_s_reinit,
0314     afs_cb_break_for_unlink,
0315     afs_cb_break_for_v_break,
0316     afs_cb_break_for_volume_callback,
0317     afs_cb_break_for_zap,
0318 };
0319 
0320 #endif /* end __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY */
0321 
0322 /*
0323  * Declare tracing information enums and their string mappings for display.
0324  */
0325 #define afs_call_traces \
0326     EM(afs_call_trace_alloc,        "ALLOC") \
0327     EM(afs_call_trace_free,         "FREE ") \
0328     EM(afs_call_trace_get,          "GET  ") \
0329     EM(afs_call_trace_put,          "PUT  ") \
0330     EM(afs_call_trace_wake,         "WAKE ") \
0331     E_(afs_call_trace_work,         "QUEUE")
0332 
0333 #define afs_server_traces \
0334     EM(afs_server_trace_alloc,      "ALLOC    ") \
0335     EM(afs_server_trace_callback,       "CALLBACK ") \
0336     EM(afs_server_trace_destroy,        "DESTROY  ") \
0337     EM(afs_server_trace_free,       "FREE     ") \
0338     EM(afs_server_trace_gc,         "GC       ") \
0339     EM(afs_server_trace_get_by_addr,    "GET addr ") \
0340     EM(afs_server_trace_get_by_uuid,    "GET uuid ") \
0341     EM(afs_server_trace_get_caps,       "GET caps ") \
0342     EM(afs_server_trace_get_install,    "GET inst ") \
0343     EM(afs_server_trace_get_new_cbi,    "GET cbi  ") \
0344     EM(afs_server_trace_get_probe,      "GET probe") \
0345     EM(afs_server_trace_give_up_cb,     "giveup-cb") \
0346     EM(afs_server_trace_purging,        "PURGE    ") \
0347     EM(afs_server_trace_put_call,       "PUT call ") \
0348     EM(afs_server_trace_put_cbi,        "PUT cbi  ") \
0349     EM(afs_server_trace_put_find_rsq,   "PUT f-rsq") \
0350     EM(afs_server_trace_put_probe,      "PUT probe") \
0351     EM(afs_server_trace_put_slist,      "PUT slist") \
0352     EM(afs_server_trace_put_slist_isort,    "PUT isort") \
0353     EM(afs_server_trace_put_uuid_rsq,   "PUT u-req") \
0354     E_(afs_server_trace_update,     "UPDATE")
0355 
0356 #define afs_volume_traces \
0357     EM(afs_volume_trace_alloc,      "ALLOC         ") \
0358     EM(afs_volume_trace_free,       "FREE          ") \
0359     EM(afs_volume_trace_get_alloc_sbi,  "GET sbi-alloc ") \
0360     EM(afs_volume_trace_get_cell_insert,    "GET cell-insrt") \
0361     EM(afs_volume_trace_get_new_op,     "GET op-new    ") \
0362     EM(afs_volume_trace_get_query_alias,    "GET cell-alias") \
0363     EM(afs_volume_trace_put_cell_dup,   "PUT cell-dup  ") \
0364     EM(afs_volume_trace_put_cell_root,  "PUT cell-root ") \
0365     EM(afs_volume_trace_put_destroy_sbi,    "PUT sbi-destry") \
0366     EM(afs_volume_trace_put_free_fc,    "PUT fc-free   ") \
0367     EM(afs_volume_trace_put_put_op,     "PUT op-put    ") \
0368     EM(afs_volume_trace_put_query_alias,    "PUT cell-alias") \
0369     EM(afs_volume_trace_put_validate_fc,    "PUT fc-validat") \
0370     E_(afs_volume_trace_remove,     "REMOVE        ")
0371 
0372 #define afs_cell_traces \
0373     EM(afs_cell_trace_alloc,        "ALLOC     ") \
0374     EM(afs_cell_trace_free,         "FREE      ") \
0375     EM(afs_cell_trace_get_queue_dns,    "GET q-dns ") \
0376     EM(afs_cell_trace_get_queue_manage, "GET q-mng ") \
0377     EM(afs_cell_trace_get_queue_new,    "GET q-new ") \
0378     EM(afs_cell_trace_get_vol,      "GET vol   ") \
0379     EM(afs_cell_trace_insert,       "INSERT    ") \
0380     EM(afs_cell_trace_manage,       "MANAGE    ") \
0381     EM(afs_cell_trace_put_candidate,    "PUT candid") \
0382     EM(afs_cell_trace_put_destroy,      "PUT destry") \
0383     EM(afs_cell_trace_put_queue_work,   "PUT q-work") \
0384     EM(afs_cell_trace_put_queue_fail,   "PUT q-fail") \
0385     EM(afs_cell_trace_put_vol,      "PUT vol   ") \
0386     EM(afs_cell_trace_see_source,       "SEE source") \
0387     EM(afs_cell_trace_see_ws,       "SEE ws    ") \
0388     EM(afs_cell_trace_unuse_alias,      "UNU alias ") \
0389     EM(afs_cell_trace_unuse_check_alias,    "UNU chk-al") \
0390     EM(afs_cell_trace_unuse_delete,     "UNU delete") \
0391     EM(afs_cell_trace_unuse_fc,     "UNU fc    ") \
0392     EM(afs_cell_trace_unuse_lookup,     "UNU lookup") \
0393     EM(afs_cell_trace_unuse_mntpt,      "UNU mntpt ") \
0394     EM(afs_cell_trace_unuse_parse,      "UNU parse ") \
0395     EM(afs_cell_trace_unuse_pin,        "UNU pin   ") \
0396     EM(afs_cell_trace_unuse_probe,      "UNU probe ") \
0397     EM(afs_cell_trace_unuse_sbi,        "UNU sbi   ") \
0398     EM(afs_cell_trace_unuse_ws,     "UNU ws    ") \
0399     EM(afs_cell_trace_use_alias,        "USE alias ") \
0400     EM(afs_cell_trace_use_check_alias,  "USE chk-al") \
0401     EM(afs_cell_trace_use_fc,       "USE fc    ") \
0402     EM(afs_cell_trace_use_fc_alias,     "USE fc-al ") \
0403     EM(afs_cell_trace_use_lookup,       "USE lookup") \
0404     EM(afs_cell_trace_use_mntpt,        "USE mntpt ") \
0405     EM(afs_cell_trace_use_pin,      "USE pin   ") \
0406     EM(afs_cell_trace_use_probe,        "USE probe ") \
0407     EM(afs_cell_trace_use_sbi,      "USE sbi   ") \
0408     E_(afs_cell_trace_wait,         "WAIT      ")
0409 
0410 #define afs_fs_operations \
0411     EM(afs_FS_FetchData,            "FS.FetchData") \
0412     EM(afs_FS_FetchStatus,          "FS.FetchStatus") \
0413     EM(afs_FS_StoreData,            "FS.StoreData") \
0414     EM(afs_FS_StoreStatus,          "FS.StoreStatus") \
0415     EM(afs_FS_RemoveFile,           "FS.RemoveFile") \
0416     EM(afs_FS_CreateFile,           "FS.CreateFile") \
0417     EM(afs_FS_Rename,           "FS.Rename") \
0418     EM(afs_FS_Symlink,          "FS.Symlink") \
0419     EM(afs_FS_Link,             "FS.Link") \
0420     EM(afs_FS_MakeDir,          "FS.MakeDir") \
0421     EM(afs_FS_RemoveDir,            "FS.RemoveDir") \
0422     EM(afs_FS_GetVolumeInfo,        "FS.GetVolumeInfo") \
0423     EM(afs_FS_GetVolumeStatus,      "FS.GetVolumeStatus") \
0424     EM(afs_FS_GetRootVolume,        "FS.GetRootVolume") \
0425     EM(afs_FS_SetLock,          "FS.SetLock") \
0426     EM(afs_FS_ExtendLock,           "FS.ExtendLock") \
0427     EM(afs_FS_ReleaseLock,          "FS.ReleaseLock") \
0428     EM(afs_FS_Lookup,           "FS.Lookup") \
0429     EM(afs_FS_InlineBulkStatus,     "FS.InlineBulkStatus") \
0430     EM(afs_FS_FetchData64,          "FS.FetchData64") \
0431     EM(afs_FS_StoreData64,          "FS.StoreData64") \
0432     EM(afs_FS_GiveUpAllCallBacks,       "FS.GiveUpAllCallBacks") \
0433     EM(afs_FS_GetCapabilities,      "FS.GetCapabilities") \
0434     EM(yfs_FS_FetchACL,         "YFS.FetchACL") \
0435     EM(yfs_FS_FetchStatus,          "YFS.FetchStatus") \
0436     EM(yfs_FS_StoreACL,         "YFS.StoreACL") \
0437     EM(yfs_FS_StoreStatus,          "YFS.StoreStatus") \
0438     EM(yfs_FS_RemoveFile,           "YFS.RemoveFile") \
0439     EM(yfs_FS_CreateFile,           "YFS.CreateFile") \
0440     EM(yfs_FS_Rename,           "YFS.Rename") \
0441     EM(yfs_FS_Symlink,          "YFS.Symlink") \
0442     EM(yfs_FS_Link,             "YFS.Link") \
0443     EM(yfs_FS_MakeDir,          "YFS.MakeDir") \
0444     EM(yfs_FS_RemoveDir,            "YFS.RemoveDir") \
0445     EM(yfs_FS_GetVolumeStatus,      "YFS.GetVolumeStatus") \
0446     EM(yfs_FS_SetVolumeStatus,      "YFS.SetVolumeStatus") \
0447     EM(yfs_FS_SetLock,          "YFS.SetLock") \
0448     EM(yfs_FS_ExtendLock,           "YFS.ExtendLock") \
0449     EM(yfs_FS_ReleaseLock,          "YFS.ReleaseLock") \
0450     EM(yfs_FS_Lookup,           "YFS.Lookup") \
0451     EM(yfs_FS_FlushCPS,         "YFS.FlushCPS") \
0452     EM(yfs_FS_FetchOpaqueACL,       "YFS.FetchOpaqueACL") \
0453     EM(yfs_FS_WhoAmI,           "YFS.WhoAmI") \
0454     EM(yfs_FS_RemoveACL,            "YFS.RemoveACL") \
0455     EM(yfs_FS_RemoveFile2,          "YFS.RemoveFile2") \
0456     EM(yfs_FS_StoreOpaqueACL2,      "YFS.StoreOpaqueACL2") \
0457     EM(yfs_FS_InlineBulkStatus,     "YFS.InlineBulkStatus") \
0458     EM(yfs_FS_FetchData64,          "YFS.FetchData64") \
0459     EM(yfs_FS_StoreData64,          "YFS.StoreData64") \
0460     E_(yfs_FS_UpdateSymlink,        "YFS.UpdateSymlink")
0461 
0462 #define afs_vl_operations \
0463     EM(afs_VL_GetEntryByNameU,      "VL.GetEntryByNameU") \
0464     EM(afs_VL_GetAddrsU,            "VL.GetAddrsU") \
0465     EM(afs_YFSVL_GetEndpoints,      "YFSVL.GetEndpoints") \
0466     EM(afs_YFSVL_GetCellName,       "YFSVL.GetCellName") \
0467     E_(afs_VL_GetCapabilities,      "VL.GetCapabilities")
0468 
0469 #define afs_cm_operations \
0470     EM(afs_CB_CallBack,         "CB.CallBack") \
0471     EM(afs_CB_InitCallBackState,        "CB.InitCallBackState") \
0472     EM(afs_CB_Probe,            "CB.Probe") \
0473     EM(afs_CB_GetLock,          "CB.GetLock") \
0474     EM(afs_CB_GetCE,            "CB.GetCE") \
0475     EM(afs_CB_GetXStatsVersion,     "CB.GetXStatsVersion") \
0476     EM(afs_CB_GetXStats,            "CB.GetXStats") \
0477     EM(afs_CB_InitCallBackState3,       "CB.InitCallBackState3") \
0478     E_(afs_CB_ProbeUuid,            "CB.ProbeUuid")
0479 
0480 #define yfs_cm_operations \
0481     EM(yfs_CB_Probe,            "YFSCB.Probe") \
0482     EM(yfs_CB_GetLock,          "YFSCB.GetLock") \
0483     EM(yfs_CB_XStatsVersion,        "YFSCB.XStatsVersion") \
0484     EM(yfs_CB_GetXStats,            "YFSCB.GetXStats") \
0485     EM(yfs_CB_InitCallBackState3,       "YFSCB.InitCallBackState3") \
0486     EM(yfs_CB_ProbeUuid,            "YFSCB.ProbeUuid") \
0487     EM(yfs_CB_GetServerPrefs,       "YFSCB.GetServerPrefs") \
0488     EM(yfs_CB_GetCellServDV,        "YFSCB.GetCellServDV") \
0489     EM(yfs_CB_GetLocalCell,         "YFSCB.GetLocalCell") \
0490     EM(yfs_CB_GetCacheConfig,       "YFSCB.GetCacheConfig") \
0491     EM(yfs_CB_GetCellByNum,         "YFSCB.GetCellByNum") \
0492     EM(yfs_CB_TellMeAboutYourself,      "YFSCB.TellMeAboutYourself") \
0493     E_(yfs_CB_CallBack,         "YFSCB.CallBack")
0494 
0495 #define afs_edit_dir_ops                  \
0496     EM(afs_edit_dir_create,         "create") \
0497     EM(afs_edit_dir_create_error,       "c_fail") \
0498     EM(afs_edit_dir_create_inval,       "c_invl") \
0499     EM(afs_edit_dir_create_nospc,       "c_nspc") \
0500     EM(afs_edit_dir_delete,         "delete") \
0501     EM(afs_edit_dir_delete_error,       "d_err ") \
0502     EM(afs_edit_dir_delete_inval,       "d_invl") \
0503     E_(afs_edit_dir_delete_noent,       "d_nent")
0504 
0505 #define afs_edit_dir_reasons                  \
0506     EM(afs_edit_dir_for_create,     "Create") \
0507     EM(afs_edit_dir_for_link,       "Link  ") \
0508     EM(afs_edit_dir_for_mkdir,      "MkDir ") \
0509     EM(afs_edit_dir_for_rename_0,       "Renam0") \
0510     EM(afs_edit_dir_for_rename_1,       "Renam1") \
0511     EM(afs_edit_dir_for_rename_2,       "Renam2") \
0512     EM(afs_edit_dir_for_rmdir,      "RmDir ") \
0513     EM(afs_edit_dir_for_silly_0,        "S_Ren0") \
0514     EM(afs_edit_dir_for_silly_1,        "S_Ren1") \
0515     EM(afs_edit_dir_for_symlink,        "Symlnk") \
0516     E_(afs_edit_dir_for_unlink,     "Unlink")
0517 
0518 #define afs_eproto_causes           \
0519     EM(afs_eproto_bad_status,   "BadStatus") \
0520     EM(afs_eproto_cb_count,     "CbCount") \
0521     EM(afs_eproto_cb_fid_count, "CbFidCount") \
0522     EM(afs_eproto_cellname_len, "CellNameLen") \
0523     EM(afs_eproto_file_type,    "FileTYpe") \
0524     EM(afs_eproto_ibulkst_cb_count, "IBS.CbCount") \
0525     EM(afs_eproto_ibulkst_count,    "IBS.FidCount") \
0526     EM(afs_eproto_motd_len,     "MotdLen") \
0527     EM(afs_eproto_offline_msg_len,  "OfflineMsgLen") \
0528     EM(afs_eproto_volname_len,  "VolNameLen") \
0529     EM(afs_eproto_yvl_fsendpt4_len, "YVL.FsEnd4Len") \
0530     EM(afs_eproto_yvl_fsendpt6_len, "YVL.FsEnd6Len") \
0531     EM(afs_eproto_yvl_fsendpt_num,  "YVL.FsEndCount") \
0532     EM(afs_eproto_yvl_fsendpt_type, "YVL.FsEndType") \
0533     EM(afs_eproto_yvl_vlendpt4_len, "YVL.VlEnd4Len") \
0534     EM(afs_eproto_yvl_vlendpt6_len, "YVL.VlEnd6Len") \
0535     E_(afs_eproto_yvl_vlendpt_type, "YVL.VlEndType")
0536 
0537 #define afs_io_errors                           \
0538     EM(afs_io_error_cm_reply,       "CM_REPLY")     \
0539     EM(afs_io_error_extract,        "EXTRACT")      \
0540     EM(afs_io_error_fs_probe_fail,      "FS_PROBE_FAIL")    \
0541     EM(afs_io_error_vl_lookup_fail,     "VL_LOOKUP_FAIL")   \
0542     E_(afs_io_error_vl_probe_fail,      "VL_PROBE_FAIL")
0543 
0544 #define afs_file_errors                         \
0545     EM(afs_file_error_dir_bad_magic,    "DIR_BAD_MAGIC")    \
0546     EM(afs_file_error_dir_big,      "DIR_BIG")      \
0547     EM(afs_file_error_dir_missing_page, "DIR_MISSING_PAGE") \
0548     EM(afs_file_error_dir_name_too_long,    "DIR_NAME_TOO_LONG")    \
0549     EM(afs_file_error_dir_over_end,     "DIR_ENT_OVER_END") \
0550     EM(afs_file_error_dir_small,        "DIR_SMALL")        \
0551     EM(afs_file_error_dir_unmarked_ext, "DIR_UNMARKED_EXT") \
0552     EM(afs_file_error_mntpt,        "MNTPT_READ_FAILED")    \
0553     E_(afs_file_error_writeback_fail,   "WRITEBACK_FAILED")
0554 
0555 #define afs_flock_types                         \
0556     EM(F_RDLCK,             "RDLCK")        \
0557     EM(F_WRLCK,             "WRLCK")        \
0558     E_(F_UNLCK,             "UNLCK")
0559 
0560 #define afs_flock_states                        \
0561     EM(AFS_VNODE_LOCK_NONE,         "NONE")         \
0562     EM(AFS_VNODE_LOCK_WAITING_FOR_CB,   "WAIT_FOR_CB")      \
0563     EM(AFS_VNODE_LOCK_SETTING,      "SETTING")      \
0564     EM(AFS_VNODE_LOCK_GRANTED,      "GRANTED")      \
0565     EM(AFS_VNODE_LOCK_EXTENDING,        "EXTENDING")        \
0566     EM(AFS_VNODE_LOCK_NEED_UNLOCK,      "NEED_UNLOCK")      \
0567     EM(AFS_VNODE_LOCK_UNLOCKING,        "UNLOCKING")        \
0568     E_(AFS_VNODE_LOCK_DELETED,      "DELETED")
0569 
0570 #define afs_flock_events                        \
0571     EM(afs_flock_acquired,          "Acquired")     \
0572     EM(afs_flock_callback_break,        "Callback")     \
0573     EM(afs_flock_defer_unlock,      "D-Unlock")     \
0574     EM(afs_flock_extend_fail,       "Ext_Fail")     \
0575     EM(afs_flock_fail_other,        "ErrOther")     \
0576     EM(afs_flock_fail_perm,         "ErrPerm ")     \
0577     EM(afs_flock_no_lockers,        "NoLocker")     \
0578     EM(afs_flock_release_fail,      "Rel_Fail")     \
0579     EM(afs_flock_silly_delete,      "SillyDel")     \
0580     EM(afs_flock_timestamp,         "Timestmp")     \
0581     EM(afs_flock_try_to_lock,       "TryToLck")     \
0582     EM(afs_flock_vfs_lock,          "VFSLock ")     \
0583     EM(afs_flock_vfs_locking,       "VFSLking")     \
0584     EM(afs_flock_waited,            "Waited  ")     \
0585     EM(afs_flock_waiting,           "Waiting ")     \
0586     EM(afs_flock_work_extending,        "Extendng")     \
0587     EM(afs_flock_work_retry,        "Retry   ")     \
0588     EM(afs_flock_work_unlocking,        "Unlcking")     \
0589     E_(afs_flock_would_block,       "EWOULDBL")
0590 
0591 #define afs_flock_operations                        \
0592     EM(afs_flock_op_copy_lock,      "COPY    ")     \
0593     EM(afs_flock_op_flock,          "->flock ")     \
0594     EM(afs_flock_op_grant,          "GRANT   ")     \
0595     EM(afs_flock_op_lock,           "->lock  ")     \
0596     EM(afs_flock_op_release_lock,       "RELEASE ")     \
0597     EM(afs_flock_op_return_ok,      "<-OK    ")     \
0598     EM(afs_flock_op_return_edeadlk,     "<-EDEADL")     \
0599     EM(afs_flock_op_return_eagain,      "<-EAGAIN")     \
0600     EM(afs_flock_op_return_error,       "<-ERROR ")     \
0601     EM(afs_flock_op_set_lock,       "SET     ")     \
0602     EM(afs_flock_op_unlock,         "UNLOCK  ")     \
0603     E_(afs_flock_op_wake,           "WAKE    ")
0604 
0605 #define afs_cb_break_reasons                        \
0606     EM(afs_cb_break_no_break,       "no-break")     \
0607     EM(afs_cb_break_no_promise,     "no-promise")       \
0608     EM(afs_cb_break_for_callback,       "break-cb")     \
0609     EM(afs_cb_break_for_deleted,        "break-del")        \
0610     EM(afs_cb_break_for_lapsed,     "break-lapsed")     \
0611     EM(afs_cb_break_for_s_reinit,       "s-reinit")     \
0612     EM(afs_cb_break_for_unlink,     "break-unlink")     \
0613     EM(afs_cb_break_for_v_break,        "break-v")      \
0614     EM(afs_cb_break_for_volume_callback,    "break-v-cb")       \
0615     E_(afs_cb_break_for_zap,        "break-zap")
0616 
0617 /*
0618  * Export enum symbols via userspace.
0619  */
0620 #undef EM
0621 #undef E_
0622 #define EM(a, b) TRACE_DEFINE_ENUM(a);
0623 #define E_(a, b) TRACE_DEFINE_ENUM(a);
0624 
0625 afs_call_traces;
0626 afs_server_traces;
0627 afs_cell_traces;
0628 afs_fs_operations;
0629 afs_vl_operations;
0630 afs_cm_operations;
0631 yfs_cm_operations;
0632 afs_edit_dir_ops;
0633 afs_edit_dir_reasons;
0634 afs_eproto_causes;
0635 afs_io_errors;
0636 afs_file_errors;
0637 afs_flock_types;
0638 afs_flock_operations;
0639 afs_cb_break_reasons;
0640 
0641 /*
0642  * Now redefine the EM() and E_() macros to map the enums to the strings that
0643  * will be printed in the output.
0644  */
0645 #undef EM
0646 #undef E_
0647 #define EM(a, b)    { a, b },
0648 #define E_(a, b)    { a, b }
0649 
0650 TRACE_EVENT(afs_receive_data,
0651         TP_PROTO(struct afs_call *call, struct iov_iter *iter,
0652              bool want_more, int ret),
0653 
0654         TP_ARGS(call, iter, want_more, ret),
0655 
0656         TP_STRUCT__entry(
0657             __field(loff_t,         remain      )
0658             __field(unsigned int,       call        )
0659             __field(enum afs_call_state,    state       )
0660             __field(unsigned short,     unmarshall  )
0661             __field(bool,           want_more   )
0662             __field(int,            ret     )
0663                  ),
0664 
0665         TP_fast_assign(
0666             __entry->call   = call->debug_id;
0667             __entry->state  = call->state;
0668             __entry->unmarshall = call->unmarshall;
0669             __entry->remain = iov_iter_count(iter);
0670             __entry->want_more  = want_more;
0671             __entry->ret    = ret;
0672                ),
0673 
0674         TP_printk("c=%08x r=%llu u=%u w=%u s=%u ret=%d",
0675               __entry->call,
0676               __entry->remain,
0677               __entry->unmarshall,
0678               __entry->want_more,
0679               __entry->state,
0680               __entry->ret)
0681         );
0682 
0683 TRACE_EVENT(afs_notify_call,
0684         TP_PROTO(struct rxrpc_call *rxcall, struct afs_call *call),
0685 
0686         TP_ARGS(rxcall, call),
0687 
0688         TP_STRUCT__entry(
0689             __field(unsigned int,       call        )
0690             __field(enum afs_call_state,    state       )
0691             __field(unsigned short,     unmarshall  )
0692                  ),
0693 
0694         TP_fast_assign(
0695             __entry->call   = call->debug_id;
0696             __entry->state  = call->state;
0697             __entry->unmarshall = call->unmarshall;
0698                ),
0699 
0700         TP_printk("c=%08x s=%u u=%u",
0701               __entry->call,
0702               __entry->state, __entry->unmarshall)
0703         );
0704 
0705 TRACE_EVENT(afs_cb_call,
0706         TP_PROTO(struct afs_call *call),
0707 
0708         TP_ARGS(call),
0709 
0710         TP_STRUCT__entry(
0711             __field(unsigned int,       call        )
0712             __field(u32,            op      )
0713             __field(u16,            service_id  )
0714                  ),
0715 
0716         TP_fast_assign(
0717             __entry->call   = call->debug_id;
0718             __entry->op     = call->operation_ID;
0719             __entry->service_id = call->service_id;
0720                ),
0721 
0722         TP_printk("c=%08x %s",
0723               __entry->call,
0724               __entry->service_id == 2501 ?
0725               __print_symbolic(__entry->op, yfs_cm_operations) :
0726               __print_symbolic(__entry->op, afs_cm_operations))
0727         );
0728 
0729 TRACE_EVENT(afs_call,
0730         TP_PROTO(unsigned int call_debug_id, enum afs_call_trace op,
0731              int ref, int outstanding, const void *where),
0732 
0733         TP_ARGS(call_debug_id, op, ref, outstanding, where),
0734 
0735         TP_STRUCT__entry(
0736             __field(unsigned int,       call        )
0737             __field(int,            op      )
0738             __field(int,            ref     )
0739             __field(int,            outstanding )
0740             __field(const void *,       where       )
0741                  ),
0742 
0743         TP_fast_assign(
0744             __entry->call = call_debug_id;
0745             __entry->op = op;
0746             __entry->ref = ref;
0747             __entry->outstanding = outstanding;
0748             __entry->where = where;
0749                ),
0750 
0751         TP_printk("c=%08x %s r=%d o=%d sp=%pSR",
0752               __entry->call,
0753               __print_symbolic(__entry->op, afs_call_traces),
0754               __entry->ref,
0755               __entry->outstanding,
0756               __entry->where)
0757         );
0758 
0759 TRACE_EVENT(afs_make_fs_call,
0760         TP_PROTO(struct afs_call *call, const struct afs_fid *fid),
0761 
0762         TP_ARGS(call, fid),
0763 
0764         TP_STRUCT__entry(
0765             __field(unsigned int,       call        )
0766             __field(enum afs_fs_operation,  op      )
0767             __field_struct(struct afs_fid,  fid     )
0768                  ),
0769 
0770         TP_fast_assign(
0771             __entry->call = call->debug_id;
0772             __entry->op = call->operation_ID;
0773             if (fid) {
0774                 __entry->fid = *fid;
0775             } else {
0776                 __entry->fid.vid = 0;
0777                 __entry->fid.vnode = 0;
0778                 __entry->fid.unique = 0;
0779             }
0780                ),
0781 
0782         TP_printk("c=%08x %06llx:%06llx:%06x %s",
0783               __entry->call,
0784               __entry->fid.vid,
0785               __entry->fid.vnode,
0786               __entry->fid.unique,
0787               __print_symbolic(__entry->op, afs_fs_operations))
0788         );
0789 
0790 TRACE_EVENT(afs_make_fs_calli,
0791         TP_PROTO(struct afs_call *call, const struct afs_fid *fid,
0792              unsigned int i),
0793 
0794         TP_ARGS(call, fid, i),
0795 
0796         TP_STRUCT__entry(
0797             __field(unsigned int,       call        )
0798             __field(unsigned int,       i       )
0799             __field(enum afs_fs_operation,  op      )
0800             __field_struct(struct afs_fid,  fid     )
0801                  ),
0802 
0803         TP_fast_assign(
0804             __entry->call = call->debug_id;
0805             __entry->i = i;
0806             __entry->op = call->operation_ID;
0807             if (fid) {
0808                 __entry->fid = *fid;
0809             } else {
0810                 __entry->fid.vid = 0;
0811                 __entry->fid.vnode = 0;
0812                 __entry->fid.unique = 0;
0813             }
0814                ),
0815 
0816         TP_printk("c=%08x %06llx:%06llx:%06x %s i=%u",
0817               __entry->call,
0818               __entry->fid.vid,
0819               __entry->fid.vnode,
0820               __entry->fid.unique,
0821               __print_symbolic(__entry->op, afs_fs_operations),
0822               __entry->i)
0823         );
0824 
0825 TRACE_EVENT(afs_make_fs_call1,
0826         TP_PROTO(struct afs_call *call, const struct afs_fid *fid,
0827              const struct qstr *name),
0828 
0829         TP_ARGS(call, fid, name),
0830 
0831         TP_STRUCT__entry(
0832             __field(unsigned int,       call        )
0833             __field(enum afs_fs_operation,  op      )
0834             __field_struct(struct afs_fid,  fid     )
0835             __array(char,           name, 24    )
0836                  ),
0837 
0838         TP_fast_assign(
0839             unsigned int __len = min_t(unsigned int, name->len, 23);
0840             __entry->call = call->debug_id;
0841             __entry->op = call->operation_ID;
0842             if (fid) {
0843                 __entry->fid = *fid;
0844             } else {
0845                 __entry->fid.vid = 0;
0846                 __entry->fid.vnode = 0;
0847                 __entry->fid.unique = 0;
0848             }
0849             memcpy(__entry->name, name->name, __len);
0850             __entry->name[__len] = 0;
0851                ),
0852 
0853         TP_printk("c=%08x %06llx:%06llx:%06x %s \"%s\"",
0854               __entry->call,
0855               __entry->fid.vid,
0856               __entry->fid.vnode,
0857               __entry->fid.unique,
0858               __print_symbolic(__entry->op, afs_fs_operations),
0859               __entry->name)
0860         );
0861 
0862 TRACE_EVENT(afs_make_fs_call2,
0863         TP_PROTO(struct afs_call *call, const struct afs_fid *fid,
0864              const struct qstr *name, const struct qstr *name2),
0865 
0866         TP_ARGS(call, fid, name, name2),
0867 
0868         TP_STRUCT__entry(
0869             __field(unsigned int,       call        )
0870             __field(enum afs_fs_operation,  op      )
0871             __field_struct(struct afs_fid,  fid     )
0872             __array(char,           name, 24    )
0873             __array(char,           name2, 24   )
0874                  ),
0875 
0876         TP_fast_assign(
0877             unsigned int __len = min_t(unsigned int, name->len, 23);
0878             unsigned int __len2 = min_t(unsigned int, name2->len, 23);
0879             __entry->call = call->debug_id;
0880             __entry->op = call->operation_ID;
0881             if (fid) {
0882                 __entry->fid = *fid;
0883             } else {
0884                 __entry->fid.vid = 0;
0885                 __entry->fid.vnode = 0;
0886                 __entry->fid.unique = 0;
0887             }
0888             memcpy(__entry->name, name->name, __len);
0889             __entry->name[__len] = 0;
0890             memcpy(__entry->name2, name2->name, __len2);
0891             __entry->name2[__len2] = 0;
0892                ),
0893 
0894         TP_printk("c=%08x %06llx:%06llx:%06x %s \"%s\" \"%s\"",
0895               __entry->call,
0896               __entry->fid.vid,
0897               __entry->fid.vnode,
0898               __entry->fid.unique,
0899               __print_symbolic(__entry->op, afs_fs_operations),
0900               __entry->name,
0901               __entry->name2)
0902         );
0903 
0904 TRACE_EVENT(afs_make_vl_call,
0905         TP_PROTO(struct afs_call *call),
0906 
0907         TP_ARGS(call),
0908 
0909         TP_STRUCT__entry(
0910             __field(unsigned int,       call        )
0911             __field(enum afs_vl_operation,  op      )
0912                  ),
0913 
0914         TP_fast_assign(
0915             __entry->call = call->debug_id;
0916             __entry->op = call->operation_ID;
0917                ),
0918 
0919         TP_printk("c=%08x %s",
0920               __entry->call,
0921               __print_symbolic(__entry->op, afs_vl_operations))
0922         );
0923 
0924 TRACE_EVENT(afs_call_done,
0925         TP_PROTO(struct afs_call *call),
0926 
0927         TP_ARGS(call),
0928 
0929         TP_STRUCT__entry(
0930             __field(unsigned int,       call        )
0931             __field(struct rxrpc_call *,    rx_call     )
0932             __field(int,            ret     )
0933             __field(u32,            abort_code  )
0934                  ),
0935 
0936         TP_fast_assign(
0937             __entry->call = call->debug_id;
0938             __entry->rx_call = call->rxcall;
0939             __entry->ret = call->error;
0940             __entry->abort_code = call->abort_code;
0941                ),
0942 
0943         TP_printk("   c=%08x ret=%d ab=%d [%p]",
0944               __entry->call,
0945               __entry->ret,
0946               __entry->abort_code,
0947               __entry->rx_call)
0948         );
0949 
0950 TRACE_EVENT(afs_send_data,
0951         TP_PROTO(struct afs_call *call, struct msghdr *msg),
0952 
0953         TP_ARGS(call, msg),
0954 
0955         TP_STRUCT__entry(
0956             __field(unsigned int,       call        )
0957             __field(unsigned int,       flags       )
0958             __field(loff_t,         offset      )
0959             __field(loff_t,         count       )
0960                  ),
0961 
0962         TP_fast_assign(
0963             __entry->call = call->debug_id;
0964             __entry->flags = msg->msg_flags;
0965             __entry->offset = msg->msg_iter.xarray_start + msg->msg_iter.iov_offset;
0966             __entry->count = iov_iter_count(&msg->msg_iter);
0967                ),
0968 
0969         TP_printk(" c=%08x o=%llx n=%llx f=%x",
0970               __entry->call, __entry->offset, __entry->count,
0971               __entry->flags)
0972         );
0973 
0974 TRACE_EVENT(afs_sent_data,
0975         TP_PROTO(struct afs_call *call, struct msghdr *msg, int ret),
0976 
0977         TP_ARGS(call, msg, ret),
0978 
0979         TP_STRUCT__entry(
0980             __field(unsigned int,       call        )
0981             __field(int,            ret     )
0982             __field(loff_t,         offset      )
0983             __field(loff_t,         count       )
0984                  ),
0985 
0986         TP_fast_assign(
0987             __entry->call = call->debug_id;
0988             __entry->ret = ret;
0989             __entry->offset = msg->msg_iter.xarray_start + msg->msg_iter.iov_offset;
0990             __entry->count = iov_iter_count(&msg->msg_iter);
0991                ),
0992 
0993         TP_printk(" c=%08x o=%llx n=%llx r=%x",
0994               __entry->call, __entry->offset, __entry->count,
0995               __entry->ret)
0996         );
0997 
0998 TRACE_EVENT(afs_dir_check_failed,
0999         TP_PROTO(struct afs_vnode *vnode, loff_t off, loff_t i_size),
1000 
1001         TP_ARGS(vnode, off, i_size),
1002 
1003         TP_STRUCT__entry(
1004             __field(struct afs_vnode *,     vnode       )
1005             __field(loff_t,         off     )
1006             __field(loff_t,         i_size      )
1007                  ),
1008 
1009         TP_fast_assign(
1010             __entry->vnode = vnode;
1011             __entry->off = off;
1012             __entry->i_size = i_size;
1013                ),
1014 
1015         TP_printk("vn=%p %llx/%llx",
1016               __entry->vnode, __entry->off, __entry->i_size)
1017         );
1018 
1019 TRACE_EVENT(afs_folio_dirty,
1020         TP_PROTO(struct afs_vnode *vnode, const char *where, struct folio *folio),
1021 
1022         TP_ARGS(vnode, where, folio),
1023 
1024         TP_STRUCT__entry(
1025             __field(struct afs_vnode *,     vnode       )
1026             __field(const char *,       where       )
1027             __field(pgoff_t,            index       )
1028             __field(unsigned long,      from        )
1029             __field(unsigned long,      to      )
1030                  ),
1031 
1032         TP_fast_assign(
1033             unsigned long priv = (unsigned long)folio_get_private(folio);
1034             __entry->vnode = vnode;
1035             __entry->where = where;
1036             __entry->index = folio_index(folio);
1037             __entry->from  = afs_folio_dirty_from(folio, priv);
1038             __entry->to    = afs_folio_dirty_to(folio, priv);
1039             __entry->to   |= (afs_is_folio_dirty_mmapped(priv) ?
1040                       (1UL << (BITS_PER_LONG - 1)) : 0);
1041                ),
1042 
1043         TP_printk("vn=%p %lx %s %lx-%lx%s",
1044               __entry->vnode, __entry->index, __entry->where,
1045               __entry->from,
1046               __entry->to & ~(1UL << (BITS_PER_LONG - 1)),
1047               __entry->to & (1UL << (BITS_PER_LONG - 1)) ? " M" : "")
1048         );
1049 
1050 TRACE_EVENT(afs_call_state,
1051         TP_PROTO(struct afs_call *call,
1052              enum afs_call_state from,
1053              enum afs_call_state to,
1054              int ret, u32 remote_abort),
1055 
1056         TP_ARGS(call, from, to, ret, remote_abort),
1057 
1058         TP_STRUCT__entry(
1059             __field(unsigned int,       call        )
1060             __field(enum afs_call_state,    from        )
1061             __field(enum afs_call_state,    to      )
1062             __field(int,            ret     )
1063             __field(u32,            abort       )
1064                  ),
1065 
1066         TP_fast_assign(
1067             __entry->call = call->debug_id;
1068             __entry->from = from;
1069             __entry->to = to;
1070             __entry->ret = ret;
1071             __entry->abort = remote_abort;
1072                ),
1073 
1074         TP_printk("c=%08x %u->%u r=%d ab=%d",
1075               __entry->call,
1076               __entry->from, __entry->to,
1077               __entry->ret, __entry->abort)
1078         );
1079 
1080 TRACE_EVENT(afs_lookup,
1081         TP_PROTO(struct afs_vnode *dvnode, const struct qstr *name,
1082              struct afs_fid *fid),
1083 
1084         TP_ARGS(dvnode, name, fid),
1085 
1086         TP_STRUCT__entry(
1087             __field_struct(struct afs_fid,  dfid        )
1088             __field_struct(struct afs_fid,  fid     )
1089             __array(char,           name, 24    )
1090                  ),
1091 
1092         TP_fast_assign(
1093             int __len = min_t(int, name->len, 23);
1094             __entry->dfid = dvnode->fid;
1095             __entry->fid = *fid;
1096             memcpy(__entry->name, name->name, __len);
1097             __entry->name[__len] = 0;
1098                ),
1099 
1100         TP_printk("d=%llx:%llx:%x \"%s\" f=%llx:%x",
1101               __entry->dfid.vid, __entry->dfid.vnode, __entry->dfid.unique,
1102               __entry->name,
1103               __entry->fid.vnode, __entry->fid.unique)
1104         );
1105 
1106 TRACE_EVENT(afs_edit_dir,
1107         TP_PROTO(struct afs_vnode *dvnode,
1108              enum afs_edit_dir_reason why,
1109              enum afs_edit_dir_op op,
1110              unsigned int block,
1111              unsigned int slot,
1112              unsigned int f_vnode,
1113              unsigned int f_unique,
1114              const char *name),
1115 
1116         TP_ARGS(dvnode, why, op, block, slot, f_vnode, f_unique, name),
1117 
1118         TP_STRUCT__entry(
1119             __field(unsigned int,       vnode       )
1120             __field(unsigned int,       unique      )
1121             __field(enum afs_edit_dir_reason,   why     )
1122             __field(enum afs_edit_dir_op,   op      )
1123             __field(unsigned int,       block       )
1124             __field(unsigned short,     slot        )
1125             __field(unsigned int,       f_vnode     )
1126             __field(unsigned int,       f_unique    )
1127             __array(char,           name, 24    )
1128                  ),
1129 
1130         TP_fast_assign(
1131             int __len = strlen(name);
1132             __len = min(__len, 23);
1133             __entry->vnode  = dvnode->fid.vnode;
1134             __entry->unique = dvnode->fid.unique;
1135             __entry->why    = why;
1136             __entry->op     = op;
1137             __entry->block  = block;
1138             __entry->slot   = slot;
1139             __entry->f_vnode    = f_vnode;
1140             __entry->f_unique   = f_unique;
1141             memcpy(__entry->name, name, __len);
1142             __entry->name[__len] = 0;
1143                ),
1144 
1145         TP_printk("d=%x:%x %s %s %u[%u] f=%x:%x \"%s\"",
1146               __entry->vnode, __entry->unique,
1147               __print_symbolic(__entry->why, afs_edit_dir_reasons),
1148               __print_symbolic(__entry->op, afs_edit_dir_ops),
1149               __entry->block, __entry->slot,
1150               __entry->f_vnode, __entry->f_unique,
1151               __entry->name)
1152         );
1153 
1154 TRACE_EVENT(afs_protocol_error,
1155         TP_PROTO(struct afs_call *call, enum afs_eproto_cause cause),
1156 
1157         TP_ARGS(call, cause),
1158 
1159         TP_STRUCT__entry(
1160             __field(unsigned int,       call        )
1161             __field(enum afs_eproto_cause,  cause       )
1162                  ),
1163 
1164         TP_fast_assign(
1165             __entry->call = call ? call->debug_id : 0;
1166             __entry->cause = cause;
1167                ),
1168 
1169         TP_printk("c=%08x %s",
1170               __entry->call,
1171               __print_symbolic(__entry->cause, afs_eproto_causes))
1172         );
1173 
1174 TRACE_EVENT(afs_io_error,
1175         TP_PROTO(unsigned int call, int error, enum afs_io_error where),
1176 
1177         TP_ARGS(call, error, where),
1178 
1179         TP_STRUCT__entry(
1180             __field(unsigned int,   call        )
1181             __field(int,        error       )
1182             __field(enum afs_io_error,  where       )
1183                  ),
1184 
1185         TP_fast_assign(
1186             __entry->call = call;
1187             __entry->error = error;
1188             __entry->where = where;
1189                ),
1190 
1191         TP_printk("c=%08x r=%d %s",
1192               __entry->call, __entry->error,
1193               __print_symbolic(__entry->where, afs_io_errors))
1194         );
1195 
1196 TRACE_EVENT(afs_file_error,
1197         TP_PROTO(struct afs_vnode *vnode, int error, enum afs_file_error where),
1198 
1199         TP_ARGS(vnode, error, where),
1200 
1201         TP_STRUCT__entry(
1202             __field_struct(struct afs_fid,  fid     )
1203             __field(int,            error       )
1204             __field(enum afs_file_error,    where       )
1205                  ),
1206 
1207         TP_fast_assign(
1208             __entry->fid = vnode->fid;
1209             __entry->error = error;
1210             __entry->where = where;
1211                ),
1212 
1213         TP_printk("%llx:%llx:%x r=%d %s",
1214               __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1215               __entry->error,
1216               __print_symbolic(__entry->where, afs_file_errors))
1217         );
1218 
1219 TRACE_EVENT(afs_cm_no_server,
1220         TP_PROTO(struct afs_call *call, struct sockaddr_rxrpc *srx),
1221 
1222         TP_ARGS(call, srx),
1223 
1224         TP_STRUCT__entry(
1225             __field(unsigned int,           call    )
1226             __field(unsigned int,           op_id   )
1227             __field_struct(struct sockaddr_rxrpc,   srx )
1228                  ),
1229 
1230         TP_fast_assign(
1231             __entry->call = call->debug_id;
1232             __entry->op_id = call->operation_ID;
1233             memcpy(&__entry->srx, srx, sizeof(__entry->srx));
1234                ),
1235 
1236         TP_printk("c=%08x op=%u %pISpc",
1237               __entry->call, __entry->op_id, &__entry->srx.transport)
1238         );
1239 
1240 TRACE_EVENT(afs_cm_no_server_u,
1241         TP_PROTO(struct afs_call *call, const uuid_t *uuid),
1242 
1243         TP_ARGS(call, uuid),
1244 
1245         TP_STRUCT__entry(
1246             __field(unsigned int,           call    )
1247             __field(unsigned int,           op_id   )
1248             __field_struct(uuid_t,          uuid    )
1249                  ),
1250 
1251         TP_fast_assign(
1252             __entry->call = call->debug_id;
1253             __entry->op_id = call->operation_ID;
1254             memcpy(&__entry->uuid, uuid, sizeof(__entry->uuid));
1255                ),
1256 
1257         TP_printk("c=%08x op=%u %pU",
1258               __entry->call, __entry->op_id, &__entry->uuid)
1259         );
1260 
1261 TRACE_EVENT(afs_flock_ev,
1262         TP_PROTO(struct afs_vnode *vnode, struct file_lock *fl,
1263              enum afs_flock_event event, int error),
1264 
1265         TP_ARGS(vnode, fl, event, error),
1266 
1267         TP_STRUCT__entry(
1268             __field_struct(struct afs_fid,  fid     )
1269             __field(enum afs_flock_event,   event       )
1270             __field(enum afs_lock_state,    state       )
1271             __field(int,            error       )
1272             __field(unsigned int,       debug_id    )
1273                  ),
1274 
1275         TP_fast_assign(
1276             __entry->fid = vnode->fid;
1277             __entry->event = event;
1278             __entry->state = vnode->lock_state;
1279             __entry->error = error;
1280             __entry->debug_id = fl ? fl->fl_u.afs.debug_id : 0;
1281                ),
1282 
1283         TP_printk("%llx:%llx:%x %04x %s s=%s e=%d",
1284               __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1285               __entry->debug_id,
1286               __print_symbolic(__entry->event, afs_flock_events),
1287               __print_symbolic(__entry->state, afs_flock_states),
1288               __entry->error)
1289         );
1290 
1291 TRACE_EVENT(afs_flock_op,
1292         TP_PROTO(struct afs_vnode *vnode, struct file_lock *fl,
1293              enum afs_flock_operation op),
1294 
1295         TP_ARGS(vnode, fl, op),
1296 
1297         TP_STRUCT__entry(
1298             __field_struct(struct afs_fid,  fid     )
1299             __field(loff_t,         from        )
1300             __field(loff_t,         len     )
1301             __field(enum afs_flock_operation,   op      )
1302             __field(unsigned char,      type        )
1303             __field(unsigned int,       flags       )
1304             __field(unsigned int,       debug_id    )
1305                  ),
1306 
1307         TP_fast_assign(
1308             __entry->fid = vnode->fid;
1309             __entry->from = fl->fl_start;
1310             __entry->len = fl->fl_end - fl->fl_start + 1;
1311             __entry->op = op;
1312             __entry->type = fl->fl_type;
1313             __entry->flags = fl->fl_flags;
1314             __entry->debug_id = fl->fl_u.afs.debug_id;
1315                ),
1316 
1317         TP_printk("%llx:%llx:%x %04x %s t=%s R=%llx/%llx f=%x",
1318               __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1319               __entry->debug_id,
1320               __print_symbolic(__entry->op, afs_flock_operations),
1321               __print_symbolic(__entry->type, afs_flock_types),
1322               __entry->from, __entry->len, __entry->flags)
1323         );
1324 
1325 TRACE_EVENT(afs_reload_dir,
1326         TP_PROTO(struct afs_vnode *vnode),
1327 
1328         TP_ARGS(vnode),
1329 
1330         TP_STRUCT__entry(
1331             __field_struct(struct afs_fid,  fid     )
1332                  ),
1333 
1334         TP_fast_assign(
1335             __entry->fid = vnode->fid;
1336                ),
1337 
1338         TP_printk("%llx:%llx:%x",
1339               __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique)
1340         );
1341 
1342 TRACE_EVENT(afs_silly_rename,
1343         TP_PROTO(struct afs_vnode *vnode, bool done),
1344 
1345         TP_ARGS(vnode, done),
1346 
1347         TP_STRUCT__entry(
1348             __field_struct(struct afs_fid,  fid     )
1349             __field(bool,           done        )
1350                  ),
1351 
1352         TP_fast_assign(
1353             __entry->fid = vnode->fid;
1354             __entry->done = done;
1355                ),
1356 
1357         TP_printk("%llx:%llx:%x done=%u",
1358               __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1359               __entry->done)
1360         );
1361 
1362 TRACE_EVENT(afs_get_tree,
1363         TP_PROTO(struct afs_cell *cell, struct afs_volume *volume),
1364 
1365         TP_ARGS(cell, volume),
1366 
1367         TP_STRUCT__entry(
1368             __field(u64,            vid     )
1369             __array(char,           cell, 24    )
1370             __array(char,           volume, 24  )
1371                  ),
1372 
1373         TP_fast_assign(
1374             int __len;
1375             __entry->vid = volume->vid;
1376             __len = min_t(int, cell->name_len, 23);
1377             memcpy(__entry->cell, cell->name, __len);
1378             __entry->cell[__len] = 0;
1379             __len = min_t(int, volume->name_len, 23);
1380             memcpy(__entry->volume, volume->name, __len);
1381             __entry->volume[__len] = 0;
1382                ),
1383 
1384         TP_printk("--- MOUNT %s:%s %llx",
1385               __entry->cell, __entry->volume, __entry->vid)
1386         );
1387 
1388 TRACE_EVENT(afs_cb_break,
1389         TP_PROTO(struct afs_fid *fid, unsigned int cb_break,
1390              enum afs_cb_break_reason reason, bool skipped),
1391 
1392         TP_ARGS(fid, cb_break, reason, skipped),
1393 
1394         TP_STRUCT__entry(
1395             __field_struct(struct afs_fid,  fid     )
1396             __field(unsigned int,       cb_break    )
1397             __field(enum afs_cb_break_reason,   reason      )
1398             __field(bool,           skipped     )
1399                  ),
1400 
1401         TP_fast_assign(
1402             __entry->fid    = *fid;
1403             __entry->cb_break   = cb_break;
1404             __entry->reason = reason;
1405             __entry->skipped    = skipped;
1406                ),
1407 
1408         TP_printk("%llx:%llx:%x b=%x s=%u %s",
1409               __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1410               __entry->cb_break,
1411               __entry->skipped,
1412               __print_symbolic(__entry->reason, afs_cb_break_reasons))
1413         );
1414 
1415 TRACE_EVENT(afs_cb_miss,
1416         TP_PROTO(struct afs_fid *fid, enum afs_cb_break_reason reason),
1417 
1418         TP_ARGS(fid, reason),
1419 
1420         TP_STRUCT__entry(
1421             __field_struct(struct afs_fid,  fid     )
1422             __field(enum afs_cb_break_reason,   reason      )
1423                  ),
1424 
1425         TP_fast_assign(
1426             __entry->fid    = *fid;
1427             __entry->reason = reason;
1428                ),
1429 
1430         TP_printk(" %llx:%llx:%x %s",
1431               __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique,
1432               __print_symbolic(__entry->reason, afs_cb_break_reasons))
1433         );
1434 
1435 TRACE_EVENT(afs_server,
1436         TP_PROTO(unsigned int server_debug_id, int ref, int active,
1437              enum afs_server_trace reason),
1438 
1439         TP_ARGS(server_debug_id, ref, active, reason),
1440 
1441         TP_STRUCT__entry(
1442             __field(unsigned int,       server      )
1443             __field(int,            ref     )
1444             __field(int,            active      )
1445             __field(int,            reason      )
1446                  ),
1447 
1448         TP_fast_assign(
1449             __entry->server = server_debug_id;
1450             __entry->ref = ref;
1451             __entry->active = active;
1452             __entry->reason = reason;
1453                ),
1454 
1455         TP_printk("s=%08x %s u=%d a=%d",
1456               __entry->server,
1457               __print_symbolic(__entry->reason, afs_server_traces),
1458               __entry->ref,
1459               __entry->active)
1460         );
1461 
1462 TRACE_EVENT(afs_volume,
1463         TP_PROTO(afs_volid_t vid, int ref, enum afs_volume_trace reason),
1464 
1465         TP_ARGS(vid, ref, reason),
1466 
1467         TP_STRUCT__entry(
1468             __field(afs_volid_t,        vid     )
1469             __field(int,            ref     )
1470             __field(enum afs_volume_trace,  reason      )
1471                  ),
1472 
1473         TP_fast_assign(
1474             __entry->vid = vid;
1475             __entry->ref = ref;
1476             __entry->reason = reason;
1477                ),
1478 
1479         TP_printk("V=%llx %s ur=%d",
1480               __entry->vid,
1481               __print_symbolic(__entry->reason, afs_volume_traces),
1482               __entry->ref)
1483         );
1484 
1485 TRACE_EVENT(afs_cell,
1486         TP_PROTO(unsigned int cell_debug_id, int ref, int active,
1487              enum afs_cell_trace reason),
1488 
1489         TP_ARGS(cell_debug_id, ref, active, reason),
1490 
1491         TP_STRUCT__entry(
1492             __field(unsigned int,       cell        )
1493             __field(int,            ref     )
1494             __field(int,            active      )
1495             __field(int,            reason      )
1496                  ),
1497 
1498         TP_fast_assign(
1499             __entry->cell = cell_debug_id;
1500             __entry->ref = ref;
1501             __entry->active = active;
1502             __entry->reason = reason;
1503                ),
1504 
1505         TP_printk("L=%08x %s r=%d a=%d",
1506               __entry->cell,
1507               __print_symbolic(__entry->reason, afs_cell_traces),
1508               __entry->ref,
1509               __entry->active)
1510         );
1511 
1512 #endif /* _TRACE_AFS_H */
1513 
1514 /* This part must be outside protection */
1515 #include <trace/define_trace.h>