xref: /openbmc/linux/include/trace/events/9p.h (revision cfdadef3)
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 
9348b5901SAneesh Kumar K.V #define show_9p_op(type)						\
10348b5901SAneesh Kumar K.V 	__print_symbolic(type,						\
11348b5901SAneesh Kumar K.V 			 { P9_TLERROR,		"P9_TLERROR" },		\
12348b5901SAneesh Kumar K.V 			 { P9_RLERROR,		"P9_RLERROR" },		\
13348b5901SAneesh Kumar K.V 			 { P9_TSTATFS,		"P9_TSTATFS" },		\
14348b5901SAneesh Kumar K.V 			 { P9_RSTATFS,		"P9_RSTATFS" },		\
15348b5901SAneesh Kumar K.V 			 { P9_TLOPEN,		"P9_TLOPEN" },		\
16348b5901SAneesh Kumar K.V 			 { P9_RLOPEN,		"P9_RLOPEN" },		\
17348b5901SAneesh Kumar K.V 			 { P9_TLCREATE,		"P9_TLCREATE" },	\
18348b5901SAneesh Kumar K.V 			 { P9_RLCREATE,		"P9_RLCREATE" },	\
19348b5901SAneesh Kumar K.V 			 { P9_TSYMLINK,		"P9_TSYMLINK" },	\
20348b5901SAneesh Kumar K.V 			 { P9_RSYMLINK,		"P9_RSYMLINK" },	\
21348b5901SAneesh Kumar K.V 			 { P9_TMKNOD,		"P9_TMKNOD" },		\
22348b5901SAneesh Kumar K.V 			 { P9_RMKNOD,		"P9_RMKNOD" },		\
23348b5901SAneesh Kumar K.V 			 { P9_TRENAME,		"P9_TRENAME" },		\
24348b5901SAneesh Kumar K.V 			 { P9_RRENAME,		"P9_RRENAME" },		\
25348b5901SAneesh Kumar K.V 			 { P9_TREADLINK,	"P9_TREADLINK" },	\
26348b5901SAneesh Kumar K.V 			 { P9_RREADLINK,	"P9_RREADLINK" },	\
27348b5901SAneesh Kumar K.V 			 { P9_TGETATTR,		"P9_TGETATTR" },	\
28348b5901SAneesh Kumar K.V 			 { P9_RGETATTR,		"P9_RGETATTR" },	\
29348b5901SAneesh Kumar K.V 			 { P9_TSETATTR,		"P9_TSETATTR" },	\
30348b5901SAneesh Kumar K.V 			 { P9_RSETATTR,		"P9_RSETATTR" },	\
31348b5901SAneesh Kumar K.V 			 { P9_TXATTRWALK,	"P9_TXATTRWALK" },	\
32348b5901SAneesh Kumar K.V 			 { P9_RXATTRWALK,	"P9_RXATTRWALK" },	\
33348b5901SAneesh Kumar K.V 			 { P9_TXATTRCREATE,	"P9_TXATTRCREATE" },	\
34348b5901SAneesh Kumar K.V 			 { P9_RXATTRCREATE,	"P9_RXATTRCREATE" },	\
35348b5901SAneesh Kumar K.V 			 { P9_TREADDIR,		"P9_TREADDIR" },	\
36348b5901SAneesh Kumar K.V 			 { P9_RREADDIR,		"P9_RREADDIR" },	\
37348b5901SAneesh Kumar K.V 			 { P9_TFSYNC,		"P9_TFSYNC" },		\
38348b5901SAneesh Kumar K.V 			 { P9_RFSYNC,		"P9_RFSYNC" },		\
39348b5901SAneesh Kumar K.V 			 { P9_TLOCK,		"P9_TLOCK" },		\
40348b5901SAneesh Kumar K.V 			 { P9_RLOCK,		"P9_RLOCK" },		\
41348b5901SAneesh Kumar K.V 			 { P9_TGETLOCK,		"P9_TGETLOCK" },	\
42348b5901SAneesh Kumar K.V 			 { P9_RGETLOCK,		"P9_RGETLOCK" },	\
43348b5901SAneesh Kumar K.V 			 { P9_TLINK,		"P9_TLINK" },		\
44348b5901SAneesh Kumar K.V 			 { P9_RLINK,		"P9_RLINK" },		\
45348b5901SAneesh Kumar K.V 			 { P9_TMKDIR,		"P9_TMKDIR" },		\
46348b5901SAneesh Kumar K.V 			 { P9_RMKDIR,		"P9_RMKDIR" },		\
47348b5901SAneesh Kumar K.V 			 { P9_TRENAMEAT,	"P9_TRENAMEAT" },	\
48348b5901SAneesh Kumar K.V 			 { P9_RRENAMEAT,	"P9_RRENAMEAT" },	\
49348b5901SAneesh Kumar K.V 			 { P9_TUNLINKAT,	"P9_TUNLINKAT" },	\
50348b5901SAneesh Kumar K.V 			 { P9_RUNLINKAT,	"P9_RUNLINKAT" },	\
51348b5901SAneesh Kumar K.V 			 { P9_TVERSION,		"P9_TVERSION" },	\
52348b5901SAneesh Kumar K.V 			 { P9_RVERSION,		"P9_RVERSION" },	\
53348b5901SAneesh Kumar K.V 			 { P9_TAUTH,		"P9_TAUTH" },		\
54348b5901SAneesh Kumar K.V 			 { P9_RAUTH,		"P9_RAUTH" },		\
55348b5901SAneesh Kumar K.V 			 { P9_TATTACH,		"P9_TATTACH" },		\
56348b5901SAneesh Kumar K.V 			 { P9_RATTACH,		"P9_RATTACH" },		\
57348b5901SAneesh Kumar K.V 			 { P9_TERROR,		"P9_TERROR" },		\
58348b5901SAneesh Kumar K.V 			 { P9_RERROR,		"P9_RERROR" },		\
59348b5901SAneesh Kumar K.V 			 { P9_TFLUSH,		"P9_TFLUSH" },		\
60348b5901SAneesh Kumar K.V 			 { P9_RFLUSH,		"P9_RFLUSH" },		\
61348b5901SAneesh Kumar K.V 			 { P9_TWALK,		"P9_TWALK" },		\
62348b5901SAneesh Kumar K.V 			 { P9_RWALK,		"P9_RWALK" },		\
63348b5901SAneesh Kumar K.V 			 { P9_TOPEN,		"P9_TOPEN" },		\
64348b5901SAneesh Kumar K.V 			 { P9_ROPEN,		"P9_ROPEN" },		\
65348b5901SAneesh Kumar K.V 			 { P9_TCREATE,		"P9_TCREATE" },		\
66348b5901SAneesh Kumar K.V 			 { P9_RCREATE,		"P9_RCREATE" },		\
67348b5901SAneesh Kumar K.V 			 { P9_TREAD,		"P9_TREAD" },		\
68348b5901SAneesh Kumar K.V 			 { P9_RREAD,		"P9_RREAD" },		\
69348b5901SAneesh Kumar K.V 			 { P9_TWRITE,		"P9_TWRITE" },		\
70348b5901SAneesh Kumar K.V 			 { P9_RWRITE,		"P9_RWRITE" },		\
71348b5901SAneesh Kumar K.V 			 { P9_TCLUNK,		"P9_TCLUNK" },		\
72348b5901SAneesh Kumar K.V 			 { P9_RCLUNK,		"P9_RCLUNK" },		\
73348b5901SAneesh Kumar K.V 			 { P9_TREMOVE,		"P9_TREMOVE" },		\
74348b5901SAneesh Kumar K.V 			 { P9_RREMOVE,		"P9_RREMOVE" },		\
75348b5901SAneesh Kumar K.V 			 { P9_TSTAT,		"P9_TSTAT" },		\
76348b5901SAneesh Kumar K.V 			 { P9_RSTAT,		"P9_RSTAT" },		\
77348b5901SAneesh Kumar K.V 			 { P9_TWSTAT,		"P9_TWSTAT" },		\
78348b5901SAneesh Kumar K.V 			 { P9_RWSTAT,		"P9_RWSTAT" })
79348b5901SAneesh Kumar K.V 
80348b5901SAneesh Kumar K.V TRACE_EVENT(9p_client_req,
81348b5901SAneesh Kumar K.V 	    TP_PROTO(struct p9_client *clnt, int8_t type, int tag),
82348b5901SAneesh Kumar K.V 
83348b5901SAneesh Kumar K.V 	    TP_ARGS(clnt, type, tag),
84348b5901SAneesh Kumar K.V 
85348b5901SAneesh Kumar K.V 	    TP_STRUCT__entry(
86348b5901SAneesh Kumar K.V 		    __field(    void *,		clnt			     )
87348b5901SAneesh Kumar K.V 		    __field(	__u8,		type			     )
88348b5901SAneesh Kumar K.V 		    __field(	__u32,		tag			     )
89348b5901SAneesh Kumar K.V 		    ),
90348b5901SAneesh Kumar K.V 
91348b5901SAneesh Kumar K.V 	    TP_fast_assign(
92348b5901SAneesh Kumar K.V 		    __entry->clnt    =  clnt;
93348b5901SAneesh Kumar K.V 		    __entry->type    =  type;
94348b5901SAneesh Kumar K.V 		    __entry->tag     =  tag;
95348b5901SAneesh Kumar K.V 		    ),
96348b5901SAneesh Kumar K.V 
97348b5901SAneesh Kumar K.V 	    TP_printk("client %lu request %s tag  %d",
98348b5901SAneesh Kumar K.V 		    (long)__entry->clnt, show_9p_op(__entry->type),
99348b5901SAneesh Kumar K.V 		    __entry->tag)
100348b5901SAneesh Kumar K.V  );
101348b5901SAneesh Kumar K.V 
102348b5901SAneesh Kumar K.V TRACE_EVENT(9p_client_res,
103348b5901SAneesh Kumar K.V 	    TP_PROTO(struct p9_client *clnt, int8_t type, int tag, int err),
104348b5901SAneesh Kumar K.V 
105348b5901SAneesh Kumar K.V 	    TP_ARGS(clnt, type, tag, err),
106348b5901SAneesh Kumar K.V 
107348b5901SAneesh Kumar K.V 	    TP_STRUCT__entry(
108348b5901SAneesh Kumar K.V 		    __field(    void *,		clnt			     )
109348b5901SAneesh Kumar K.V 		    __field(	__u8,		type			     )
110348b5901SAneesh Kumar K.V 		    __field(	__u32,		tag			     )
111348b5901SAneesh Kumar K.V 		    __field(	__u32,		err			     )
112348b5901SAneesh Kumar K.V 		    ),
113348b5901SAneesh Kumar K.V 
114348b5901SAneesh Kumar K.V 	    TP_fast_assign(
115348b5901SAneesh Kumar K.V 		    __entry->clnt    =  clnt;
116348b5901SAneesh Kumar K.V 		    __entry->type    =  type;
117348b5901SAneesh Kumar K.V 		    __entry->tag     =  tag;
118348b5901SAneesh Kumar K.V 		    __entry->err     =  err;
119348b5901SAneesh Kumar K.V 		    ),
120348b5901SAneesh Kumar K.V 
121348b5901SAneesh Kumar K.V 	    TP_printk("client %lu response %s tag  %d err %d",
122348b5901SAneesh Kumar K.V 		      (long)__entry->clnt, show_9p_op(__entry->type),
123348b5901SAneesh Kumar K.V 		      __entry->tag, __entry->err)
124348b5901SAneesh Kumar K.V );
125348b5901SAneesh Kumar K.V 
126348b5901SAneesh Kumar K.V /* dump 32 bytes of protocol data */
127348b5901SAneesh Kumar K.V #define P9_PROTO_DUMP_SZ 32
128348b5901SAneesh Kumar K.V TRACE_EVENT(9p_protocol_dump,
129348b5901SAneesh Kumar K.V 	    TP_PROTO(struct p9_client *clnt, struct p9_fcall *pdu),
130348b5901SAneesh Kumar K.V 
131348b5901SAneesh Kumar K.V 	    TP_ARGS(clnt, pdu),
132348b5901SAneesh Kumar K.V 
133348b5901SAneesh Kumar K.V 	    TP_STRUCT__entry(
134348b5901SAneesh Kumar K.V 		    __field(	void *,		clnt				)
135348b5901SAneesh Kumar K.V 		    __field(	__u8,		type				)
136348b5901SAneesh Kumar K.V 		    __field(	__u16,		tag				)
137348b5901SAneesh Kumar K.V 		    __array(	unsigned char,	line,	P9_PROTO_DUMP_SZ	)
138348b5901SAneesh Kumar K.V 		    ),
139348b5901SAneesh Kumar K.V 
140348b5901SAneesh Kumar K.V 	    TP_fast_assign(
141348b5901SAneesh Kumar K.V 		    __entry->clnt   =  clnt;
142348b5901SAneesh Kumar K.V 		    __entry->type   =  pdu->id;
143348b5901SAneesh Kumar K.V 		    __entry->tag    =  pdu->tag;
144348b5901SAneesh Kumar K.V 		    memcpy(__entry->line, pdu->sdata, P9_PROTO_DUMP_SZ);
145348b5901SAneesh Kumar K.V 		    ),
146cfdadef3SAndy Shevchenko 	    TP_printk("clnt %lu %s(tag = %d)\n%.3x: %16ph\n%.3x: %16ph\n",
147cfdadef3SAndy Shevchenko 		      (unsigned long)__entry->clnt, show_9p_op(__entry->type),
148cfdadef3SAndy Shevchenko 		      __entry->tag, 0, __entry->line, 16, __entry->line + 16)
149348b5901SAneesh Kumar K.V  );
150348b5901SAneesh Kumar K.V 
151348b5901SAneesh Kumar K.V #endif /* _TRACE_9P_H */
152348b5901SAneesh Kumar K.V 
153348b5901SAneesh Kumar K.V /* This part must be outside protection */
154348b5901SAneesh Kumar K.V #include <trace/define_trace.h>
155