18e8d7f13SDavid Howells /* AFS tracepoints 28e8d7f13SDavid Howells * 38e8d7f13SDavid Howells * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved. 48e8d7f13SDavid Howells * Written by David Howells (dhowells@redhat.com) 58e8d7f13SDavid Howells * 68e8d7f13SDavid Howells * This program is free software; you can redistribute it and/or 78e8d7f13SDavid Howells * modify it under the terms of the GNU General Public Licence 88e8d7f13SDavid Howells * as published by the Free Software Foundation; either version 98e8d7f13SDavid Howells * 2 of the Licence, or (at your option) any later version. 108e8d7f13SDavid Howells */ 118e8d7f13SDavid Howells #undef TRACE_SYSTEM 128e8d7f13SDavid Howells #define TRACE_SYSTEM afs 138e8d7f13SDavid Howells 148e8d7f13SDavid Howells #if !defined(_TRACE_AFS_H) || defined(TRACE_HEADER_MULTI_READ) 158e8d7f13SDavid Howells #define _TRACE_AFS_H 168e8d7f13SDavid Howells 178e8d7f13SDavid Howells #include <linux/tracepoint.h> 188e8d7f13SDavid Howells 19341f741fSDavid Howells /* 20341f741fSDavid Howells * Define enums for tracing information. 21341f741fSDavid Howells */ 22341f741fSDavid Howells #ifndef __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY 23341f741fSDavid Howells #define __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY 24341f741fSDavid Howells 25341f741fSDavid Howells enum afs_call_trace { 26341f741fSDavid Howells afs_call_trace_alloc, 27341f741fSDavid Howells afs_call_trace_free, 28341f741fSDavid Howells afs_call_trace_put, 29341f741fSDavid Howells afs_call_trace_wake, 30341f741fSDavid Howells afs_call_trace_work, 31341f741fSDavid Howells }; 32341f741fSDavid Howells 33025db80cSDavid Howells enum afs_fs_operation { 34025db80cSDavid Howells afs_FS_FetchData = 130, /* AFS Fetch file data */ 35025db80cSDavid Howells afs_FS_FetchStatus = 132, /* AFS Fetch file status */ 36025db80cSDavid Howells afs_FS_StoreData = 133, /* AFS Store file data */ 37025db80cSDavid Howells afs_FS_StoreStatus = 135, /* AFS Store file status */ 38025db80cSDavid Howells afs_FS_RemoveFile = 136, /* AFS Remove a file */ 39025db80cSDavid Howells afs_FS_CreateFile = 137, /* AFS Create a file */ 40025db80cSDavid Howells afs_FS_Rename = 138, /* AFS Rename or move a file or directory */ 41025db80cSDavid Howells afs_FS_Symlink = 139, /* AFS Create a symbolic link */ 42025db80cSDavid Howells afs_FS_Link = 140, /* AFS Create a hard link */ 43025db80cSDavid Howells afs_FS_MakeDir = 141, /* AFS Create a directory */ 44025db80cSDavid Howells afs_FS_RemoveDir = 142, /* AFS Remove a directory */ 45025db80cSDavid Howells afs_FS_GetVolumeInfo = 148, /* AFS Get information about a volume */ 46025db80cSDavid Howells afs_FS_GetVolumeStatus = 149, /* AFS Get volume status information */ 47025db80cSDavid Howells afs_FS_GetRootVolume = 151, /* AFS Get root volume name */ 48025db80cSDavid Howells afs_FS_SetLock = 156, /* AFS Request a file lock */ 49025db80cSDavid Howells afs_FS_ExtendLock = 157, /* AFS Extend a file lock */ 50025db80cSDavid Howells afs_FS_ReleaseLock = 158, /* AFS Release a file lock */ 51025db80cSDavid Howells afs_FS_Lookup = 161, /* AFS lookup file in directory */ 52*5cf9dd55SDavid Howells afs_FS_InlineBulkStatus = 65536, /* AFS Fetch multiple file statuses with errors */ 53025db80cSDavid Howells afs_FS_FetchData64 = 65537, /* AFS Fetch file data */ 54025db80cSDavid Howells afs_FS_StoreData64 = 65538, /* AFS Store file data */ 55025db80cSDavid Howells afs_FS_GiveUpAllCallBacks = 65539, /* AFS Give up all our callbacks on a server */ 56025db80cSDavid Howells afs_FS_GetCapabilities = 65540, /* AFS Get FS server capabilities */ 57025db80cSDavid Howells }; 58025db80cSDavid Howells 59025db80cSDavid Howells enum afs_vl_operation { 60025db80cSDavid Howells afs_VL_GetEntryByNameU = 527, /* AFS Get Vol Entry By Name operation ID */ 61025db80cSDavid Howells afs_VL_GetAddrsU = 533, /* AFS Get FS server addresses */ 62025db80cSDavid Howells afs_YFSVL_GetEndpoints = 64002, /* YFS Get FS & Vol server addresses */ 63025db80cSDavid Howells afs_VL_GetCapabilities = 65537, /* AFS Get VL server capabilities */ 64025db80cSDavid Howells }; 65025db80cSDavid Howells 66341f741fSDavid Howells #endif /* end __AFS_DECLARE_TRACE_ENUMS_ONCE_ONLY */ 67341f741fSDavid Howells 68341f741fSDavid Howells /* 69341f741fSDavid Howells * Declare tracing information enums and their string mappings for display. 70341f741fSDavid Howells */ 71341f741fSDavid Howells #define afs_call_traces \ 72341f741fSDavid Howells EM(afs_call_trace_alloc, "ALLOC") \ 73341f741fSDavid Howells EM(afs_call_trace_free, "FREE ") \ 74341f741fSDavid Howells EM(afs_call_trace_put, "PUT ") \ 75341f741fSDavid Howells EM(afs_call_trace_wake, "WAKE ") \ 76341f741fSDavid Howells E_(afs_call_trace_work, "WORK ") 77341f741fSDavid Howells 78025db80cSDavid Howells #define afs_fs_operations \ 79025db80cSDavid Howells EM(afs_FS_FetchData, "FS.FetchData") \ 80025db80cSDavid Howells EM(afs_FS_FetchStatus, "FS.FetchStatus") \ 81025db80cSDavid Howells EM(afs_FS_StoreData, "FS.StoreData") \ 82025db80cSDavid Howells EM(afs_FS_StoreStatus, "FS.StoreStatus") \ 83025db80cSDavid Howells EM(afs_FS_RemoveFile, "FS.RemoveFile") \ 84025db80cSDavid Howells EM(afs_FS_CreateFile, "FS.CreateFile") \ 85025db80cSDavid Howells EM(afs_FS_Rename, "FS.Rename") \ 86025db80cSDavid Howells EM(afs_FS_Symlink, "FS.Symlink") \ 87025db80cSDavid Howells EM(afs_FS_Link, "FS.Link") \ 88025db80cSDavid Howells EM(afs_FS_MakeDir, "FS.MakeDir") \ 89025db80cSDavid Howells EM(afs_FS_RemoveDir, "FS.RemoveDir") \ 90025db80cSDavid Howells EM(afs_FS_GetVolumeInfo, "FS.GetVolumeInfo") \ 91025db80cSDavid Howells EM(afs_FS_GetVolumeStatus, "FS.GetVolumeStatus") \ 92025db80cSDavid Howells EM(afs_FS_GetRootVolume, "FS.GetRootVolume") \ 93025db80cSDavid Howells EM(afs_FS_SetLock, "FS.SetLock") \ 94025db80cSDavid Howells EM(afs_FS_ExtendLock, "FS.ExtendLock") \ 95025db80cSDavid Howells EM(afs_FS_ReleaseLock, "FS.ReleaseLock") \ 96025db80cSDavid Howells EM(afs_FS_Lookup, "FS.Lookup") \ 97*5cf9dd55SDavid Howells EM(afs_FS_InlineBulkStatus, "FS.InlineBulkStatus") \ 98025db80cSDavid Howells EM(afs_FS_FetchData64, "FS.FetchData64") \ 99025db80cSDavid Howells EM(afs_FS_StoreData64, "FS.StoreData64") \ 100025db80cSDavid Howells EM(afs_FS_GiveUpAllCallBacks, "FS.GiveUpAllCallBacks") \ 101025db80cSDavid Howells E_(afs_FS_GetCapabilities, "FS.GetCapabilities") 102025db80cSDavid Howells 103025db80cSDavid Howells #define afs_vl_operations \ 104025db80cSDavid Howells EM(afs_VL_GetEntryByNameU, "VL.GetEntryByNameU") \ 105025db80cSDavid Howells EM(afs_VL_GetAddrsU, "VL.GetAddrsU") \ 106025db80cSDavid Howells EM(afs_YFSVL_GetEndpoints, "YFSVL.GetEndpoints") \ 107025db80cSDavid Howells E_(afs_VL_GetCapabilities, "VL.GetCapabilities") 108025db80cSDavid Howells 109025db80cSDavid Howells 110341f741fSDavid Howells /* 111341f741fSDavid Howells * Export enum symbols via userspace. 112341f741fSDavid Howells */ 113341f741fSDavid Howells #undef EM 114341f741fSDavid Howells #undef E_ 115341f741fSDavid Howells #define EM(a, b) TRACE_DEFINE_ENUM(a); 116341f741fSDavid Howells #define E_(a, b) TRACE_DEFINE_ENUM(a); 117341f741fSDavid Howells 118341f741fSDavid Howells afs_call_traces; 119025db80cSDavid Howells afs_fs_operations; 120025db80cSDavid Howells afs_vl_operations; 121341f741fSDavid Howells 122341f741fSDavid Howells /* 123341f741fSDavid Howells * Now redefine the EM() and E_() macros to map the enums to the strings that 124341f741fSDavid Howells * will be printed in the output. 125341f741fSDavid Howells */ 126341f741fSDavid Howells #undef EM 127341f741fSDavid Howells #undef E_ 128341f741fSDavid Howells #define EM(a, b) { a, b }, 129341f741fSDavid Howells #define E_(a, b) { a, b } 130341f741fSDavid Howells 1318e8d7f13SDavid Howells TRACE_EVENT(afs_recv_data, 1328e8d7f13SDavid Howells TP_PROTO(struct afs_call *call, unsigned count, unsigned offset, 1338e8d7f13SDavid Howells bool want_more, int ret), 1348e8d7f13SDavid Howells 1358e8d7f13SDavid Howells TP_ARGS(call, count, offset, want_more, ret), 1368e8d7f13SDavid Howells 1378e8d7f13SDavid Howells TP_STRUCT__entry( 138a25e21f0SDavid Howells __field(unsigned int, call ) 1398e8d7f13SDavid Howells __field(enum afs_call_state, state ) 1408e8d7f13SDavid Howells __field(unsigned int, count ) 1418e8d7f13SDavid Howells __field(unsigned int, offset ) 1428e8d7f13SDavid Howells __field(unsigned short, unmarshall ) 1438e8d7f13SDavid Howells __field(bool, want_more ) 1448e8d7f13SDavid Howells __field(int, ret ) 1458e8d7f13SDavid Howells ), 1468e8d7f13SDavid Howells 1478e8d7f13SDavid Howells TP_fast_assign( 148a25e21f0SDavid Howells __entry->call = call->debug_id; 1498e8d7f13SDavid Howells __entry->state = call->state; 1508e8d7f13SDavid Howells __entry->unmarshall = call->unmarshall; 1518e8d7f13SDavid Howells __entry->count = count; 1528e8d7f13SDavid Howells __entry->offset = offset; 1538e8d7f13SDavid Howells __entry->want_more = want_more; 1548e8d7f13SDavid Howells __entry->ret = ret; 1558e8d7f13SDavid Howells ), 1568e8d7f13SDavid Howells 157a25e21f0SDavid Howells TP_printk("c=%08x s=%u u=%u %u/%u wm=%u ret=%d", 1588e8d7f13SDavid Howells __entry->call, 1598e8d7f13SDavid Howells __entry->state, __entry->unmarshall, 1608e8d7f13SDavid Howells __entry->offset, __entry->count, 1618e8d7f13SDavid Howells __entry->want_more, __entry->ret) 1628e8d7f13SDavid Howells ); 1638e8d7f13SDavid Howells 1648e8d7f13SDavid Howells TRACE_EVENT(afs_notify_call, 1658e8d7f13SDavid Howells TP_PROTO(struct rxrpc_call *rxcall, struct afs_call *call), 1668e8d7f13SDavid Howells 1678e8d7f13SDavid Howells TP_ARGS(rxcall, call), 1688e8d7f13SDavid Howells 1698e8d7f13SDavid Howells TP_STRUCT__entry( 170a25e21f0SDavid Howells __field(unsigned int, call ) 1718e8d7f13SDavid Howells __field(enum afs_call_state, state ) 1728e8d7f13SDavid Howells __field(unsigned short, unmarshall ) 1738e8d7f13SDavid Howells ), 1748e8d7f13SDavid Howells 1758e8d7f13SDavid Howells TP_fast_assign( 176a25e21f0SDavid Howells __entry->call = call->debug_id; 1778e8d7f13SDavid Howells __entry->state = call->state; 1788e8d7f13SDavid Howells __entry->unmarshall = call->unmarshall; 1798e8d7f13SDavid Howells ), 1808e8d7f13SDavid Howells 181a25e21f0SDavid Howells TP_printk("c=%08x s=%u u=%u", 1828e8d7f13SDavid Howells __entry->call, 1838e8d7f13SDavid Howells __entry->state, __entry->unmarshall) 1848e8d7f13SDavid Howells ); 1858e8d7f13SDavid Howells 1868e8d7f13SDavid Howells TRACE_EVENT(afs_cb_call, 1878e8d7f13SDavid Howells TP_PROTO(struct afs_call *call), 1888e8d7f13SDavid Howells 1898e8d7f13SDavid Howells TP_ARGS(call), 1908e8d7f13SDavid Howells 1918e8d7f13SDavid Howells TP_STRUCT__entry( 192a25e21f0SDavid Howells __field(unsigned int, call ) 1938e8d7f13SDavid Howells __field(const char *, name ) 1948e8d7f13SDavid Howells __field(u32, op ) 1958e8d7f13SDavid Howells ), 1968e8d7f13SDavid Howells 1978e8d7f13SDavid Howells TP_fast_assign( 198a25e21f0SDavid Howells __entry->call = call->debug_id; 1998e8d7f13SDavid Howells __entry->name = call->type->name; 2008e8d7f13SDavid Howells __entry->op = call->operation_ID; 2018e8d7f13SDavid Howells ), 2028e8d7f13SDavid Howells 203a25e21f0SDavid Howells TP_printk("c=%08x %s o=%u", 2048e8d7f13SDavid Howells __entry->call, 2058e8d7f13SDavid Howells __entry->name, 2068e8d7f13SDavid Howells __entry->op) 2078e8d7f13SDavid Howells ); 2088e8d7f13SDavid Howells 209341f741fSDavid Howells TRACE_EVENT(afs_call, 210341f741fSDavid Howells TP_PROTO(struct afs_call *call, enum afs_call_trace op, 211341f741fSDavid Howells int usage, int outstanding, const void *where), 212341f741fSDavid Howells 213341f741fSDavid Howells TP_ARGS(call, op, usage, outstanding, where), 214341f741fSDavid Howells 215341f741fSDavid Howells TP_STRUCT__entry( 216a25e21f0SDavid Howells __field(unsigned int, call ) 217341f741fSDavid Howells __field(int, op ) 218341f741fSDavid Howells __field(int, usage ) 219341f741fSDavid Howells __field(int, outstanding ) 220341f741fSDavid Howells __field(const void *, where ) 221341f741fSDavid Howells ), 222341f741fSDavid Howells 223341f741fSDavid Howells TP_fast_assign( 224a25e21f0SDavid Howells __entry->call = call->debug_id; 225341f741fSDavid Howells __entry->op = op; 226341f741fSDavid Howells __entry->usage = usage; 227341f741fSDavid Howells __entry->outstanding = outstanding; 228341f741fSDavid Howells __entry->where = where; 229341f741fSDavid Howells ), 230341f741fSDavid Howells 231a25e21f0SDavid Howells TP_printk("c=%08x %s u=%d o=%d sp=%pSR", 232341f741fSDavid Howells __entry->call, 233341f741fSDavid Howells __print_symbolic(__entry->op, afs_call_traces), 234341f741fSDavid Howells __entry->usage, 235341f741fSDavid Howells __entry->outstanding, 236341f741fSDavid Howells __entry->where) 237341f741fSDavid Howells ); 238341f741fSDavid Howells 239025db80cSDavid Howells TRACE_EVENT(afs_make_fs_call, 240025db80cSDavid Howells TP_PROTO(struct afs_call *call, const struct afs_fid *fid), 241025db80cSDavid Howells 242025db80cSDavid Howells TP_ARGS(call, fid), 243025db80cSDavid Howells 244025db80cSDavid Howells TP_STRUCT__entry( 245a25e21f0SDavid Howells __field(unsigned int, call ) 246025db80cSDavid Howells __field(enum afs_fs_operation, op ) 247025db80cSDavid Howells __field_struct(struct afs_fid, fid ) 248025db80cSDavid Howells ), 249025db80cSDavid Howells 250025db80cSDavid Howells TP_fast_assign( 251a25e21f0SDavid Howells __entry->call = call->debug_id; 252025db80cSDavid Howells __entry->op = call->operation_ID; 253025db80cSDavid Howells if (fid) { 254025db80cSDavid Howells __entry->fid = *fid; 255025db80cSDavid Howells } else { 256025db80cSDavid Howells __entry->fid.vid = 0; 257025db80cSDavid Howells __entry->fid.vnode = 0; 258025db80cSDavid Howells __entry->fid.unique = 0; 259025db80cSDavid Howells } 260025db80cSDavid Howells ), 261025db80cSDavid Howells 262a25e21f0SDavid Howells TP_printk("c=%08x %06x:%06x:%06x %s", 263025db80cSDavid Howells __entry->call, 264025db80cSDavid Howells __entry->fid.vid, 265025db80cSDavid Howells __entry->fid.vnode, 266025db80cSDavid Howells __entry->fid.unique, 267025db80cSDavid Howells __print_symbolic(__entry->op, afs_fs_operations)) 268025db80cSDavid Howells ); 269025db80cSDavid Howells 270025db80cSDavid Howells TRACE_EVENT(afs_make_vl_call, 271025db80cSDavid Howells TP_PROTO(struct afs_call *call), 272025db80cSDavid Howells 273025db80cSDavid Howells TP_ARGS(call), 274025db80cSDavid Howells 275025db80cSDavid Howells TP_STRUCT__entry( 276a25e21f0SDavid Howells __field(unsigned int, call ) 277025db80cSDavid Howells __field(enum afs_vl_operation, op ) 278025db80cSDavid Howells ), 279025db80cSDavid Howells 280025db80cSDavid Howells TP_fast_assign( 281a25e21f0SDavid Howells __entry->call = call->debug_id; 282025db80cSDavid Howells __entry->op = call->operation_ID; 283025db80cSDavid Howells ), 284025db80cSDavid Howells 285a25e21f0SDavid Howells TP_printk("c=%08x %s", 286025db80cSDavid Howells __entry->call, 287025db80cSDavid Howells __print_symbolic(__entry->op, afs_vl_operations)) 288025db80cSDavid Howells ); 289025db80cSDavid Howells 290025db80cSDavid Howells TRACE_EVENT(afs_call_done, 291025db80cSDavid Howells TP_PROTO(struct afs_call *call), 292025db80cSDavid Howells 293025db80cSDavid Howells TP_ARGS(call), 294025db80cSDavid Howells 295025db80cSDavid Howells TP_STRUCT__entry( 296a25e21f0SDavid Howells __field(unsigned int, call ) 297025db80cSDavid Howells __field(struct rxrpc_call *, rx_call ) 298025db80cSDavid Howells __field(int, ret ) 299025db80cSDavid Howells __field(u32, abort_code ) 300025db80cSDavid Howells ), 301025db80cSDavid Howells 302025db80cSDavid Howells TP_fast_assign( 303a25e21f0SDavid Howells __entry->call = call->debug_id; 304025db80cSDavid Howells __entry->rx_call = call->rxcall; 305025db80cSDavid Howells __entry->ret = call->error; 306025db80cSDavid Howells __entry->abort_code = call->abort_code; 307025db80cSDavid Howells ), 308025db80cSDavid Howells 309a25e21f0SDavid Howells TP_printk(" c=%08x ret=%d ab=%d [%p]", 310025db80cSDavid Howells __entry->call, 311025db80cSDavid Howells __entry->ret, 312025db80cSDavid Howells __entry->abort_code, 313025db80cSDavid Howells __entry->rx_call) 314025db80cSDavid Howells ); 315025db80cSDavid Howells 3162c099014SDavid Howells TRACE_EVENT(afs_send_pages, 3172c099014SDavid Howells TP_PROTO(struct afs_call *call, struct msghdr *msg, 3182c099014SDavid Howells pgoff_t first, pgoff_t last, unsigned int offset), 3192c099014SDavid Howells 3202c099014SDavid Howells TP_ARGS(call, msg, first, last, offset), 3212c099014SDavid Howells 3222c099014SDavid Howells TP_STRUCT__entry( 323a25e21f0SDavid Howells __field(unsigned int, call ) 3242c099014SDavid Howells __field(pgoff_t, first ) 3252c099014SDavid Howells __field(pgoff_t, last ) 3262c099014SDavid Howells __field(unsigned int, nr ) 3272c099014SDavid Howells __field(unsigned int, bytes ) 3282c099014SDavid Howells __field(unsigned int, offset ) 3292c099014SDavid Howells __field(unsigned int, flags ) 3302c099014SDavid Howells ), 3312c099014SDavid Howells 3322c099014SDavid Howells TP_fast_assign( 333a25e21f0SDavid Howells __entry->call = call->debug_id; 3342c099014SDavid Howells __entry->first = first; 3352c099014SDavid Howells __entry->last = last; 3362c099014SDavid Howells __entry->nr = msg->msg_iter.nr_segs; 3372c099014SDavid Howells __entry->bytes = msg->msg_iter.count; 3382c099014SDavid Howells __entry->offset = offset; 3392c099014SDavid Howells __entry->flags = msg->msg_flags; 3402c099014SDavid Howells ), 3412c099014SDavid Howells 342a25e21f0SDavid Howells TP_printk(" c=%08x %lx-%lx-%lx b=%x o=%x f=%x", 3432c099014SDavid Howells __entry->call, 3442c099014SDavid Howells __entry->first, __entry->first + __entry->nr - 1, __entry->last, 3452c099014SDavid Howells __entry->bytes, __entry->offset, 3462c099014SDavid Howells __entry->flags) 3472c099014SDavid Howells ); 3482c099014SDavid Howells 3492c099014SDavid Howells TRACE_EVENT(afs_sent_pages, 3502c099014SDavid Howells TP_PROTO(struct afs_call *call, pgoff_t first, pgoff_t last, 3512c099014SDavid Howells pgoff_t cursor, int ret), 3522c099014SDavid Howells 3532c099014SDavid Howells TP_ARGS(call, first, last, cursor, ret), 3542c099014SDavid Howells 3552c099014SDavid Howells TP_STRUCT__entry( 356a25e21f0SDavid Howells __field(unsigned int, call ) 3572c099014SDavid Howells __field(pgoff_t, first ) 3582c099014SDavid Howells __field(pgoff_t, last ) 3592c099014SDavid Howells __field(pgoff_t, cursor ) 3602c099014SDavid Howells __field(int, ret ) 3612c099014SDavid Howells ), 3622c099014SDavid Howells 3632c099014SDavid Howells TP_fast_assign( 364a25e21f0SDavid Howells __entry->call = call->debug_id; 3652c099014SDavid Howells __entry->first = first; 3662c099014SDavid Howells __entry->last = last; 3672c099014SDavid Howells __entry->cursor = cursor; 3682c099014SDavid Howells __entry->ret = ret; 3692c099014SDavid Howells ), 3702c099014SDavid Howells 371a25e21f0SDavid Howells TP_printk(" c=%08x %lx-%lx c=%lx r=%d", 3722c099014SDavid Howells __entry->call, 3732c099014SDavid Howells __entry->first, __entry->last, 3742c099014SDavid Howells __entry->cursor, __entry->ret) 3752c099014SDavid Howells ); 3762c099014SDavid Howells 377dab17c1aSDavid Howells TRACE_EVENT(afs_dir_check_failed, 378dab17c1aSDavid Howells TP_PROTO(struct afs_vnode *vnode, loff_t off, loff_t i_size), 379dab17c1aSDavid Howells 380dab17c1aSDavid Howells TP_ARGS(vnode, off, i_size), 381dab17c1aSDavid Howells 382dab17c1aSDavid Howells TP_STRUCT__entry( 383dab17c1aSDavid Howells __field(struct afs_vnode *, vnode ) 384dab17c1aSDavid Howells __field(loff_t, off ) 385dab17c1aSDavid Howells __field(loff_t, i_size ) 386dab17c1aSDavid Howells ), 387dab17c1aSDavid Howells 388dab17c1aSDavid Howells TP_fast_assign( 389dab17c1aSDavid Howells __entry->vnode = vnode; 390dab17c1aSDavid Howells __entry->off = off; 391dab17c1aSDavid Howells __entry->i_size = i_size; 392dab17c1aSDavid Howells ), 393dab17c1aSDavid Howells 394dab17c1aSDavid Howells TP_printk("vn=%p %llx/%llx", 395dab17c1aSDavid Howells __entry->vnode, __entry->off, __entry->i_size) 396dab17c1aSDavid Howells ); 397dab17c1aSDavid Howells 39813524ab3SDavid Howells /* 39913524ab3SDavid Howells * We use page->private to hold the amount of the page that we've written to, 40013524ab3SDavid Howells * splitting the field into two parts. However, we need to represent a range 40113524ab3SDavid Howells * 0...PAGE_SIZE inclusive, so we can't support 64K pages on a 32-bit system. 40213524ab3SDavid Howells */ 40313524ab3SDavid Howells #if PAGE_SIZE > 32768 40413524ab3SDavid Howells #define AFS_PRIV_MAX 0xffffffff 40513524ab3SDavid Howells #define AFS_PRIV_SHIFT 32 40613524ab3SDavid Howells #else 40713524ab3SDavid Howells #define AFS_PRIV_MAX 0xffff 40813524ab3SDavid Howells #define AFS_PRIV_SHIFT 16 40913524ab3SDavid Howells #endif 41013524ab3SDavid Howells 41113524ab3SDavid Howells TRACE_EVENT(afs_page_dirty, 41213524ab3SDavid Howells TP_PROTO(struct afs_vnode *vnode, const char *where, 41313524ab3SDavid Howells pgoff_t page, unsigned long priv), 41413524ab3SDavid Howells 41513524ab3SDavid Howells TP_ARGS(vnode, where, page, priv), 41613524ab3SDavid Howells 41713524ab3SDavid Howells TP_STRUCT__entry( 41813524ab3SDavid Howells __field(struct afs_vnode *, vnode ) 41913524ab3SDavid Howells __field(const char *, where ) 42013524ab3SDavid Howells __field(pgoff_t, page ) 42113524ab3SDavid Howells __field(unsigned long, priv ) 42213524ab3SDavid Howells ), 42313524ab3SDavid Howells 42413524ab3SDavid Howells TP_fast_assign( 42513524ab3SDavid Howells __entry->vnode = vnode; 42613524ab3SDavid Howells __entry->where = where; 42713524ab3SDavid Howells __entry->page = page; 42813524ab3SDavid Howells __entry->priv = priv; 42913524ab3SDavid Howells ), 43013524ab3SDavid Howells 43113524ab3SDavid Howells TP_printk("vn=%p %lx %s %lu-%lu", 43213524ab3SDavid Howells __entry->vnode, __entry->page, __entry->where, 43313524ab3SDavid Howells __entry->priv & AFS_PRIV_MAX, 43413524ab3SDavid Howells __entry->priv >> AFS_PRIV_SHIFT) 43513524ab3SDavid Howells ); 43613524ab3SDavid Howells 43798bf40cdSDavid Howells TRACE_EVENT(afs_call_state, 43898bf40cdSDavid Howells TP_PROTO(struct afs_call *call, 43998bf40cdSDavid Howells enum afs_call_state from, 44098bf40cdSDavid Howells enum afs_call_state to, 44198bf40cdSDavid Howells int ret, u32 remote_abort), 44298bf40cdSDavid Howells 44398bf40cdSDavid Howells TP_ARGS(call, from, to, ret, remote_abort), 44498bf40cdSDavid Howells 44598bf40cdSDavid Howells TP_STRUCT__entry( 446a25e21f0SDavid Howells __field(unsigned int, call ) 44798bf40cdSDavid Howells __field(enum afs_call_state, from ) 44898bf40cdSDavid Howells __field(enum afs_call_state, to ) 44998bf40cdSDavid Howells __field(int, ret ) 45098bf40cdSDavid Howells __field(u32, abort ) 45198bf40cdSDavid Howells ), 45298bf40cdSDavid Howells 45398bf40cdSDavid Howells TP_fast_assign( 454a25e21f0SDavid Howells __entry->call = call->debug_id; 45598bf40cdSDavid Howells __entry->from = from; 45698bf40cdSDavid Howells __entry->to = to; 45798bf40cdSDavid Howells __entry->ret = ret; 45898bf40cdSDavid Howells __entry->abort = remote_abort; 45998bf40cdSDavid Howells ), 46098bf40cdSDavid Howells 461a25e21f0SDavid Howells TP_printk("c=%08x %u->%u r=%d ab=%d", 46298bf40cdSDavid Howells __entry->call, 46398bf40cdSDavid Howells __entry->from, __entry->to, 46498bf40cdSDavid Howells __entry->ret, __entry->abort) 46598bf40cdSDavid Howells ); 46698bf40cdSDavid Howells 4678e8d7f13SDavid Howells #endif /* _TRACE_AFS_H */ 4688e8d7f13SDavid Howells 4698e8d7f13SDavid Howells /* This part must be outside protection */ 4708e8d7f13SDavid Howells #include <trace/define_trace.h> 471