1348b5901SAneesh Kumar K.V #undef TRACE_SYSTEM 2348b5901SAneesh Kumar K.V #define TRACE_SYSTEM 9p 3348b5901SAneesh Kumar K.V 4348b5901SAneesh Kumar K.V #if !defined(_TRACE_9P_H) || defined(TRACE_HEADER_MULTI_READ) 5348b5901SAneesh Kumar K.V #define _TRACE_9P_H 6348b5901SAneesh Kumar K.V 7348b5901SAneesh Kumar K.V #include <linux/tracepoint.h> 8348b5901SAneesh Kumar K.V 9*56e1b226SSteven Rostedt (Red Hat) #define P9_MSG_T \ 10*56e1b226SSteven Rostedt (Red Hat) EM( P9_TLERROR, "P9_TLERROR" ) \ 11*56e1b226SSteven Rostedt (Red Hat) EM( P9_RLERROR, "P9_RLERROR" ) \ 12*56e1b226SSteven Rostedt (Red Hat) EM( P9_TSTATFS, "P9_TSTATFS" ) \ 13*56e1b226SSteven Rostedt (Red Hat) EM( P9_RSTATFS, "P9_RSTATFS" ) \ 14*56e1b226SSteven Rostedt (Red Hat) EM( P9_TLOPEN, "P9_TLOPEN" ) \ 15*56e1b226SSteven Rostedt (Red Hat) EM( P9_RLOPEN, "P9_RLOPEN" ) \ 16*56e1b226SSteven Rostedt (Red Hat) EM( P9_TLCREATE, "P9_TLCREATE" ) \ 17*56e1b226SSteven Rostedt (Red Hat) EM( P9_RLCREATE, "P9_RLCREATE" ) \ 18*56e1b226SSteven Rostedt (Red Hat) EM( P9_TSYMLINK, "P9_TSYMLINK" ) \ 19*56e1b226SSteven Rostedt (Red Hat) EM( P9_RSYMLINK, "P9_RSYMLINK" ) \ 20*56e1b226SSteven Rostedt (Red Hat) EM( P9_TMKNOD, "P9_TMKNOD" ) \ 21*56e1b226SSteven Rostedt (Red Hat) EM( P9_RMKNOD, "P9_RMKNOD" ) \ 22*56e1b226SSteven Rostedt (Red Hat) EM( P9_TRENAME, "P9_TRENAME" ) \ 23*56e1b226SSteven Rostedt (Red Hat) EM( P9_RRENAME, "P9_RRENAME" ) \ 24*56e1b226SSteven Rostedt (Red Hat) EM( P9_TREADLINK, "P9_TREADLINK" ) \ 25*56e1b226SSteven Rostedt (Red Hat) EM( P9_RREADLINK, "P9_RREADLINK" ) \ 26*56e1b226SSteven Rostedt (Red Hat) EM( P9_TGETATTR, "P9_TGETATTR" ) \ 27*56e1b226SSteven Rostedt (Red Hat) EM( P9_RGETATTR, "P9_RGETATTR" ) \ 28*56e1b226SSteven Rostedt (Red Hat) EM( P9_TSETATTR, "P9_TSETATTR" ) \ 29*56e1b226SSteven Rostedt (Red Hat) EM( P9_RSETATTR, "P9_RSETATTR" ) \ 30*56e1b226SSteven Rostedt (Red Hat) EM( P9_TXATTRWALK, "P9_TXATTRWALK" ) \ 31*56e1b226SSteven Rostedt (Red Hat) EM( P9_RXATTRWALK, "P9_RXATTRWALK" ) \ 32*56e1b226SSteven Rostedt (Red Hat) EM( P9_TXATTRCREATE, "P9_TXATTRCREATE" ) \ 33*56e1b226SSteven Rostedt (Red Hat) EM( P9_RXATTRCREATE, "P9_RXATTRCREATE" ) \ 34*56e1b226SSteven Rostedt (Red Hat) EM( P9_TREADDIR, "P9_TREADDIR" ) \ 35*56e1b226SSteven Rostedt (Red Hat) EM( P9_RREADDIR, "P9_RREADDIR" ) \ 36*56e1b226SSteven Rostedt (Red Hat) EM( P9_TFSYNC, "P9_TFSYNC" ) \ 37*56e1b226SSteven Rostedt (Red Hat) EM( P9_RFSYNC, "P9_RFSYNC" ) \ 38*56e1b226SSteven Rostedt (Red Hat) EM( P9_TLOCK, "P9_TLOCK" ) \ 39*56e1b226SSteven Rostedt (Red Hat) EM( P9_RLOCK, "P9_RLOCK" ) \ 40*56e1b226SSteven Rostedt (Red Hat) EM( P9_TGETLOCK, "P9_TGETLOCK" ) \ 41*56e1b226SSteven Rostedt (Red Hat) EM( P9_RGETLOCK, "P9_RGETLOCK" ) \ 42*56e1b226SSteven Rostedt (Red Hat) EM( P9_TLINK, "P9_TLINK" ) \ 43*56e1b226SSteven Rostedt (Red Hat) EM( P9_RLINK, "P9_RLINK" ) \ 44*56e1b226SSteven Rostedt (Red Hat) EM( P9_TMKDIR, "P9_TMKDIR" ) \ 45*56e1b226SSteven Rostedt (Red Hat) EM( P9_RMKDIR, "P9_RMKDIR" ) \ 46*56e1b226SSteven Rostedt (Red Hat) EM( P9_TRENAMEAT, "P9_TRENAMEAT" ) \ 47*56e1b226SSteven Rostedt (Red Hat) EM( P9_RRENAMEAT, "P9_RRENAMEAT" ) \ 48*56e1b226SSteven Rostedt (Red Hat) EM( P9_TUNLINKAT, "P9_TUNLINKAT" ) \ 49*56e1b226SSteven Rostedt (Red Hat) EM( P9_RUNLINKAT, "P9_RUNLINKAT" ) \ 50*56e1b226SSteven Rostedt (Red Hat) EM( P9_TVERSION, "P9_TVERSION" ) \ 51*56e1b226SSteven Rostedt (Red Hat) EM( P9_RVERSION, "P9_RVERSION" ) \ 52*56e1b226SSteven Rostedt (Red Hat) EM( P9_TAUTH, "P9_TAUTH" ) \ 53*56e1b226SSteven Rostedt (Red Hat) EM( P9_RAUTH, "P9_RAUTH" ) \ 54*56e1b226SSteven Rostedt (Red Hat) EM( P9_TATTACH, "P9_TATTACH" ) \ 55*56e1b226SSteven Rostedt (Red Hat) EM( P9_RATTACH, "P9_RATTACH" ) \ 56*56e1b226SSteven Rostedt (Red Hat) EM( P9_TERROR, "P9_TERROR" ) \ 57*56e1b226SSteven Rostedt (Red Hat) EM( P9_RERROR, "P9_RERROR" ) \ 58*56e1b226SSteven Rostedt (Red Hat) EM( P9_TFLUSH, "P9_TFLUSH" ) \ 59*56e1b226SSteven Rostedt (Red Hat) EM( P9_RFLUSH, "P9_RFLUSH" ) \ 60*56e1b226SSteven Rostedt (Red Hat) EM( P9_TWALK, "P9_TWALK" ) \ 61*56e1b226SSteven Rostedt (Red Hat) EM( P9_RWALK, "P9_RWALK" ) \ 62*56e1b226SSteven Rostedt (Red Hat) EM( P9_TOPEN, "P9_TOPEN" ) \ 63*56e1b226SSteven Rostedt (Red Hat) EM( P9_ROPEN, "P9_ROPEN" ) \ 64*56e1b226SSteven Rostedt (Red Hat) EM( P9_TCREATE, "P9_TCREATE" ) \ 65*56e1b226SSteven Rostedt (Red Hat) EM( P9_RCREATE, "P9_RCREATE" ) \ 66*56e1b226SSteven Rostedt (Red Hat) EM( P9_TREAD, "P9_TREAD" ) \ 67*56e1b226SSteven Rostedt (Red Hat) EM( P9_RREAD, "P9_RREAD" ) \ 68*56e1b226SSteven Rostedt (Red Hat) EM( P9_TWRITE, "P9_TWRITE" ) \ 69*56e1b226SSteven Rostedt (Red Hat) EM( P9_RWRITE, "P9_RWRITE" ) \ 70*56e1b226SSteven Rostedt (Red Hat) EM( P9_TCLUNK, "P9_TCLUNK" ) \ 71*56e1b226SSteven Rostedt (Red Hat) EM( P9_RCLUNK, "P9_RCLUNK" ) \ 72*56e1b226SSteven Rostedt (Red Hat) EM( P9_TREMOVE, "P9_TREMOVE" ) \ 73*56e1b226SSteven Rostedt (Red Hat) EM( P9_RREMOVE, "P9_RREMOVE" ) \ 74*56e1b226SSteven Rostedt (Red Hat) EM( P9_TSTAT, "P9_TSTAT" ) \ 75*56e1b226SSteven Rostedt (Red Hat) EM( P9_RSTAT, "P9_RSTAT" ) \ 76*56e1b226SSteven Rostedt (Red Hat) EM( P9_TWSTAT, "P9_TWSTAT" ) \ 77*56e1b226SSteven Rostedt (Red Hat) EMe(P9_RWSTAT, "P9_RWSTAT" ) 78*56e1b226SSteven Rostedt (Red Hat) 79*56e1b226SSteven Rostedt (Red Hat) /* Define EM() to export the enums to userspace via TRACE_DEFINE_ENUM() */ 80*56e1b226SSteven Rostedt (Red Hat) #undef EM 81*56e1b226SSteven Rostedt (Red Hat) #undef EMe 82*56e1b226SSteven Rostedt (Red Hat) #define EM(a, b) TRACE_DEFINE_ENUM(a); 83*56e1b226SSteven Rostedt (Red Hat) #define EMe(a, b) TRACE_DEFINE_ENUM(a); 84*56e1b226SSteven Rostedt (Red Hat) 85*56e1b226SSteven Rostedt (Red Hat) P9_MSG_T 86*56e1b226SSteven Rostedt (Red Hat) 87*56e1b226SSteven Rostedt (Red Hat) /* 88*56e1b226SSteven Rostedt (Red Hat) * Now redefine the EM() and EMe() macros to map the enums to the strings 89*56e1b226SSteven Rostedt (Red Hat) * that will be printed in the output. 90*56e1b226SSteven Rostedt (Red Hat) */ 91*56e1b226SSteven Rostedt (Red Hat) #undef EM 92*56e1b226SSteven Rostedt (Red Hat) #undef EMe 93*56e1b226SSteven Rostedt (Red Hat) #define EM(a, b) { a, b }, 94*56e1b226SSteven Rostedt (Red Hat) #define EMe(a, b) { a, b } 95*56e1b226SSteven Rostedt (Red Hat) 96348b5901SAneesh Kumar K.V #define show_9p_op(type) \ 97*56e1b226SSteven Rostedt (Red Hat) __print_symbolic(type, P9_MSG_T) 98348b5901SAneesh Kumar K.V 99348b5901SAneesh Kumar K.V TRACE_EVENT(9p_client_req, 100348b5901SAneesh Kumar K.V TP_PROTO(struct p9_client *clnt, int8_t type, int tag), 101348b5901SAneesh Kumar K.V 102348b5901SAneesh Kumar K.V TP_ARGS(clnt, type, tag), 103348b5901SAneesh Kumar K.V 104348b5901SAneesh Kumar K.V TP_STRUCT__entry( 105348b5901SAneesh Kumar K.V __field( void *, clnt ) 106348b5901SAneesh Kumar K.V __field( __u8, type ) 107348b5901SAneesh Kumar K.V __field( __u32, tag ) 108348b5901SAneesh Kumar K.V ), 109348b5901SAneesh Kumar K.V 110348b5901SAneesh Kumar K.V TP_fast_assign( 111348b5901SAneesh Kumar K.V __entry->clnt = clnt; 112348b5901SAneesh Kumar K.V __entry->type = type; 113348b5901SAneesh Kumar K.V __entry->tag = tag; 114348b5901SAneesh Kumar K.V ), 115348b5901SAneesh Kumar K.V 116348b5901SAneesh Kumar K.V TP_printk("client %lu request %s tag %d", 117348b5901SAneesh Kumar K.V (long)__entry->clnt, show_9p_op(__entry->type), 118348b5901SAneesh Kumar K.V __entry->tag) 119348b5901SAneesh Kumar K.V ); 120348b5901SAneesh Kumar K.V 121348b5901SAneesh Kumar K.V TRACE_EVENT(9p_client_res, 122348b5901SAneesh Kumar K.V TP_PROTO(struct p9_client *clnt, int8_t type, int tag, int err), 123348b5901SAneesh Kumar K.V 124348b5901SAneesh Kumar K.V TP_ARGS(clnt, type, tag, err), 125348b5901SAneesh Kumar K.V 126348b5901SAneesh Kumar K.V TP_STRUCT__entry( 127348b5901SAneesh Kumar K.V __field( void *, clnt ) 128348b5901SAneesh Kumar K.V __field( __u8, type ) 129348b5901SAneesh Kumar K.V __field( __u32, tag ) 130348b5901SAneesh Kumar K.V __field( __u32, err ) 131348b5901SAneesh Kumar K.V ), 132348b5901SAneesh Kumar K.V 133348b5901SAneesh Kumar K.V TP_fast_assign( 134348b5901SAneesh Kumar K.V __entry->clnt = clnt; 135348b5901SAneesh Kumar K.V __entry->type = type; 136348b5901SAneesh Kumar K.V __entry->tag = tag; 137348b5901SAneesh Kumar K.V __entry->err = err; 138348b5901SAneesh Kumar K.V ), 139348b5901SAneesh Kumar K.V 140348b5901SAneesh Kumar K.V TP_printk("client %lu response %s tag %d err %d", 141348b5901SAneesh Kumar K.V (long)__entry->clnt, show_9p_op(__entry->type), 142348b5901SAneesh Kumar K.V __entry->tag, __entry->err) 143348b5901SAneesh Kumar K.V ); 144348b5901SAneesh Kumar K.V 145348b5901SAneesh Kumar K.V /* dump 32 bytes of protocol data */ 146348b5901SAneesh Kumar K.V #define P9_PROTO_DUMP_SZ 32 147348b5901SAneesh Kumar K.V TRACE_EVENT(9p_protocol_dump, 148348b5901SAneesh Kumar K.V TP_PROTO(struct p9_client *clnt, struct p9_fcall *pdu), 149348b5901SAneesh Kumar K.V 150348b5901SAneesh Kumar K.V TP_ARGS(clnt, pdu), 151348b5901SAneesh Kumar K.V 152348b5901SAneesh Kumar K.V TP_STRUCT__entry( 153348b5901SAneesh Kumar K.V __field( void *, clnt ) 154348b5901SAneesh Kumar K.V __field( __u8, type ) 155348b5901SAneesh Kumar K.V __field( __u16, tag ) 156348b5901SAneesh Kumar K.V __array( unsigned char, line, P9_PROTO_DUMP_SZ ) 157348b5901SAneesh Kumar K.V ), 158348b5901SAneesh Kumar K.V 159348b5901SAneesh Kumar K.V TP_fast_assign( 160348b5901SAneesh Kumar K.V __entry->clnt = clnt; 161348b5901SAneesh Kumar K.V __entry->type = pdu->id; 162348b5901SAneesh Kumar K.V __entry->tag = pdu->tag; 163348b5901SAneesh Kumar K.V memcpy(__entry->line, pdu->sdata, P9_PROTO_DUMP_SZ); 164348b5901SAneesh Kumar K.V ), 165cfdadef3SAndy Shevchenko TP_printk("clnt %lu %s(tag = %d)\n%.3x: %16ph\n%.3x: %16ph\n", 166cfdadef3SAndy Shevchenko (unsigned long)__entry->clnt, show_9p_op(__entry->type), 167cfdadef3SAndy Shevchenko __entry->tag, 0, __entry->line, 16, __entry->line + 16) 168348b5901SAneesh Kumar K.V ); 169348b5901SAneesh Kumar K.V 170348b5901SAneesh Kumar K.V #endif /* _TRACE_9P_H */ 171348b5901SAneesh Kumar K.V 172348b5901SAneesh Kumar K.V /* This part must be outside protection */ 173348b5901SAneesh Kumar K.V #include <trace/define_trace.h> 174