1*348b5901SAneesh Kumar K.V #undef TRACE_SYSTEM 2*348b5901SAneesh Kumar K.V #define TRACE_SYSTEM 9p 3*348b5901SAneesh Kumar K.V 4*348b5901SAneesh Kumar K.V #if !defined(_TRACE_9P_H) || defined(TRACE_HEADER_MULTI_READ) 5*348b5901SAneesh Kumar K.V #define _TRACE_9P_H 6*348b5901SAneesh Kumar K.V 7*348b5901SAneesh Kumar K.V #include <linux/tracepoint.h> 8*348b5901SAneesh Kumar K.V 9*348b5901SAneesh Kumar K.V #define show_9p_op(type) \ 10*348b5901SAneesh Kumar K.V __print_symbolic(type, \ 11*348b5901SAneesh Kumar K.V { P9_TLERROR, "P9_TLERROR" }, \ 12*348b5901SAneesh Kumar K.V { P9_RLERROR, "P9_RLERROR" }, \ 13*348b5901SAneesh Kumar K.V { P9_TSTATFS, "P9_TSTATFS" }, \ 14*348b5901SAneesh Kumar K.V { P9_RSTATFS, "P9_RSTATFS" }, \ 15*348b5901SAneesh Kumar K.V { P9_TLOPEN, "P9_TLOPEN" }, \ 16*348b5901SAneesh Kumar K.V { P9_RLOPEN, "P9_RLOPEN" }, \ 17*348b5901SAneesh Kumar K.V { P9_TLCREATE, "P9_TLCREATE" }, \ 18*348b5901SAneesh Kumar K.V { P9_RLCREATE, "P9_RLCREATE" }, \ 19*348b5901SAneesh Kumar K.V { P9_TSYMLINK, "P9_TSYMLINK" }, \ 20*348b5901SAneesh Kumar K.V { P9_RSYMLINK, "P9_RSYMLINK" }, \ 21*348b5901SAneesh Kumar K.V { P9_TMKNOD, "P9_TMKNOD" }, \ 22*348b5901SAneesh Kumar K.V { P9_RMKNOD, "P9_RMKNOD" }, \ 23*348b5901SAneesh Kumar K.V { P9_TRENAME, "P9_TRENAME" }, \ 24*348b5901SAneesh Kumar K.V { P9_RRENAME, "P9_RRENAME" }, \ 25*348b5901SAneesh Kumar K.V { P9_TREADLINK, "P9_TREADLINK" }, \ 26*348b5901SAneesh Kumar K.V { P9_RREADLINK, "P9_RREADLINK" }, \ 27*348b5901SAneesh Kumar K.V { P9_TGETATTR, "P9_TGETATTR" }, \ 28*348b5901SAneesh Kumar K.V { P9_RGETATTR, "P9_RGETATTR" }, \ 29*348b5901SAneesh Kumar K.V { P9_TSETATTR, "P9_TSETATTR" }, \ 30*348b5901SAneesh Kumar K.V { P9_RSETATTR, "P9_RSETATTR" }, \ 31*348b5901SAneesh Kumar K.V { P9_TXATTRWALK, "P9_TXATTRWALK" }, \ 32*348b5901SAneesh Kumar K.V { P9_RXATTRWALK, "P9_RXATTRWALK" }, \ 33*348b5901SAneesh Kumar K.V { P9_TXATTRCREATE, "P9_TXATTRCREATE" }, \ 34*348b5901SAneesh Kumar K.V { P9_RXATTRCREATE, "P9_RXATTRCREATE" }, \ 35*348b5901SAneesh Kumar K.V { P9_TREADDIR, "P9_TREADDIR" }, \ 36*348b5901SAneesh Kumar K.V { P9_RREADDIR, "P9_RREADDIR" }, \ 37*348b5901SAneesh Kumar K.V { P9_TFSYNC, "P9_TFSYNC" }, \ 38*348b5901SAneesh Kumar K.V { P9_RFSYNC, "P9_RFSYNC" }, \ 39*348b5901SAneesh Kumar K.V { P9_TLOCK, "P9_TLOCK" }, \ 40*348b5901SAneesh Kumar K.V { P9_RLOCK, "P9_RLOCK" }, \ 41*348b5901SAneesh Kumar K.V { P9_TGETLOCK, "P9_TGETLOCK" }, \ 42*348b5901SAneesh Kumar K.V { P9_RGETLOCK, "P9_RGETLOCK" }, \ 43*348b5901SAneesh Kumar K.V { P9_TLINK, "P9_TLINK" }, \ 44*348b5901SAneesh Kumar K.V { P9_RLINK, "P9_RLINK" }, \ 45*348b5901SAneesh Kumar K.V { P9_TMKDIR, "P9_TMKDIR" }, \ 46*348b5901SAneesh Kumar K.V { P9_RMKDIR, "P9_RMKDIR" }, \ 47*348b5901SAneesh Kumar K.V { P9_TRENAMEAT, "P9_TRENAMEAT" }, \ 48*348b5901SAneesh Kumar K.V { P9_RRENAMEAT, "P9_RRENAMEAT" }, \ 49*348b5901SAneesh Kumar K.V { P9_TUNLINKAT, "P9_TUNLINKAT" }, \ 50*348b5901SAneesh Kumar K.V { P9_RUNLINKAT, "P9_RUNLINKAT" }, \ 51*348b5901SAneesh Kumar K.V { P9_TVERSION, "P9_TVERSION" }, \ 52*348b5901SAneesh Kumar K.V { P9_RVERSION, "P9_RVERSION" }, \ 53*348b5901SAneesh Kumar K.V { P9_TAUTH, "P9_TAUTH" }, \ 54*348b5901SAneesh Kumar K.V { P9_RAUTH, "P9_RAUTH" }, \ 55*348b5901SAneesh Kumar K.V { P9_TATTACH, "P9_TATTACH" }, \ 56*348b5901SAneesh Kumar K.V { P9_RATTACH, "P9_RATTACH" }, \ 57*348b5901SAneesh Kumar K.V { P9_TERROR, "P9_TERROR" }, \ 58*348b5901SAneesh Kumar K.V { P9_RERROR, "P9_RERROR" }, \ 59*348b5901SAneesh Kumar K.V { P9_TFLUSH, "P9_TFLUSH" }, \ 60*348b5901SAneesh Kumar K.V { P9_RFLUSH, "P9_RFLUSH" }, \ 61*348b5901SAneesh Kumar K.V { P9_TWALK, "P9_TWALK" }, \ 62*348b5901SAneesh Kumar K.V { P9_RWALK, "P9_RWALK" }, \ 63*348b5901SAneesh Kumar K.V { P9_TOPEN, "P9_TOPEN" }, \ 64*348b5901SAneesh Kumar K.V { P9_ROPEN, "P9_ROPEN" }, \ 65*348b5901SAneesh Kumar K.V { P9_TCREATE, "P9_TCREATE" }, \ 66*348b5901SAneesh Kumar K.V { P9_RCREATE, "P9_RCREATE" }, \ 67*348b5901SAneesh Kumar K.V { P9_TREAD, "P9_TREAD" }, \ 68*348b5901SAneesh Kumar K.V { P9_RREAD, "P9_RREAD" }, \ 69*348b5901SAneesh Kumar K.V { P9_TWRITE, "P9_TWRITE" }, \ 70*348b5901SAneesh Kumar K.V { P9_RWRITE, "P9_RWRITE" }, \ 71*348b5901SAneesh Kumar K.V { P9_TCLUNK, "P9_TCLUNK" }, \ 72*348b5901SAneesh Kumar K.V { P9_RCLUNK, "P9_RCLUNK" }, \ 73*348b5901SAneesh Kumar K.V { P9_TREMOVE, "P9_TREMOVE" }, \ 74*348b5901SAneesh Kumar K.V { P9_RREMOVE, "P9_RREMOVE" }, \ 75*348b5901SAneesh Kumar K.V { P9_TSTAT, "P9_TSTAT" }, \ 76*348b5901SAneesh Kumar K.V { P9_RSTAT, "P9_RSTAT" }, \ 77*348b5901SAneesh Kumar K.V { P9_TWSTAT, "P9_TWSTAT" }, \ 78*348b5901SAneesh Kumar K.V { P9_RWSTAT, "P9_RWSTAT" }) 79*348b5901SAneesh Kumar K.V 80*348b5901SAneesh Kumar K.V TRACE_EVENT(9p_client_req, 81*348b5901SAneesh Kumar K.V TP_PROTO(struct p9_client *clnt, int8_t type, int tag), 82*348b5901SAneesh Kumar K.V 83*348b5901SAneesh Kumar K.V TP_ARGS(clnt, type, tag), 84*348b5901SAneesh Kumar K.V 85*348b5901SAneesh Kumar K.V TP_STRUCT__entry( 86*348b5901SAneesh Kumar K.V __field( void *, clnt ) 87*348b5901SAneesh Kumar K.V __field( __u8, type ) 88*348b5901SAneesh Kumar K.V __field( __u32, tag ) 89*348b5901SAneesh Kumar K.V ), 90*348b5901SAneesh Kumar K.V 91*348b5901SAneesh Kumar K.V TP_fast_assign( 92*348b5901SAneesh Kumar K.V __entry->clnt = clnt; 93*348b5901SAneesh Kumar K.V __entry->type = type; 94*348b5901SAneesh Kumar K.V __entry->tag = tag; 95*348b5901SAneesh Kumar K.V ), 96*348b5901SAneesh Kumar K.V 97*348b5901SAneesh Kumar K.V TP_printk("client %lu request %s tag %d", 98*348b5901SAneesh Kumar K.V (long)__entry->clnt, show_9p_op(__entry->type), 99*348b5901SAneesh Kumar K.V __entry->tag) 100*348b5901SAneesh Kumar K.V ); 101*348b5901SAneesh Kumar K.V 102*348b5901SAneesh Kumar K.V TRACE_EVENT(9p_client_res, 103*348b5901SAneesh Kumar K.V TP_PROTO(struct p9_client *clnt, int8_t type, int tag, int err), 104*348b5901SAneesh Kumar K.V 105*348b5901SAneesh Kumar K.V TP_ARGS(clnt, type, tag, err), 106*348b5901SAneesh Kumar K.V 107*348b5901SAneesh Kumar K.V TP_STRUCT__entry( 108*348b5901SAneesh Kumar K.V __field( void *, clnt ) 109*348b5901SAneesh Kumar K.V __field( __u8, type ) 110*348b5901SAneesh Kumar K.V __field( __u32, tag ) 111*348b5901SAneesh Kumar K.V __field( __u32, err ) 112*348b5901SAneesh Kumar K.V ), 113*348b5901SAneesh Kumar K.V 114*348b5901SAneesh Kumar K.V TP_fast_assign( 115*348b5901SAneesh Kumar K.V __entry->clnt = clnt; 116*348b5901SAneesh Kumar K.V __entry->type = type; 117*348b5901SAneesh Kumar K.V __entry->tag = tag; 118*348b5901SAneesh Kumar K.V __entry->err = err; 119*348b5901SAneesh Kumar K.V ), 120*348b5901SAneesh Kumar K.V 121*348b5901SAneesh Kumar K.V TP_printk("client %lu response %s tag %d err %d", 122*348b5901SAneesh Kumar K.V (long)__entry->clnt, show_9p_op(__entry->type), 123*348b5901SAneesh Kumar K.V __entry->tag, __entry->err) 124*348b5901SAneesh Kumar K.V ); 125*348b5901SAneesh Kumar K.V 126*348b5901SAneesh Kumar K.V /* dump 32 bytes of protocol data */ 127*348b5901SAneesh Kumar K.V #define P9_PROTO_DUMP_SZ 32 128*348b5901SAneesh Kumar K.V TRACE_EVENT(9p_protocol_dump, 129*348b5901SAneesh Kumar K.V TP_PROTO(struct p9_client *clnt, struct p9_fcall *pdu), 130*348b5901SAneesh Kumar K.V 131*348b5901SAneesh Kumar K.V TP_ARGS(clnt, pdu), 132*348b5901SAneesh Kumar K.V 133*348b5901SAneesh Kumar K.V TP_STRUCT__entry( 134*348b5901SAneesh Kumar K.V __field( void *, clnt ) 135*348b5901SAneesh Kumar K.V __field( __u8, type ) 136*348b5901SAneesh Kumar K.V __field( __u16, tag ) 137*348b5901SAneesh Kumar K.V __array( unsigned char, line, P9_PROTO_DUMP_SZ ) 138*348b5901SAneesh Kumar K.V ), 139*348b5901SAneesh Kumar K.V 140*348b5901SAneesh Kumar K.V TP_fast_assign( 141*348b5901SAneesh Kumar K.V __entry->clnt = clnt; 142*348b5901SAneesh Kumar K.V __entry->type = pdu->id; 143*348b5901SAneesh Kumar K.V __entry->tag = pdu->tag; 144*348b5901SAneesh Kumar K.V memcpy(__entry->line, pdu->sdata, P9_PROTO_DUMP_SZ); 145*348b5901SAneesh Kumar K.V ), 146*348b5901SAneesh Kumar K.V TP_printk("clnt %lu %s(tag = %d)\n%.3x: " 147*348b5901SAneesh Kumar K.V "%02x %02x %02x %02x %02x %02x %02x %02x " 148*348b5901SAneesh Kumar K.V "%02x %02x %02x %02x %02x %02x %02x %02x\n" 149*348b5901SAneesh Kumar K.V "%.3x: " 150*348b5901SAneesh Kumar K.V "%02x %02x %02x %02x %02x %02x %02x %02x " 151*348b5901SAneesh Kumar K.V "%02x %02x %02x %02x %02x %02x %02x %02x\n", 152*348b5901SAneesh Kumar K.V (long)__entry->clnt, show_9p_op(__entry->type), 153*348b5901SAneesh Kumar K.V __entry->tag, 0, 154*348b5901SAneesh Kumar K.V __entry->line[0], __entry->line[1], 155*348b5901SAneesh Kumar K.V __entry->line[2], __entry->line[3], 156*348b5901SAneesh Kumar K.V __entry->line[4], __entry->line[5], 157*348b5901SAneesh Kumar K.V __entry->line[6], __entry->line[7], 158*348b5901SAneesh Kumar K.V __entry->line[8], __entry->line[9], 159*348b5901SAneesh Kumar K.V __entry->line[10], __entry->line[11], 160*348b5901SAneesh Kumar K.V __entry->line[12], __entry->line[13], 161*348b5901SAneesh Kumar K.V __entry->line[14], __entry->line[15], 162*348b5901SAneesh Kumar K.V 16, 163*348b5901SAneesh Kumar K.V __entry->line[16], __entry->line[17], 164*348b5901SAneesh Kumar K.V __entry->line[18], __entry->line[19], 165*348b5901SAneesh Kumar K.V __entry->line[20], __entry->line[21], 166*348b5901SAneesh Kumar K.V __entry->line[22], __entry->line[23], 167*348b5901SAneesh Kumar K.V __entry->line[24], __entry->line[25], 168*348b5901SAneesh Kumar K.V __entry->line[26], __entry->line[27], 169*348b5901SAneesh Kumar K.V __entry->line[28], __entry->line[29], 170*348b5901SAneesh Kumar K.V __entry->line[30], __entry->line[31]) 171*348b5901SAneesh Kumar K.V ); 172*348b5901SAneesh Kumar K.V 173*348b5901SAneesh Kumar K.V #endif /* _TRACE_9P_H */ 174*348b5901SAneesh Kumar K.V 175*348b5901SAneesh Kumar K.V /* This part must be outside protection */ 176*348b5901SAneesh Kumar K.V #include <trace/define_trace.h> 177