18e8d7f13SDavid Howells /* AFS tracepoints 28e8d7f13SDavid Howells * 38e8d7f13SDavid Howells * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved. 48e8d7f13SDavid Howells * Written by David Howells (dhowells@redhat.com) 58e8d7f13SDavid Howells * 68e8d7f13SDavid Howells * This program is free software; you can redistribute it and/or 78e8d7f13SDavid Howells * modify it under the terms of the GNU General Public Licence 88e8d7f13SDavid Howells * as published by the Free Software Foundation; either version 98e8d7f13SDavid Howells * 2 of the Licence, or (at your option) any later version. 108e8d7f13SDavid Howells */ 118e8d7f13SDavid Howells #undef TRACE_SYSTEM 128e8d7f13SDavid Howells #define TRACE_SYSTEM afs 138e8d7f13SDavid Howells 148e8d7f13SDavid Howells #if !defined(_TRACE_AFS_H) || defined(TRACE_HEADER_MULTI_READ) 158e8d7f13SDavid Howells #define _TRACE_AFS_H 168e8d7f13SDavid Howells 178e8d7f13SDavid Howells #include <linux/tracepoint.h> 188e8d7f13SDavid Howells 19341f741fSDavid Howells /* 20341f741fSDavid Howells * Define enums for tracing information. 21341f741fSDavid Howells */ 22341f741fSDavid Howells #ifndef __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY 23341f741fSDavid Howells #define __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY 24341f741fSDavid Howells 25341f741fSDavid Howells enum afs_call_trace { 26341f741fSDavid Howells afs_call_trace_alloc, 27341f741fSDavid Howells afs_call_trace_free, 2834fa4761SDavid Howells afs_call_trace_get, 29341f741fSDavid Howells afs_call_trace_put, 30341f741fSDavid Howells afs_call_trace_wake, 31341f741fSDavid Howells afs_call_trace_work, 32341f741fSDavid Howells }; 33341f741fSDavid Howells 34025db80cSDavid Howells enum afs_fs_operation { 35025db80cSDavid Howells afs_FS_FetchData = 130, /* AFS Fetch file data */ 36025db80cSDavid Howells afs_FS_FetchStatus = 132, /* AFS Fetch file status */ 37025db80cSDavid Howells afs_FS_StoreData = 133, /* AFS Store file data */ 38025db80cSDavid Howells afs_FS_StoreStatus = 135, /* AFS Store file status */ 39025db80cSDavid Howells afs_FS_RemoveFile = 136, /* AFS Remove a file */ 40025db80cSDavid Howells afs_FS_CreateFile = 137, /* AFS Create a file */ 41025db80cSDavid Howells afs_FS_Rename = 138, /* AFS Rename or move a file or directory */ 42025db80cSDavid Howells afs_FS_Symlink = 139, /* AFS Create a symbolic link */ 43025db80cSDavid Howells afs_FS_Link = 140, /* AFS Create a hard link */ 44025db80cSDavid Howells afs_FS_MakeDir = 141, /* AFS Create a directory */ 45025db80cSDavid Howells afs_FS_RemoveDir = 142, /* AFS Remove a directory */ 46025db80cSDavid Howells afs_FS_GetVolumeInfo = 148, /* AFS Get information about a volume */ 47025db80cSDavid Howells afs_FS_GetVolumeStatus = 149, /* AFS Get volume status information */ 48025db80cSDavid Howells afs_FS_GetRootVolume = 151, /* AFS Get root volume name */ 49025db80cSDavid Howells afs_FS_SetLock = 156, /* AFS Request a file lock */ 50025db80cSDavid Howells afs_FS_ExtendLock = 157, /* AFS Extend a file lock */ 51025db80cSDavid Howells afs_FS_ReleaseLock = 158, /* AFS Release a file lock */ 52025db80cSDavid Howells afs_FS_Lookup = 161, /* AFS lookup file in directory */ 535cf9dd55SDavid Howells afs_FS_InlineBulkStatus = 65536, /* AFS Fetch multiple file statuses with errors */ 54025db80cSDavid Howells afs_FS_FetchData64 = 65537, /* AFS Fetch file data */ 55025db80cSDavid Howells afs_FS_StoreData64 = 65538, /* AFS Store file data */ 56025db80cSDavid Howells afs_FS_GiveUpAllCallBacks = 65539, /* AFS Give up all our callbacks on a server */ 57025db80cSDavid Howells afs_FS_GetCapabilities = 65540, /* AFS Get FS server capabilities */ 5830062bd1SDavid Howells 5930062bd1SDavid Howells yfs_FS_FetchData = 130, /* YFS Fetch file data */ 6030062bd1SDavid Howells yfs_FS_FetchACL = 64131, /* YFS Fetch file ACL */ 6130062bd1SDavid Howells yfs_FS_FetchStatus = 64132, /* YFS Fetch file status */ 6230062bd1SDavid Howells yfs_FS_StoreACL = 64134, /* YFS Store file ACL */ 6330062bd1SDavid Howells yfs_FS_StoreStatus = 64135, /* YFS Store file status */ 6430062bd1SDavid Howells yfs_FS_RemoveFile = 64136, /* YFS Remove a file */ 6530062bd1SDavid Howells yfs_FS_CreateFile = 64137, /* YFS Create a file */ 6630062bd1SDavid Howells yfs_FS_Rename = 64138, /* YFS Rename or move a file or directory */ 6730062bd1SDavid Howells yfs_FS_Symlink = 64139, /* YFS Create a symbolic link */ 6830062bd1SDavid Howells yfs_FS_Link = 64140, /* YFS Create a hard link */ 6930062bd1SDavid Howells yfs_FS_MakeDir = 64141, /* YFS Create a directory */ 7030062bd1SDavid Howells yfs_FS_RemoveDir = 64142, /* YFS Remove a directory */ 7130062bd1SDavid Howells yfs_FS_GetVolumeStatus = 64149, /* YFS Get volume status information */ 7230062bd1SDavid Howells yfs_FS_SetVolumeStatus = 64150, /* YFS Set volume status information */ 7330062bd1SDavid Howells yfs_FS_SetLock = 64156, /* YFS Request a file lock */ 7430062bd1SDavid Howells yfs_FS_ExtendLock = 64157, /* YFS Extend a file lock */ 7530062bd1SDavid Howells yfs_FS_ReleaseLock = 64158, /* YFS Release a file lock */ 7630062bd1SDavid Howells yfs_FS_Lookup = 64161, /* YFS lookup file in directory */ 7730062bd1SDavid Howells yfs_FS_FlushCPS = 64165, 7830062bd1SDavid Howells yfs_FS_FetchOpaqueACL = 64168, 7930062bd1SDavid Howells yfs_FS_WhoAmI = 64170, 8030062bd1SDavid Howells yfs_FS_RemoveACL = 64171, 8130062bd1SDavid Howells yfs_FS_RemoveFile2 = 64173, 8230062bd1SDavid Howells yfs_FS_StoreOpaqueACL2 = 64174, 8330062bd1SDavid Howells yfs_FS_InlineBulkStatus = 64536, /* YFS Fetch multiple file statuses with errors */ 8430062bd1SDavid Howells yfs_FS_FetchData64 = 64537, /* YFS Fetch file data */ 8530062bd1SDavid Howells yfs_FS_StoreData64 = 64538, /* YFS Store file data */ 8630062bd1SDavid Howells yfs_FS_UpdateSymlink = 64540, 87025db80cSDavid Howells }; 88025db80cSDavid Howells 89025db80cSDavid Howells enum afs_vl_operation { 90025db80cSDavid Howells afs_VL_GetEntryByNameU = 527, /* AFS Get Vol Entry By Name operation ID */ 91025db80cSDavid Howells afs_VL_GetAddrsU = 533, /* AFS Get FS server addresses */ 92025db80cSDavid Howells afs_YFSVL_GetEndpoints = 64002, /* YFS Get FS & Vol server addresses */ 93025db80cSDavid Howells afs_VL_GetCapabilities = 65537, /* AFS Get VL server capabilities */ 94025db80cSDavid Howells }; 95025db80cSDavid Howells 9663a4681fSDavid Howells enum afs_edit_dir_op { 9763a4681fSDavid Howells afs_edit_dir_create, 9863a4681fSDavid Howells afs_edit_dir_create_error, 9963a4681fSDavid Howells afs_edit_dir_create_inval, 10063a4681fSDavid Howells afs_edit_dir_create_nospc, 10163a4681fSDavid Howells afs_edit_dir_delete, 10263a4681fSDavid Howells afs_edit_dir_delete_error, 10363a4681fSDavid Howells afs_edit_dir_delete_inval, 10463a4681fSDavid Howells afs_edit_dir_delete_noent, 10563a4681fSDavid Howells }; 10663a4681fSDavid Howells 10763a4681fSDavid Howells enum afs_edit_dir_reason { 10863a4681fSDavid Howells afs_edit_dir_for_create, 10963a4681fSDavid Howells afs_edit_dir_for_link, 11063a4681fSDavid Howells afs_edit_dir_for_mkdir, 11163a4681fSDavid Howells afs_edit_dir_for_rename, 11263a4681fSDavid Howells afs_edit_dir_for_rmdir, 11363a4681fSDavid Howells afs_edit_dir_for_symlink, 11463a4681fSDavid Howells afs_edit_dir_for_unlink, 11563a4681fSDavid Howells }; 11663a4681fSDavid Howells 117160cb957SDavid Howells enum afs_eproto_cause { 118160cb957SDavid Howells afs_eproto_bad_status, 119160cb957SDavid Howells afs_eproto_cb_count, 120160cb957SDavid Howells afs_eproto_cb_fid_count, 121160cb957SDavid Howells afs_eproto_file_type, 122160cb957SDavid Howells afs_eproto_ibulkst_cb_count, 123160cb957SDavid Howells afs_eproto_ibulkst_count, 124160cb957SDavid Howells afs_eproto_motd_len, 125160cb957SDavid Howells afs_eproto_offline_msg_len, 126160cb957SDavid Howells afs_eproto_volname_len, 127160cb957SDavid Howells afs_eproto_yvl_fsendpt4_len, 128160cb957SDavid Howells afs_eproto_yvl_fsendpt6_len, 129160cb957SDavid Howells afs_eproto_yvl_fsendpt_num, 130160cb957SDavid Howells afs_eproto_yvl_fsendpt_type, 131160cb957SDavid Howells afs_eproto_yvl_vlendpt4_len, 132160cb957SDavid Howells afs_eproto_yvl_vlendpt6_len, 133160cb957SDavid Howells afs_eproto_yvl_vlendpt_type, 134160cb957SDavid Howells }; 135160cb957SDavid Howells 136f51375cdSDavid Howells enum afs_io_error { 137f51375cdSDavid Howells afs_io_error_cm_reply, 138f51375cdSDavid Howells afs_io_error_extract, 139f51375cdSDavid Howells afs_io_error_fs_probe_fail, 140f51375cdSDavid Howells afs_io_error_vl_lookup_fail, 1413bf0fb6fSDavid Howells afs_io_error_vl_probe_fail, 142f51375cdSDavid Howells }; 143f51375cdSDavid Howells 144f51375cdSDavid Howells enum afs_file_error { 145f51375cdSDavid Howells afs_file_error_dir_bad_magic, 146f51375cdSDavid Howells afs_file_error_dir_big, 147f51375cdSDavid Howells afs_file_error_dir_missing_page, 148f51375cdSDavid Howells afs_file_error_dir_over_end, 149f51375cdSDavid Howells afs_file_error_dir_small, 150f51375cdSDavid Howells afs_file_error_dir_unmarked_ext, 151f51375cdSDavid Howells afs_file_error_mntpt, 152f51375cdSDavid Howells afs_file_error_writeback_fail, 153f51375cdSDavid Howells }; 154f51375cdSDavid Howells 155*d4696601SDavid Howells enum afs_flock_event { 156*d4696601SDavid Howells afs_flock_acquired, 157*d4696601SDavid Howells afs_flock_callback_break, 158*d4696601SDavid Howells afs_flock_defer_unlock, 159*d4696601SDavid Howells afs_flock_fail_other, 160*d4696601SDavid Howells afs_flock_fail_perm, 161*d4696601SDavid Howells afs_flock_no_lockers, 162*d4696601SDavid Howells afs_flock_timestamp, 163*d4696601SDavid Howells afs_flock_try_to_lock, 164*d4696601SDavid Howells afs_flock_vfs_lock, 165*d4696601SDavid Howells afs_flock_vfs_locking, 166*d4696601SDavid Howells afs_flock_waited, 167*d4696601SDavid Howells afs_flock_waiting, 168*d4696601SDavid Howells afs_flock_work_extending, 169*d4696601SDavid Howells afs_flock_work_retry, 170*d4696601SDavid Howells afs_flock_work_unlocking, 171*d4696601SDavid Howells afs_flock_would_block, 172*d4696601SDavid Howells }; 173*d4696601SDavid Howells 174*d4696601SDavid Howells enum afs_flock_operation { 175*d4696601SDavid Howells afs_flock_op_copy_lock, 176*d4696601SDavid Howells afs_flock_op_flock, 177*d4696601SDavid Howells afs_flock_op_grant, 178*d4696601SDavid Howells afs_flock_op_lock, 179*d4696601SDavid Howells afs_flock_op_release_lock, 180*d4696601SDavid Howells afs_flock_op_return_ok, 181*d4696601SDavid Howells afs_flock_op_return_eagain, 182*d4696601SDavid Howells afs_flock_op_return_edeadlk, 183*d4696601SDavid Howells afs_flock_op_return_error, 184*d4696601SDavid Howells afs_flock_op_set_lock, 185*d4696601SDavid Howells afs_flock_op_unlock, 186*d4696601SDavid Howells afs_flock_op_wake, 187*d4696601SDavid Howells }; 188*d4696601SDavid Howells 189341f741fSDavid Howells #endif /* end __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY */ 190341f741fSDavid Howells 191341f741fSDavid Howells /* 192341f741fSDavid Howells * Declare tracing information enums and their string mappings for display. 193341f741fSDavid Howells */ 194341f741fSDavid Howells #define afs_call_traces \ 195341f741fSDavid Howells EM(afs_call_trace_alloc, "ALLOC") \ 196341f741fSDavid Howells EM(afs_call_trace_free, "FREE ") \ 19734fa4761SDavid Howells EM(afs_call_trace_get, "GET ") \ 198341f741fSDavid Howells EM(afs_call_trace_put, "PUT ") \ 199341f741fSDavid Howells EM(afs_call_trace_wake, "WAKE ") \ 200341f741fSDavid Howells E_(afs_call_trace_work, "WORK ") 201341f741fSDavid Howells 202025db80cSDavid Howells #define afs_fs_operations \ 203025db80cSDavid Howells EM(afs_FS_FetchData, "FS.FetchData") \ 204025db80cSDavid Howells EM(afs_FS_FetchStatus, "FS.FetchStatus") \ 205025db80cSDavid Howells EM(afs_FS_StoreData, "FS.StoreData") \ 206025db80cSDavid Howells EM(afs_FS_StoreStatus, "FS.StoreStatus") \ 207025db80cSDavid Howells EM(afs_FS_RemoveFile, "FS.RemoveFile") \ 208025db80cSDavid Howells EM(afs_FS_CreateFile, "FS.CreateFile") \ 209025db80cSDavid Howells EM(afs_FS_Rename, "FS.Rename") \ 210025db80cSDavid Howells EM(afs_FS_Symlink, "FS.Symlink") \ 211025db80cSDavid Howells EM(afs_FS_Link, "FS.Link") \ 212025db80cSDavid Howells EM(afs_FS_MakeDir, "FS.MakeDir") \ 213025db80cSDavid Howells EM(afs_FS_RemoveDir, "FS.RemoveDir") \ 214025db80cSDavid Howells EM(afs_FS_GetVolumeInfo, "FS.GetVolumeInfo") \ 215025db80cSDavid Howells EM(afs_FS_GetVolumeStatus, "FS.GetVolumeStatus") \ 216025db80cSDavid Howells EM(afs_FS_GetRootVolume, "FS.GetRootVolume") \ 217025db80cSDavid Howells EM(afs_FS_SetLock, "FS.SetLock") \ 218025db80cSDavid Howells EM(afs_FS_ExtendLock, "FS.ExtendLock") \ 219025db80cSDavid Howells EM(afs_FS_ReleaseLock, "FS.ReleaseLock") \ 220025db80cSDavid Howells EM(afs_FS_Lookup, "FS.Lookup") \ 2215cf9dd55SDavid Howells EM(afs_FS_InlineBulkStatus, "FS.InlineBulkStatus") \ 222025db80cSDavid Howells EM(afs_FS_FetchData64, "FS.FetchData64") \ 223025db80cSDavid Howells EM(afs_FS_StoreData64, "FS.StoreData64") \ 224025db80cSDavid Howells EM(afs_FS_GiveUpAllCallBacks, "FS.GiveUpAllCallBacks") \ 22530062bd1SDavid Howells EM(afs_FS_GetCapabilities, "FS.GetCapabilities") \ 22630062bd1SDavid Howells EM(yfs_FS_FetchACL, "YFS.FetchACL") \ 22730062bd1SDavid Howells EM(yfs_FS_FetchStatus, "YFS.FetchStatus") \ 22830062bd1SDavid Howells EM(yfs_FS_StoreACL, "YFS.StoreACL") \ 22930062bd1SDavid Howells EM(yfs_FS_StoreStatus, "YFS.StoreStatus") \ 23030062bd1SDavid Howells EM(yfs_FS_RemoveFile, "YFS.RemoveFile") \ 23130062bd1SDavid Howells EM(yfs_FS_CreateFile, "YFS.CreateFile") \ 23230062bd1SDavid Howells EM(yfs_FS_Rename, "YFS.Rename") \ 23330062bd1SDavid Howells EM(yfs_FS_Symlink, "YFS.Symlink") \ 23430062bd1SDavid Howells EM(yfs_FS_Link, "YFS.Link") \ 23530062bd1SDavid Howells EM(yfs_FS_MakeDir, "YFS.MakeDir") \ 23630062bd1SDavid Howells EM(yfs_FS_RemoveDir, "YFS.RemoveDir") \ 23730062bd1SDavid Howells EM(yfs_FS_GetVolumeStatus, "YFS.GetVolumeStatus") \ 23830062bd1SDavid Howells EM(yfs_FS_SetVolumeStatus, "YFS.SetVolumeStatus") \ 23930062bd1SDavid Howells EM(yfs_FS_SetLock, "YFS.SetLock") \ 24030062bd1SDavid Howells EM(yfs_FS_ExtendLock, "YFS.ExtendLock") \ 24130062bd1SDavid Howells EM(yfs_FS_ReleaseLock, "YFS.ReleaseLock") \ 24230062bd1SDavid Howells EM(yfs_FS_Lookup, "YFS.Lookup") \ 24330062bd1SDavid Howells EM(yfs_FS_FlushCPS, "YFS.FlushCPS") \ 24430062bd1SDavid Howells EM(yfs_FS_FetchOpaqueACL, "YFS.FetchOpaqueACL") \ 24530062bd1SDavid Howells EM(yfs_FS_WhoAmI, "YFS.WhoAmI") \ 24630062bd1SDavid Howells EM(yfs_FS_RemoveACL, "YFS.RemoveACL") \ 24730062bd1SDavid Howells EM(yfs_FS_RemoveFile2, "YFS.RemoveFile2") \ 24830062bd1SDavid Howells EM(yfs_FS_StoreOpaqueACL2, "YFS.StoreOpaqueACL2") \ 24930062bd1SDavid Howells EM(yfs_FS_InlineBulkStatus, "YFS.InlineBulkStatus") \ 25030062bd1SDavid Howells EM(yfs_FS_FetchData64, "YFS.FetchData64") \ 25130062bd1SDavid Howells EM(yfs_FS_StoreData64, "YFS.StoreData64") \ 25230062bd1SDavid Howells E_(yfs_FS_UpdateSymlink, "YFS.UpdateSymlink") 253025db80cSDavid Howells 254025db80cSDavid Howells #define afs_vl_operations \ 255025db80cSDavid Howells EM(afs_VL_GetEntryByNameU, "VL.GetEntryByNameU") \ 256025db80cSDavid Howells EM(afs_VL_GetAddrsU, "VL.GetAddrsU") \ 257025db80cSDavid Howells EM(afs_YFSVL_GetEndpoints, "YFSVL.GetEndpoints") \ 258025db80cSDavid Howells E_(afs_VL_GetCapabilities, "VL.GetCapabilities") 259025db80cSDavid Howells 26063a4681fSDavid Howells #define afs_edit_dir_ops \ 26163a4681fSDavid Howells EM(afs_edit_dir_create, "create") \ 26263a4681fSDavid Howells EM(afs_edit_dir_create_error, "c_fail") \ 26363a4681fSDavid Howells EM(afs_edit_dir_create_inval, "c_invl") \ 26463a4681fSDavid Howells EM(afs_edit_dir_create_nospc, "c_nspc") \ 26563a4681fSDavid Howells EM(afs_edit_dir_delete, "delete") \ 26663a4681fSDavid Howells EM(afs_edit_dir_delete_error, "d_err ") \ 26763a4681fSDavid Howells EM(afs_edit_dir_delete_inval, "d_invl") \ 26863a4681fSDavid Howells E_(afs_edit_dir_delete_noent, "d_nent") 26963a4681fSDavid Howells 27063a4681fSDavid Howells #define afs_edit_dir_reasons \ 27163a4681fSDavid Howells EM(afs_edit_dir_for_create, "Create") \ 27263a4681fSDavid Howells EM(afs_edit_dir_for_link, "Link ") \ 27363a4681fSDavid Howells EM(afs_edit_dir_for_mkdir, "MkDir ") \ 27463a4681fSDavid Howells EM(afs_edit_dir_for_rename, "Rename") \ 27563a4681fSDavid Howells EM(afs_edit_dir_for_rmdir, "RmDir ") \ 27663a4681fSDavid Howells EM(afs_edit_dir_for_symlink, "Symlnk") \ 27763a4681fSDavid Howells E_(afs_edit_dir_for_unlink, "Unlink") 27863a4681fSDavid Howells 279160cb957SDavid Howells #define afs_eproto_causes \ 280160cb957SDavid Howells EM(afs_eproto_bad_status, "BadStatus") \ 281160cb957SDavid Howells EM(afs_eproto_cb_count, "CbCount") \ 282160cb957SDavid Howells EM(afs_eproto_cb_fid_count, "CbFidCount") \ 283160cb957SDavid Howells EM(afs_eproto_file_type, "FileTYpe") \ 284160cb957SDavid Howells EM(afs_eproto_ibulkst_cb_count, "IBS.CbCount") \ 285160cb957SDavid Howells EM(afs_eproto_ibulkst_count, "IBS.FidCount") \ 286160cb957SDavid Howells EM(afs_eproto_motd_len, "MotdLen") \ 287160cb957SDavid Howells EM(afs_eproto_offline_msg_len, "OfflineMsgLen") \ 288160cb957SDavid Howells EM(afs_eproto_volname_len, "VolNameLen") \ 289160cb957SDavid Howells EM(afs_eproto_yvl_fsendpt4_len, "YVL.FsEnd4Len") \ 290160cb957SDavid Howells EM(afs_eproto_yvl_fsendpt6_len, "YVL.FsEnd6Len") \ 291160cb957SDavid Howells EM(afs_eproto_yvl_fsendpt_num, "YVL.FsEndCount") \ 292160cb957SDavid Howells EM(afs_eproto_yvl_fsendpt_type, "YVL.FsEndType") \ 293160cb957SDavid Howells EM(afs_eproto_yvl_vlendpt4_len, "YVL.VlEnd4Len") \ 294160cb957SDavid Howells EM(afs_eproto_yvl_vlendpt6_len, "YVL.VlEnd6Len") \ 295160cb957SDavid Howells E_(afs_eproto_yvl_vlendpt_type, "YVL.VlEndType") 296160cb957SDavid Howells 297f51375cdSDavid Howells #define afs_io_errors \ 298f51375cdSDavid Howells EM(afs_io_error_cm_reply, "CM_REPLY") \ 299f51375cdSDavid Howells EM(afs_io_error_extract, "EXTRACT") \ 300f51375cdSDavid Howells EM(afs_io_error_fs_probe_fail, "FS_PROBE_FAIL") \ 3013bf0fb6fSDavid Howells EM(afs_io_error_vl_lookup_fail, "VL_LOOKUP_FAIL") \ 3023bf0fb6fSDavid Howells E_(afs_io_error_vl_probe_fail, "VL_PROBE_FAIL") 303f51375cdSDavid Howells 304f51375cdSDavid Howells #define afs_file_errors \ 305f51375cdSDavid Howells EM(afs_file_error_dir_bad_magic, "DIR_BAD_MAGIC") \ 306f51375cdSDavid Howells EM(afs_file_error_dir_big, "DIR_BIG") \ 307f51375cdSDavid Howells EM(afs_file_error_dir_missing_page, "DIR_MISSING_PAGE") \ 308f51375cdSDavid Howells EM(afs_file_error_dir_over_end, "DIR_ENT_OVER_END") \ 309f51375cdSDavid Howells EM(afs_file_error_dir_small, "DIR_SMALL") \ 310f51375cdSDavid Howells EM(afs_file_error_dir_unmarked_ext, "DIR_UNMARKED_EXT") \ 311f51375cdSDavid Howells EM(afs_file_error_mntpt, "MNTPT_READ_FAILED") \ 312f51375cdSDavid Howells E_(afs_file_error_writeback_fail, "WRITEBACK_FAILED") 313025db80cSDavid Howells 314*d4696601SDavid Howells #define afs_flock_types \ 315*d4696601SDavid Howells EM(F_RDLCK, "RDLCK") \ 316*d4696601SDavid Howells EM(F_WRLCK, "WRLCK") \ 317*d4696601SDavid Howells E_(F_UNLCK, "UNLCK") 318*d4696601SDavid Howells 319*d4696601SDavid Howells #define afs_flock_states \ 320*d4696601SDavid Howells EM(AFS_VNODE_LOCK_NONE, "NONE") \ 321*d4696601SDavid Howells EM(AFS_VNODE_LOCK_WAITING_FOR_CB, "WAIT_FOR_CB") \ 322*d4696601SDavid Howells EM(AFS_VNODE_LOCK_SETTING, "SETTING") \ 323*d4696601SDavid Howells EM(AFS_VNODE_LOCK_GRANTED, "GRANTED") \ 324*d4696601SDavid Howells EM(AFS_VNODE_LOCK_EXTENDING, "EXTENDING") \ 325*d4696601SDavid Howells EM(AFS_VNODE_LOCK_NEED_UNLOCK, "NEED_UNLOCK") \ 326*d4696601SDavid Howells E_(AFS_VNODE_LOCK_UNLOCKING, "UNLOCKING") \ 327*d4696601SDavid Howells 328*d4696601SDavid Howells #define afs_flock_events \ 329*d4696601SDavid Howells EM(afs_flock_acquired, "Acquired") \ 330*d4696601SDavid Howells EM(afs_flock_callback_break, "Callback") \ 331*d4696601SDavid Howells EM(afs_flock_defer_unlock, "D-Unlock") \ 332*d4696601SDavid Howells EM(afs_flock_fail_other, "ErrOther") \ 333*d4696601SDavid Howells EM(afs_flock_fail_perm, "ErrPerm ") \ 334*d4696601SDavid Howells EM(afs_flock_no_lockers, "NoLocker") \ 335*d4696601SDavid Howells EM(afs_flock_timestamp, "Timestmp") \ 336*d4696601SDavid Howells EM(afs_flock_try_to_lock, "TryToLck") \ 337*d4696601SDavid Howells EM(afs_flock_vfs_lock, "VFSLock ") \ 338*d4696601SDavid Howells EM(afs_flock_vfs_locking, "VFSLking") \ 339*d4696601SDavid Howells EM(afs_flock_waited, "Waited ") \ 340*d4696601SDavid Howells EM(afs_flock_waiting, "Waiting ") \ 341*d4696601SDavid Howells EM(afs_flock_work_extending, "Extendng") \ 342*d4696601SDavid Howells EM(afs_flock_work_retry, "Retry ") \ 343*d4696601SDavid Howells EM(afs_flock_work_unlocking, "Unlcking") \ 344*d4696601SDavid Howells E_(afs_flock_would_block, "EWOULDBL") 345*d4696601SDavid Howells 346*d4696601SDavid Howells #define afs_flock_operations \ 347*d4696601SDavid Howells EM(afs_flock_op_copy_lock, "COPY ") \ 348*d4696601SDavid Howells EM(afs_flock_op_flock, "->flock ") \ 349*d4696601SDavid Howells EM(afs_flock_op_grant, "GRANT ") \ 350*d4696601SDavid Howells EM(afs_flock_op_lock, "->lock ") \ 351*d4696601SDavid Howells EM(afs_flock_op_release_lock, "RELEASE ") \ 352*d4696601SDavid Howells EM(afs_flock_op_return_ok, "<-OK ") \ 353*d4696601SDavid Howells EM(afs_flock_op_return_edeadlk, "<-EDEADL") \ 354*d4696601SDavid Howells EM(afs_flock_op_return_eagain, "<-EAGAIN") \ 355*d4696601SDavid Howells EM(afs_flock_op_return_error, "<-ERROR ") \ 356*d4696601SDavid Howells EM(afs_flock_op_set_lock, "SET ") \ 357*d4696601SDavid Howells EM(afs_flock_op_unlock, "UNLOCK ") \ 358*d4696601SDavid Howells E_(afs_flock_op_wake, "WAKE ") 359*d4696601SDavid Howells 360341f741fSDavid Howells /* 361341f741fSDavid Howells * Export enum symbols via userspace. 362341f741fSDavid Howells */ 363341f741fSDavid Howells #undef EM 364341f741fSDavid Howells #undef E_ 365341f741fSDavid Howells #define EM(a, b) TRACE_DEFINE_ENUM(a); 366341f741fSDavid Howells #define E_(a, b) TRACE_DEFINE_ENUM(a); 367341f741fSDavid Howells 368341f741fSDavid Howells afs_call_traces; 369025db80cSDavid Howells afs_fs_operations; 370025db80cSDavid Howells afs_vl_operations; 37163a4681fSDavid Howells afs_edit_dir_ops; 37263a4681fSDavid Howells afs_edit_dir_reasons; 373f51375cdSDavid Howells afs_eproto_causes; 374f51375cdSDavid Howells afs_io_errors; 375f51375cdSDavid Howells afs_file_errors; 376*d4696601SDavid Howells afs_flock_types; 377*d4696601SDavid Howells afs_flock_operations; 378341f741fSDavid Howells 379341f741fSDavid Howells /* 380341f741fSDavid Howells * Now redefine the EM() and E_() macros to map the enums to the strings that 381341f741fSDavid Howells * will be printed in the output. 382341f741fSDavid Howells */ 383341f741fSDavid Howells #undef EM 384341f741fSDavid Howells #undef E_ 385341f741fSDavid Howells #define EM(a, b) { a, b }, 386341f741fSDavid Howells #define E_(a, b) { a, b } 387341f741fSDavid Howells 38812bdcf33SDavid Howells TRACE_EVENT(afs_receive_data, 38912bdcf33SDavid Howells TP_PROTO(struct afs_call *call, struct iov_iter *iter, 3908e8d7f13SDavid Howells bool want_more, int ret), 3918e8d7f13SDavid Howells 39212bdcf33SDavid Howells TP_ARGS(call, iter, want_more, ret), 3938e8d7f13SDavid Howells 3948e8d7f13SDavid Howells TP_STRUCT__entry( 39512bdcf33SDavid Howells __field(loff_t, remain ) 396a25e21f0SDavid Howells __field(unsigned int, call ) 3978e8d7f13SDavid Howells __field(enum afs_call_state, state ) 3988e8d7f13SDavid Howells __field(unsigned short, unmarshall ) 3998e8d7f13SDavid Howells __field(bool, want_more ) 4008e8d7f13SDavid Howells __field(int, ret ) 4018e8d7f13SDavid Howells ), 4028e8d7f13SDavid Howells 4038e8d7f13SDavid Howells TP_fast_assign( 404a25e21f0SDavid Howells __entry->call = call->debug_id; 4058e8d7f13SDavid Howells __entry->state = call->state; 4068e8d7f13SDavid Howells __entry->unmarshall = call->unmarshall; 40712bdcf33SDavid Howells __entry->remain = iov_iter_count(iter); 4088e8d7f13SDavid Howells __entry->want_more = want_more; 4098e8d7f13SDavid Howells __entry->ret = ret; 4108e8d7f13SDavid Howells ), 4118e8d7f13SDavid Howells 41212bdcf33SDavid Howells TP_printk("c=%08x r=%llu u=%u w=%u s=%u ret=%d", 4138e8d7f13SDavid Howells __entry->call, 41412bdcf33SDavid Howells __entry->remain, 41512bdcf33SDavid Howells __entry->unmarshall, 41612bdcf33SDavid Howells __entry->want_more, 41712bdcf33SDavid Howells __entry->state, 41812bdcf33SDavid Howells __entry->ret) 4198e8d7f13SDavid Howells ); 4208e8d7f13SDavid Howells 4218e8d7f13SDavid Howells TRACE_EVENT(afs_notify_call, 4228e8d7f13SDavid Howells TP_PROTO(struct rxrpc_call *rxcall, struct afs_call *call), 4238e8d7f13SDavid Howells 4248e8d7f13SDavid Howells TP_ARGS(rxcall, call), 4258e8d7f13SDavid Howells 4268e8d7f13SDavid Howells TP_STRUCT__entry( 427a25e21f0SDavid Howells __field(unsigned int, call ) 4288e8d7f13SDavid Howells __field(enum afs_call_state, state ) 4298e8d7f13SDavid Howells __field(unsigned short, unmarshall ) 4308e8d7f13SDavid Howells ), 4318e8d7f13SDavid Howells 4328e8d7f13SDavid Howells TP_fast_assign( 433a25e21f0SDavid Howells __entry->call = call->debug_id; 4348e8d7f13SDavid Howells __entry->state = call->state; 4358e8d7f13SDavid Howells __entry->unmarshall = call->unmarshall; 4368e8d7f13SDavid Howells ), 4378e8d7f13SDavid Howells 438a25e21f0SDavid Howells TP_printk("c=%08x s=%u u=%u", 4398e8d7f13SDavid Howells __entry->call, 4408e8d7f13SDavid Howells __entry->state, __entry->unmarshall) 4418e8d7f13SDavid Howells ); 4428e8d7f13SDavid Howells 4438e8d7f13SDavid Howells TRACE_EVENT(afs_cb_call, 4448e8d7f13SDavid Howells TP_PROTO(struct afs_call *call), 4458e8d7f13SDavid Howells 4468e8d7f13SDavid Howells TP_ARGS(call), 4478e8d7f13SDavid Howells 4488e8d7f13SDavid Howells TP_STRUCT__entry( 449a25e21f0SDavid Howells __field(unsigned int, call ) 4508e8d7f13SDavid Howells __field(const char *, name ) 4518e8d7f13SDavid Howells __field(u32, op ) 4528e8d7f13SDavid Howells ), 4538e8d7f13SDavid Howells 4548e8d7f13SDavid Howells TP_fast_assign( 455a25e21f0SDavid Howells __entry->call = call->debug_id; 4568e8d7f13SDavid Howells __entry->name = call->type->name; 4578e8d7f13SDavid Howells __entry->op = call->operation_ID; 4588e8d7f13SDavid Howells ), 4598e8d7f13SDavid Howells 460a25e21f0SDavid Howells TP_printk("c=%08x %s o=%u", 4618e8d7f13SDavid Howells __entry->call, 4628e8d7f13SDavid Howells __entry->name, 4638e8d7f13SDavid Howells __entry->op) 4648e8d7f13SDavid Howells ); 4658e8d7f13SDavid Howells 466341f741fSDavid Howells TRACE_EVENT(afs_call, 467341f741fSDavid Howells TP_PROTO(struct afs_call *call, enum afs_call_trace op, 468341f741fSDavid Howells int usage, int outstanding, const void *where), 469341f741fSDavid Howells 470341f741fSDavid Howells TP_ARGS(call, op, usage, outstanding, where), 471341f741fSDavid Howells 472341f741fSDavid Howells TP_STRUCT__entry( 473a25e21f0SDavid Howells __field(unsigned int, call ) 474341f741fSDavid Howells __field(int, op ) 475341f741fSDavid Howells __field(int, usage ) 476341f741fSDavid Howells __field(int, outstanding ) 477341f741fSDavid Howells __field(const void *, where ) 478341f741fSDavid Howells ), 479341f741fSDavid Howells 480341f741fSDavid Howells TP_fast_assign( 481a25e21f0SDavid Howells __entry->call = call->debug_id; 482341f741fSDavid Howells __entry->op = op; 483341f741fSDavid Howells __entry->usage = usage; 484341f741fSDavid Howells __entry->outstanding = outstanding; 485341f741fSDavid Howells __entry->where = where; 486341f741fSDavid Howells ), 487341f741fSDavid Howells 488a25e21f0SDavid Howells TP_printk("c=%08x %s u=%d o=%d sp=%pSR", 489341f741fSDavid Howells __entry->call, 490341f741fSDavid Howells __print_symbolic(__entry->op, afs_call_traces), 491341f741fSDavid Howells __entry->usage, 492341f741fSDavid Howells __entry->outstanding, 493341f741fSDavid Howells __entry->where) 494341f741fSDavid Howells ); 495341f741fSDavid Howells 496025db80cSDavid Howells TRACE_EVENT(afs_make_fs_call, 497025db80cSDavid Howells TP_PROTO(struct afs_call *call, const struct afs_fid *fid), 498025db80cSDavid Howells 499025db80cSDavid Howells TP_ARGS(call, fid), 500025db80cSDavid Howells 501025db80cSDavid Howells TP_STRUCT__entry( 502a25e21f0SDavid Howells __field(unsigned int, call ) 503025db80cSDavid Howells __field(enum afs_fs_operation, op ) 504025db80cSDavid Howells __field_struct(struct afs_fid, fid ) 505025db80cSDavid Howells ), 506025db80cSDavid Howells 507025db80cSDavid Howells TP_fast_assign( 508a25e21f0SDavid Howells __entry->call = call->debug_id; 509025db80cSDavid Howells __entry->op = call->operation_ID; 510025db80cSDavid Howells if (fid) { 511025db80cSDavid Howells __entry->fid = *fid; 512025db80cSDavid Howells } else { 513025db80cSDavid Howells __entry->fid.vid = 0; 514025db80cSDavid Howells __entry->fid.vnode = 0; 515025db80cSDavid Howells __entry->fid.unique = 0; 516025db80cSDavid Howells } 517025db80cSDavid Howells ), 518025db80cSDavid Howells 5193b6492dfSDavid Howells TP_printk("c=%08x %06llx:%06llx:%06x %s", 520025db80cSDavid Howells __entry->call, 521025db80cSDavid Howells __entry->fid.vid, 522025db80cSDavid Howells __entry->fid.vnode, 523025db80cSDavid Howells __entry->fid.unique, 524025db80cSDavid Howells __print_symbolic(__entry->op, afs_fs_operations)) 525025db80cSDavid Howells ); 526025db80cSDavid Howells 527025db80cSDavid Howells TRACE_EVENT(afs_make_vl_call, 528025db80cSDavid Howells TP_PROTO(struct afs_call *call), 529025db80cSDavid Howells 530025db80cSDavid Howells TP_ARGS(call), 531025db80cSDavid Howells 532025db80cSDavid Howells TP_STRUCT__entry( 533a25e21f0SDavid Howells __field(unsigned int, call ) 534025db80cSDavid Howells __field(enum afs_vl_operation, op ) 535025db80cSDavid Howells ), 536025db80cSDavid Howells 537025db80cSDavid Howells TP_fast_assign( 538a25e21f0SDavid Howells __entry->call = call->debug_id; 539025db80cSDavid Howells __entry->op = call->operation_ID; 540025db80cSDavid Howells ), 541025db80cSDavid Howells 542a25e21f0SDavid Howells TP_printk("c=%08x %s", 543025db80cSDavid Howells __entry->call, 544025db80cSDavid Howells __print_symbolic(__entry->op, afs_vl_operations)) 545025db80cSDavid Howells ); 546025db80cSDavid Howells 547025db80cSDavid Howells TRACE_EVENT(afs_call_done, 548025db80cSDavid Howells TP_PROTO(struct afs_call *call), 549025db80cSDavid Howells 550025db80cSDavid Howells TP_ARGS(call), 551025db80cSDavid Howells 552025db80cSDavid Howells TP_STRUCT__entry( 553a25e21f0SDavid Howells __field(unsigned int, call ) 554025db80cSDavid Howells __field(struct rxrpc_call *, rx_call ) 555025db80cSDavid Howells __field(int, ret ) 556025db80cSDavid Howells __field(u32, abort_code ) 557025db80cSDavid Howells ), 558025db80cSDavid Howells 559025db80cSDavid Howells TP_fast_assign( 560a25e21f0SDavid Howells __entry->call = call->debug_id; 561025db80cSDavid Howells __entry->rx_call = call->rxcall; 562025db80cSDavid Howells __entry->ret = call->error; 563025db80cSDavid Howells __entry->abort_code = call->abort_code; 564025db80cSDavid Howells ), 565025db80cSDavid Howells 566a25e21f0SDavid Howells TP_printk(" c=%08x ret=%d ab=%d [%p]", 567025db80cSDavid Howells __entry->call, 568025db80cSDavid Howells __entry->ret, 569025db80cSDavid Howells __entry->abort_code, 570025db80cSDavid Howells __entry->rx_call) 571025db80cSDavid Howells ); 572025db80cSDavid Howells 5732c099014SDavid Howells TRACE_EVENT(afs_send_pages, 5742c099014SDavid Howells TP_PROTO(struct afs_call *call, struct msghdr *msg, 5752c099014SDavid Howells pgoff_t first, pgoff_t last, unsigned int offset), 5762c099014SDavid Howells 5772c099014SDavid Howells TP_ARGS(call, msg, first, last, offset), 5782c099014SDavid Howells 5792c099014SDavid Howells TP_STRUCT__entry( 580a25e21f0SDavid Howells __field(unsigned int, call ) 5812c099014SDavid Howells __field(pgoff_t, first ) 5822c099014SDavid Howells __field(pgoff_t, last ) 5832c099014SDavid Howells __field(unsigned int, nr ) 5842c099014SDavid Howells __field(unsigned int, bytes ) 5852c099014SDavid Howells __field(unsigned int, offset ) 5862c099014SDavid Howells __field(unsigned int, flags ) 5872c099014SDavid Howells ), 5882c099014SDavid Howells 5892c099014SDavid Howells TP_fast_assign( 590a25e21f0SDavid Howells __entry->call = call->debug_id; 5912c099014SDavid Howells __entry->first = first; 5922c099014SDavid Howells __entry->last = last; 5932c099014SDavid Howells __entry->nr = msg->msg_iter.nr_segs; 5942c099014SDavid Howells __entry->bytes = msg->msg_iter.count; 5952c099014SDavid Howells __entry->offset = offset; 5962c099014SDavid Howells __entry->flags = msg->msg_flags; 5972c099014SDavid Howells ), 5982c099014SDavid Howells 599a25e21f0SDavid Howells TP_printk(" c=%08x %lx-%lx-%lx b=%x o=%x f=%x", 6002c099014SDavid Howells __entry->call, 6012c099014SDavid Howells __entry->first, __entry->first + __entry->nr - 1, __entry->last, 6022c099014SDavid Howells __entry->bytes, __entry->offset, 6032c099014SDavid Howells __entry->flags) 6042c099014SDavid Howells ); 6052c099014SDavid Howells 6062c099014SDavid Howells TRACE_EVENT(afs_sent_pages, 6072c099014SDavid Howells TP_PROTO(struct afs_call *call, pgoff_t first, pgoff_t last, 6082c099014SDavid Howells pgoff_t cursor, int ret), 6092c099014SDavid Howells 6102c099014SDavid Howells TP_ARGS(call, first, last, cursor, ret), 6112c099014SDavid Howells 6122c099014SDavid Howells TP_STRUCT__entry( 613a25e21f0SDavid Howells __field(unsigned int, call ) 6142c099014SDavid Howells __field(pgoff_t, first ) 6152c099014SDavid Howells __field(pgoff_t, last ) 6162c099014SDavid Howells __field(pgoff_t, cursor ) 6172c099014SDavid Howells __field(int, ret ) 6182c099014SDavid Howells ), 6192c099014SDavid Howells 6202c099014SDavid Howells TP_fast_assign( 621a25e21f0SDavid Howells __entry->call = call->debug_id; 6222c099014SDavid Howells __entry->first = first; 6232c099014SDavid Howells __entry->last = last; 6242c099014SDavid Howells __entry->cursor = cursor; 6252c099014SDavid Howells __entry->ret = ret; 6262c099014SDavid Howells ), 6272c099014SDavid Howells 628a25e21f0SDavid Howells TP_printk(" c=%08x %lx-%lx c=%lx r=%d", 6292c099014SDavid Howells __entry->call, 6302c099014SDavid Howells __entry->first, __entry->last, 6312c099014SDavid Howells __entry->cursor, __entry->ret) 6322c099014SDavid Howells ); 6332c099014SDavid Howells 634dab17c1aSDavid Howells TRACE_EVENT(afs_dir_check_failed, 635dab17c1aSDavid Howells TP_PROTO(struct afs_vnode *vnode, loff_t off, loff_t i_size), 636dab17c1aSDavid Howells 637dab17c1aSDavid Howells TP_ARGS(vnode, off, i_size), 638dab17c1aSDavid Howells 639dab17c1aSDavid Howells TP_STRUCT__entry( 640dab17c1aSDavid Howells __field(struct afs_vnode *, vnode ) 641dab17c1aSDavid Howells __field(loff_t, off ) 642dab17c1aSDavid Howells __field(loff_t, i_size ) 643dab17c1aSDavid Howells ), 644dab17c1aSDavid Howells 645dab17c1aSDavid Howells TP_fast_assign( 646dab17c1aSDavid Howells __entry->vnode = vnode; 647dab17c1aSDavid Howells __entry->off = off; 648dab17c1aSDavid Howells __entry->i_size = i_size; 649dab17c1aSDavid Howells ), 650dab17c1aSDavid Howells 651dab17c1aSDavid Howells TP_printk("vn=%p %llx/%llx", 652dab17c1aSDavid Howells __entry->vnode, __entry->off, __entry->i_size) 653dab17c1aSDavid Howells ); 654dab17c1aSDavid Howells 65513524ab3SDavid Howells /* 65613524ab3SDavid Howells * We use page->private to hold the amount of the page that we've written to, 65713524ab3SDavid Howells * splitting the field into two parts. However, we need to represent a range 65813524ab3SDavid Howells * 0...PAGE_SIZE inclusive, so we can't support 64K pages on a 32-bit system. 65913524ab3SDavid Howells */ 66013524ab3SDavid Howells #if PAGE_SIZE > 32768 66113524ab3SDavid Howells #define AFS_PRIV_MAX 0xffffffff 66213524ab3SDavid Howells #define AFS_PRIV_SHIFT 32 66313524ab3SDavid Howells #else 66413524ab3SDavid Howells #define AFS_PRIV_MAX 0xffff 66513524ab3SDavid Howells #define AFS_PRIV_SHIFT 16 66613524ab3SDavid Howells #endif 66713524ab3SDavid Howells 66813524ab3SDavid Howells TRACE_EVENT(afs_page_dirty, 66913524ab3SDavid Howells TP_PROTO(struct afs_vnode *vnode, const char *where, 67013524ab3SDavid Howells pgoff_t page, unsigned long priv), 67113524ab3SDavid Howells 67213524ab3SDavid Howells TP_ARGS(vnode, where, page, priv), 67313524ab3SDavid Howells 67413524ab3SDavid Howells TP_STRUCT__entry( 67513524ab3SDavid Howells __field(struct afs_vnode *, vnode ) 67613524ab3SDavid Howells __field(const char *, where ) 67713524ab3SDavid Howells __field(pgoff_t, page ) 67813524ab3SDavid Howells __field(unsigned long, priv ) 67913524ab3SDavid Howells ), 68013524ab3SDavid Howells 68113524ab3SDavid Howells TP_fast_assign( 68213524ab3SDavid Howells __entry->vnode = vnode; 68313524ab3SDavid Howells __entry->where = where; 68413524ab3SDavid Howells __entry->page = page; 68513524ab3SDavid Howells __entry->priv = priv; 68613524ab3SDavid Howells ), 68713524ab3SDavid Howells 68813524ab3SDavid Howells TP_printk("vn=%p %lx %s %lu-%lu", 68913524ab3SDavid Howells __entry->vnode, __entry->page, __entry->where, 69013524ab3SDavid Howells __entry->priv & AFS_PRIV_MAX, 69113524ab3SDavid Howells __entry->priv >> AFS_PRIV_SHIFT) 69213524ab3SDavid Howells ); 69313524ab3SDavid Howells 69498bf40cdSDavid Howells TRACE_EVENT(afs_call_state, 69598bf40cdSDavid Howells TP_PROTO(struct afs_call *call, 69698bf40cdSDavid Howells enum afs_call_state from, 69798bf40cdSDavid Howells enum afs_call_state to, 69898bf40cdSDavid Howells int ret, u32 remote_abort), 69998bf40cdSDavid Howells 70098bf40cdSDavid Howells TP_ARGS(call, from, to, ret, remote_abort), 70198bf40cdSDavid Howells 70298bf40cdSDavid Howells TP_STRUCT__entry( 703a25e21f0SDavid Howells __field(unsigned int, call ) 70498bf40cdSDavid Howells __field(enum afs_call_state, from ) 70598bf40cdSDavid Howells __field(enum afs_call_state, to ) 70698bf40cdSDavid Howells __field(int, ret ) 70798bf40cdSDavid Howells __field(u32, abort ) 70898bf40cdSDavid Howells ), 70998bf40cdSDavid Howells 71098bf40cdSDavid Howells TP_fast_assign( 711a25e21f0SDavid Howells __entry->call = call->debug_id; 71298bf40cdSDavid Howells __entry->from = from; 71398bf40cdSDavid Howells __entry->to = to; 71498bf40cdSDavid Howells __entry->ret = ret; 71598bf40cdSDavid Howells __entry->abort = remote_abort; 71698bf40cdSDavid Howells ), 71798bf40cdSDavid Howells 718a25e21f0SDavid Howells TP_printk("c=%08x %u->%u r=%d ab=%d", 71998bf40cdSDavid Howells __entry->call, 72098bf40cdSDavid Howells __entry->from, __entry->to, 72198bf40cdSDavid Howells __entry->ret, __entry->abort) 72298bf40cdSDavid Howells ); 72398bf40cdSDavid Howells 72463a4681fSDavid Howells TRACE_EVENT(afs_edit_dir, 72563a4681fSDavid Howells TP_PROTO(struct afs_vnode *dvnode, 72663a4681fSDavid Howells enum afs_edit_dir_reason why, 72763a4681fSDavid Howells enum afs_edit_dir_op op, 72863a4681fSDavid Howells unsigned int block, 72963a4681fSDavid Howells unsigned int slot, 73063a4681fSDavid Howells unsigned int f_vnode, 73163a4681fSDavid Howells unsigned int f_unique, 73263a4681fSDavid Howells const char *name), 73363a4681fSDavid Howells 73463a4681fSDavid Howells TP_ARGS(dvnode, why, op, block, slot, f_vnode, f_unique, name), 73563a4681fSDavid Howells 73663a4681fSDavid Howells TP_STRUCT__entry( 73763a4681fSDavid Howells __field(unsigned int, vnode ) 73863a4681fSDavid Howells __field(unsigned int, unique ) 73963a4681fSDavid Howells __field(enum afs_edit_dir_reason, why ) 74063a4681fSDavid Howells __field(enum afs_edit_dir_op, op ) 74163a4681fSDavid Howells __field(unsigned int, block ) 74263a4681fSDavid Howells __field(unsigned short, slot ) 74363a4681fSDavid Howells __field(unsigned int, f_vnode ) 74463a4681fSDavid Howells __field(unsigned int, f_unique ) 74563a4681fSDavid Howells __array(char, name, 18 ) 74663a4681fSDavid Howells ), 74763a4681fSDavid Howells 74863a4681fSDavid Howells TP_fast_assign( 74963a4681fSDavid Howells int __len = strlen(name); 75063a4681fSDavid Howells __len = min(__len, 17); 75163a4681fSDavid Howells __entry->vnode = dvnode->fid.vnode; 75263a4681fSDavid Howells __entry->unique = dvnode->fid.unique; 75363a4681fSDavid Howells __entry->why = why; 75463a4681fSDavid Howells __entry->op = op; 75563a4681fSDavid Howells __entry->block = block; 75663a4681fSDavid Howells __entry->slot = slot; 75763a4681fSDavid Howells __entry->f_vnode = f_vnode; 75863a4681fSDavid Howells __entry->f_unique = f_unique; 75963a4681fSDavid Howells memcpy(__entry->name, name, __len); 76063a4681fSDavid Howells __entry->name[__len] = 0; 76163a4681fSDavid Howells ), 76263a4681fSDavid Howells 76363a4681fSDavid Howells TP_printk("d=%x:%x %s %s %u[%u] f=%x:%x %s", 76463a4681fSDavid Howells __entry->vnode, __entry->unique, 76563a4681fSDavid Howells __print_symbolic(__entry->why, afs_edit_dir_reasons), 76663a4681fSDavid Howells __print_symbolic(__entry->op, afs_edit_dir_ops), 76763a4681fSDavid Howells __entry->block, __entry->slot, 76863a4681fSDavid Howells __entry->f_vnode, __entry->f_unique, 76963a4681fSDavid Howells __entry->name) 77063a4681fSDavid Howells ); 77163a4681fSDavid Howells 7725f702c8eSDavid Howells TRACE_EVENT(afs_protocol_error, 773160cb957SDavid Howells TP_PROTO(struct afs_call *call, int error, enum afs_eproto_cause cause), 7745f702c8eSDavid Howells 775160cb957SDavid Howells TP_ARGS(call, error, cause), 7765f702c8eSDavid Howells 7775f702c8eSDavid Howells TP_STRUCT__entry( 7785f702c8eSDavid Howells __field(unsigned int, call ) 7795f702c8eSDavid Howells __field(int, error ) 780160cb957SDavid Howells __field(enum afs_eproto_cause, cause ) 7815f702c8eSDavid Howells ), 7825f702c8eSDavid Howells 7835f702c8eSDavid Howells TP_fast_assign( 7845f702c8eSDavid Howells __entry->call = call ? call->debug_id : 0; 7855f702c8eSDavid Howells __entry->error = error; 786160cb957SDavid Howells __entry->cause = cause; 7875f702c8eSDavid Howells ), 7885f702c8eSDavid Howells 789160cb957SDavid Howells TP_printk("c=%08x r=%d %s", 790160cb957SDavid Howells __entry->call, __entry->error, 791160cb957SDavid Howells __print_symbolic(__entry->cause, afs_eproto_causes)) 7925f702c8eSDavid Howells ); 7935f702c8eSDavid Howells 794f51375cdSDavid Howells TRACE_EVENT(afs_io_error, 795f51375cdSDavid Howells TP_PROTO(unsigned int call, int error, enum afs_io_error where), 796f51375cdSDavid Howells 797f51375cdSDavid Howells TP_ARGS(call, error, where), 798f51375cdSDavid Howells 799f51375cdSDavid Howells TP_STRUCT__entry( 800f51375cdSDavid Howells __field(unsigned int, call ) 801f51375cdSDavid Howells __field(int, error ) 802f51375cdSDavid Howells __field(enum afs_io_error, where ) 803f51375cdSDavid Howells ), 804f51375cdSDavid Howells 805f51375cdSDavid Howells TP_fast_assign( 806f51375cdSDavid Howells __entry->call = call; 807f51375cdSDavid Howells __entry->error = error; 808f51375cdSDavid Howells __entry->where = where; 809f51375cdSDavid Howells ), 810f51375cdSDavid Howells 811f51375cdSDavid Howells TP_printk("c=%08x r=%d %s", 812f51375cdSDavid Howells __entry->call, __entry->error, 813f51375cdSDavid Howells __print_symbolic(__entry->where, afs_io_errors)) 814f51375cdSDavid Howells ); 815f51375cdSDavid Howells 816f51375cdSDavid Howells TRACE_EVENT(afs_file_error, 817f51375cdSDavid Howells TP_PROTO(struct afs_vnode *vnode, int error, enum afs_file_error where), 818f51375cdSDavid Howells 819f51375cdSDavid Howells TP_ARGS(vnode, error, where), 820f51375cdSDavid Howells 821f51375cdSDavid Howells TP_STRUCT__entry( 822f51375cdSDavid Howells __field_struct(struct afs_fid, fid ) 823f51375cdSDavid Howells __field(int, error ) 824f51375cdSDavid Howells __field(enum afs_file_error, where ) 825f51375cdSDavid Howells ), 826f51375cdSDavid Howells 827f51375cdSDavid Howells TP_fast_assign( 828f51375cdSDavid Howells __entry->fid = vnode->fid; 829f51375cdSDavid Howells __entry->error = error; 830f51375cdSDavid Howells __entry->where = where; 831f51375cdSDavid Howells ), 832f51375cdSDavid Howells 8333b6492dfSDavid Howells TP_printk("%llx:%llx:%x r=%d %s", 834f51375cdSDavid Howells __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique, 835f51375cdSDavid Howells __entry->error, 836f51375cdSDavid Howells __print_symbolic(__entry->where, afs_file_errors)) 837f51375cdSDavid Howells ); 838f51375cdSDavid Howells 8393709a399SDavid Howells TRACE_EVENT(afs_cm_no_server, 8403709a399SDavid Howells TP_PROTO(struct afs_call *call, struct sockaddr_rxrpc *srx), 8413709a399SDavid Howells 8423709a399SDavid Howells TP_ARGS(call, srx), 8433709a399SDavid Howells 8443709a399SDavid Howells TP_STRUCT__entry( 8453709a399SDavid Howells __field(unsigned int, call ) 8463709a399SDavid Howells __field(unsigned int, op_id ) 8473709a399SDavid Howells __field_struct(struct sockaddr_rxrpc, srx ) 8483709a399SDavid Howells ), 8493709a399SDavid Howells 8503709a399SDavid Howells TP_fast_assign( 8513709a399SDavid Howells __entry->call = call->debug_id; 8523709a399SDavid Howells __entry->op_id = call->operation_ID; 8533709a399SDavid Howells memcpy(&__entry->srx, srx, sizeof(__entry->srx)); 8543709a399SDavid Howells ), 8553709a399SDavid Howells 8563709a399SDavid Howells TP_printk("c=%08x op=%u %pISpc", 8573709a399SDavid Howells __entry->call, __entry->op_id, &__entry->srx.transport) 8583709a399SDavid Howells ); 8593709a399SDavid Howells 8603709a399SDavid Howells TRACE_EVENT(afs_cm_no_server_u, 8613709a399SDavid Howells TP_PROTO(struct afs_call *call, const uuid_t *uuid), 8623709a399SDavid Howells 8633709a399SDavid Howells TP_ARGS(call, uuid), 8643709a399SDavid Howells 8653709a399SDavid Howells TP_STRUCT__entry( 8663709a399SDavid Howells __field(unsigned int, call ) 8673709a399SDavid Howells __field(unsigned int, op_id ) 8683709a399SDavid Howells __field_struct(uuid_t, uuid ) 8693709a399SDavid Howells ), 8703709a399SDavid Howells 8713709a399SDavid Howells TP_fast_assign( 8723709a399SDavid Howells __entry->call = call->debug_id; 8733709a399SDavid Howells __entry->op_id = call->operation_ID; 8743709a399SDavid Howells memcpy(&__entry->uuid, uuid, sizeof(__entry->uuid)); 8753709a399SDavid Howells ), 8763709a399SDavid Howells 8773709a399SDavid Howells TP_printk("c=%08x op=%u %pU", 8783709a399SDavid Howells __entry->call, __entry->op_id, &__entry->uuid) 8793709a399SDavid Howells ); 8803709a399SDavid Howells 881*d4696601SDavid Howells TRACE_EVENT(afs_flock_ev, 882*d4696601SDavid Howells TP_PROTO(struct afs_vnode *vnode, struct file_lock *fl, 883*d4696601SDavid Howells enum afs_flock_event event, int error), 884*d4696601SDavid Howells 885*d4696601SDavid Howells TP_ARGS(vnode, fl, event, error), 886*d4696601SDavid Howells 887*d4696601SDavid Howells TP_STRUCT__entry( 888*d4696601SDavid Howells __field_struct(struct afs_fid, fid ) 889*d4696601SDavid Howells __field(enum afs_flock_event, event ) 890*d4696601SDavid Howells __field(enum afs_lock_state, state ) 891*d4696601SDavid Howells __field(int, error ) 892*d4696601SDavid Howells __field(unsigned int, debug_id ) 893*d4696601SDavid Howells ), 894*d4696601SDavid Howells 895*d4696601SDavid Howells TP_fast_assign( 896*d4696601SDavid Howells __entry->fid = vnode->fid; 897*d4696601SDavid Howells __entry->event = event; 898*d4696601SDavid Howells __entry->state = vnode->lock_state; 899*d4696601SDavid Howells __entry->error = error; 900*d4696601SDavid Howells __entry->debug_id = fl ? fl->fl_u.afs.debug_id : 0; 901*d4696601SDavid Howells ), 902*d4696601SDavid Howells 903*d4696601SDavid Howells TP_printk("%llx:%llx:%x %04x %s s=%s e=%d", 904*d4696601SDavid Howells __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique, 905*d4696601SDavid Howells __entry->debug_id, 906*d4696601SDavid Howells __print_symbolic(__entry->event, afs_flock_events), 907*d4696601SDavid Howells __print_symbolic(__entry->state, afs_flock_states), 908*d4696601SDavid Howells __entry->error) 909*d4696601SDavid Howells ); 910*d4696601SDavid Howells 911*d4696601SDavid Howells TRACE_EVENT(afs_flock_op, 912*d4696601SDavid Howells TP_PROTO(struct afs_vnode *vnode, struct file_lock *fl, 913*d4696601SDavid Howells enum afs_flock_operation op), 914*d4696601SDavid Howells 915*d4696601SDavid Howells TP_ARGS(vnode, fl, op), 916*d4696601SDavid Howells 917*d4696601SDavid Howells TP_STRUCT__entry( 918*d4696601SDavid Howells __field_struct(struct afs_fid, fid ) 919*d4696601SDavid Howells __field(loff_t, from ) 920*d4696601SDavid Howells __field(loff_t, len ) 921*d4696601SDavid Howells __field(enum afs_flock_operation, op ) 922*d4696601SDavid Howells __field(unsigned char, type ) 923*d4696601SDavid Howells __field(unsigned int, flags ) 924*d4696601SDavid Howells __field(unsigned int, debug_id ) 925*d4696601SDavid Howells ), 926*d4696601SDavid Howells 927*d4696601SDavid Howells TP_fast_assign( 928*d4696601SDavid Howells __entry->fid = vnode->fid; 929*d4696601SDavid Howells __entry->from = fl->fl_start; 930*d4696601SDavid Howells __entry->len = fl->fl_end - fl->fl_start + 1; 931*d4696601SDavid Howells __entry->op = op; 932*d4696601SDavid Howells __entry->type = fl->fl_type; 933*d4696601SDavid Howells __entry->flags = fl->fl_flags; 934*d4696601SDavid Howells __entry->debug_id = fl->fl_u.afs.debug_id; 935*d4696601SDavid Howells ), 936*d4696601SDavid Howells 937*d4696601SDavid Howells TP_printk("%llx:%llx:%x %04x %s t=%s R=%llx/%llx f=%x", 938*d4696601SDavid Howells __entry->fid.vid, __entry->fid.vnode, __entry->fid.unique, 939*d4696601SDavid Howells __entry->debug_id, 940*d4696601SDavid Howells __print_symbolic(__entry->op, afs_flock_operations), 941*d4696601SDavid Howells __print_symbolic(__entry->type, afs_flock_types), 942*d4696601SDavid Howells __entry->from, __entry->len, __entry->flags) 943*d4696601SDavid Howells ); 944*d4696601SDavid Howells 9458e8d7f13SDavid Howells #endif /* _TRACE_AFS_H */ 9468e8d7f13SDavid Howells 9478e8d7f13SDavid Howells /* This part must be outside protection */ 9488e8d7f13SDavid Howells #include <trace/define_trace.h> 949