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