xref: /openbmc/linux/include/trace/events/rpcgss.h (revision 53bc19f1)
10c77668dSChuck Lever /* SPDX-License-Identifier: GPL-2.0 */
20c77668dSChuck Lever /*
30c77668dSChuck Lever  * Copyright (c) 2018 Oracle.  All rights reserved.
40c77668dSChuck Lever  *
50c77668dSChuck Lever  * Trace point definitions for the "rpcgss" subsystem.
60c77668dSChuck Lever  */
70c77668dSChuck Lever 
80c77668dSChuck Lever #undef TRACE_SYSTEM
90c77668dSChuck Lever #define TRACE_SYSTEM rpcgss
100c77668dSChuck Lever 
110c77668dSChuck Lever #if !defined(_TRACE_RPCRDMA_H) || defined(TRACE_HEADER_MULTI_READ)
120c77668dSChuck Lever #define _TRACE_RPCGSS_H
130c77668dSChuck Lever 
140c77668dSChuck Lever #include <linux/tracepoint.h>
150c77668dSChuck Lever 
160c77668dSChuck Lever /**
170c77668dSChuck Lever  ** GSS-API related trace events
180c77668dSChuck Lever  **/
190c77668dSChuck Lever 
200c77668dSChuck Lever TRACE_DEFINE_ENUM(GSS_S_BAD_MECH);
210c77668dSChuck Lever TRACE_DEFINE_ENUM(GSS_S_BAD_NAME);
220c77668dSChuck Lever TRACE_DEFINE_ENUM(GSS_S_BAD_NAMETYPE);
230c77668dSChuck Lever TRACE_DEFINE_ENUM(GSS_S_BAD_BINDINGS);
240c77668dSChuck Lever TRACE_DEFINE_ENUM(GSS_S_BAD_STATUS);
250c77668dSChuck Lever TRACE_DEFINE_ENUM(GSS_S_BAD_SIG);
260c77668dSChuck Lever TRACE_DEFINE_ENUM(GSS_S_NO_CRED);
270c77668dSChuck Lever TRACE_DEFINE_ENUM(GSS_S_NO_CONTEXT);
280c77668dSChuck Lever TRACE_DEFINE_ENUM(GSS_S_DEFECTIVE_TOKEN);
290c77668dSChuck Lever TRACE_DEFINE_ENUM(GSS_S_DEFECTIVE_CREDENTIAL);
300c77668dSChuck Lever TRACE_DEFINE_ENUM(GSS_S_CREDENTIALS_EXPIRED);
310c77668dSChuck Lever TRACE_DEFINE_ENUM(GSS_S_CONTEXT_EXPIRED);
320c77668dSChuck Lever TRACE_DEFINE_ENUM(GSS_S_FAILURE);
330c77668dSChuck Lever TRACE_DEFINE_ENUM(GSS_S_BAD_QOP);
340c77668dSChuck Lever TRACE_DEFINE_ENUM(GSS_S_UNAUTHORIZED);
350c77668dSChuck Lever TRACE_DEFINE_ENUM(GSS_S_UNAVAILABLE);
360c77668dSChuck Lever TRACE_DEFINE_ENUM(GSS_S_DUPLICATE_ELEMENT);
370c77668dSChuck Lever TRACE_DEFINE_ENUM(GSS_S_NAME_NOT_MN);
380c77668dSChuck Lever TRACE_DEFINE_ENUM(GSS_S_CONTINUE_NEEDED);
390c77668dSChuck Lever TRACE_DEFINE_ENUM(GSS_S_DUPLICATE_TOKEN);
400c77668dSChuck Lever TRACE_DEFINE_ENUM(GSS_S_OLD_TOKEN);
410c77668dSChuck Lever TRACE_DEFINE_ENUM(GSS_S_UNSEQ_TOKEN);
420c77668dSChuck Lever TRACE_DEFINE_ENUM(GSS_S_GAP_TOKEN);
430c77668dSChuck Lever 
440c77668dSChuck Lever #define show_gss_status(x)						\
450c77668dSChuck Lever 	__print_flags(x, "|",						\
460c77668dSChuck Lever 		{ GSS_S_BAD_MECH, "GSS_S_BAD_MECH" },			\
470c77668dSChuck Lever 		{ GSS_S_BAD_NAME, "GSS_S_BAD_NAME" },			\
480c77668dSChuck Lever 		{ GSS_S_BAD_NAMETYPE, "GSS_S_BAD_NAMETYPE" },		\
490c77668dSChuck Lever 		{ GSS_S_BAD_BINDINGS, "GSS_S_BAD_BINDINGS" },		\
500c77668dSChuck Lever 		{ GSS_S_BAD_STATUS, "GSS_S_BAD_STATUS" },		\
510c77668dSChuck Lever 		{ GSS_S_BAD_SIG, "GSS_S_BAD_SIG" },			\
520c77668dSChuck Lever 		{ GSS_S_NO_CRED, "GSS_S_NO_CRED" },			\
530c77668dSChuck Lever 		{ GSS_S_NO_CONTEXT, "GSS_S_NO_CONTEXT" },		\
540c77668dSChuck Lever 		{ GSS_S_DEFECTIVE_TOKEN, "GSS_S_DEFECTIVE_TOKEN" },	\
550c77668dSChuck Lever 		{ GSS_S_DEFECTIVE_CREDENTIAL, "GSS_S_DEFECTIVE_CREDENTIAL" }, \
560c77668dSChuck Lever 		{ GSS_S_CREDENTIALS_EXPIRED, "GSS_S_CREDENTIALS_EXPIRED" }, \
570c77668dSChuck Lever 		{ GSS_S_CONTEXT_EXPIRED, "GSS_S_CONTEXT_EXPIRED" },	\
580c77668dSChuck Lever 		{ GSS_S_FAILURE, "GSS_S_FAILURE" },			\
590c77668dSChuck Lever 		{ GSS_S_BAD_QOP, "GSS_S_BAD_QOP" },			\
600c77668dSChuck Lever 		{ GSS_S_UNAUTHORIZED, "GSS_S_UNAUTHORIZED" },		\
610c77668dSChuck Lever 		{ GSS_S_UNAVAILABLE, "GSS_S_UNAVAILABLE" },		\
620c77668dSChuck Lever 		{ GSS_S_DUPLICATE_ELEMENT, "GSS_S_DUPLICATE_ELEMENT" },	\
630c77668dSChuck Lever 		{ GSS_S_NAME_NOT_MN, "GSS_S_NAME_NOT_MN" },		\
640c77668dSChuck Lever 		{ GSS_S_CONTINUE_NEEDED, "GSS_S_CONTINUE_NEEDED" },	\
650c77668dSChuck Lever 		{ GSS_S_DUPLICATE_TOKEN, "GSS_S_DUPLICATE_TOKEN" },	\
660c77668dSChuck Lever 		{ GSS_S_OLD_TOKEN, "GSS_S_OLD_TOKEN" },			\
670c77668dSChuck Lever 		{ GSS_S_UNSEQ_TOKEN, "GSS_S_UNSEQ_TOKEN" },		\
680c77668dSChuck Lever 		{ GSS_S_GAP_TOKEN, "GSS_S_GAP_TOKEN" })
690c77668dSChuck Lever 
700c77668dSChuck Lever 
710c77668dSChuck Lever DECLARE_EVENT_CLASS(rpcgss_gssapi_event,
720c77668dSChuck Lever 	TP_PROTO(
730c77668dSChuck Lever 		const struct rpc_task *task,
740c77668dSChuck Lever 		u32 maj_stat
750c77668dSChuck Lever 	),
760c77668dSChuck Lever 
770c77668dSChuck Lever 	TP_ARGS(task, maj_stat),
780c77668dSChuck Lever 
790c77668dSChuck Lever 	TP_STRUCT__entry(
800c77668dSChuck Lever 		__field(unsigned int, task_id)
810c77668dSChuck Lever 		__field(unsigned int, client_id)
820c77668dSChuck Lever 		__field(u32, maj_stat)
830c77668dSChuck Lever 
840c77668dSChuck Lever 	),
850c77668dSChuck Lever 
860c77668dSChuck Lever 	TP_fast_assign(
870c77668dSChuck Lever 		__entry->task_id = task->tk_pid;
880c77668dSChuck Lever 		__entry->client_id = task->tk_client->cl_clid;
890c77668dSChuck Lever 		__entry->maj_stat = maj_stat;
900c77668dSChuck Lever 	),
910c77668dSChuck Lever 
920c77668dSChuck Lever 	TP_printk("task:%u@%u maj_stat=%s",
930c77668dSChuck Lever 		__entry->task_id, __entry->client_id,
940c77668dSChuck Lever 		__entry->maj_stat == 0 ?
950c77668dSChuck Lever 		"GSS_S_COMPLETE" : show_gss_status(__entry->maj_stat))
960c77668dSChuck Lever );
970c77668dSChuck Lever 
980c77668dSChuck Lever #define DEFINE_GSSAPI_EVENT(name)					\
990c77668dSChuck Lever 	DEFINE_EVENT(rpcgss_gssapi_event, rpcgss_##name,		\
1000c77668dSChuck Lever 			TP_PROTO(					\
1010c77668dSChuck Lever 				const struct rpc_task *task,		\
1020c77668dSChuck Lever 				u32 maj_stat				\
1030c77668dSChuck Lever 			),						\
1040c77668dSChuck Lever 			TP_ARGS(task, maj_stat))
1050c77668dSChuck Lever 
1060c77668dSChuck Lever TRACE_EVENT(rpcgss_import_ctx,
1070c77668dSChuck Lever 	TP_PROTO(
1080c77668dSChuck Lever 		int status
1090c77668dSChuck Lever 	),
1100c77668dSChuck Lever 
1110c77668dSChuck Lever 	TP_ARGS(status),
1120c77668dSChuck Lever 
1130c77668dSChuck Lever 	TP_STRUCT__entry(
1140c77668dSChuck Lever 		__field(int, status)
1150c77668dSChuck Lever 	),
1160c77668dSChuck Lever 
1170c77668dSChuck Lever 	TP_fast_assign(
1180c77668dSChuck Lever 		__entry->status = status;
1190c77668dSChuck Lever 	),
1200c77668dSChuck Lever 
1210c77668dSChuck Lever 	TP_printk("status=%d", __entry->status)
1220c77668dSChuck Lever );
1230c77668dSChuck Lever 
1240c77668dSChuck Lever DEFINE_GSSAPI_EVENT(get_mic);
1250c77668dSChuck Lever DEFINE_GSSAPI_EVENT(verify_mic);
1260c77668dSChuck Lever DEFINE_GSSAPI_EVENT(wrap);
1270c77668dSChuck Lever DEFINE_GSSAPI_EVENT(unwrap);
1280c77668dSChuck Lever 
12928155524SChuck Lever TRACE_EVENT(rpcgss_svc_accept_upcall,
130ff27e9f7SChuck Lever 	TP_PROTO(
131ff27e9f7SChuck Lever 		__be32 xid,
132ff27e9f7SChuck Lever 		u32 major_status,
133ff27e9f7SChuck Lever 		u32 minor_status
134ff27e9f7SChuck Lever 	),
135ff27e9f7SChuck Lever 
136ff27e9f7SChuck Lever 	TP_ARGS(xid, major_status, minor_status),
137ff27e9f7SChuck Lever 
138ff27e9f7SChuck Lever 	TP_STRUCT__entry(
139ff27e9f7SChuck Lever 		__field(u32, xid)
140ff27e9f7SChuck Lever 		__field(u32, minor_status)
141ff27e9f7SChuck Lever 		__field(unsigned long, major_status)
142ff27e9f7SChuck Lever 	),
143ff27e9f7SChuck Lever 
144ff27e9f7SChuck Lever 	TP_fast_assign(
145ff27e9f7SChuck Lever 		__entry->xid = be32_to_cpu(xid);
146ff27e9f7SChuck Lever 		__entry->minor_status = minor_status;
147ff27e9f7SChuck Lever 		__entry->major_status = major_status;
148ff27e9f7SChuck Lever 	),
149ff27e9f7SChuck Lever 
150ff27e9f7SChuck Lever 	TP_printk("xid=0x%08x major_status=%s (0x%08lx) minor_status=%u",
151ff27e9f7SChuck Lever 		__entry->xid, __entry->major_status == 0 ? "GSS_S_COMPLETE" :
152ff27e9f7SChuck Lever 				show_gss_status(__entry->major_status),
153ff27e9f7SChuck Lever 		__entry->major_status, __entry->minor_status
154ff27e9f7SChuck Lever 	)
155ff27e9f7SChuck Lever );
156ff27e9f7SChuck Lever 
15728155524SChuck Lever TRACE_EVENT(rpcgss_svc_accept,
15828155524SChuck Lever 	TP_PROTO(
15928155524SChuck Lever 		__be32 xid,
16028155524SChuck Lever 		size_t len
16128155524SChuck Lever 	),
16228155524SChuck Lever 
16328155524SChuck Lever 	TP_ARGS(xid, len),
16428155524SChuck Lever 
16528155524SChuck Lever 	TP_STRUCT__entry(
16628155524SChuck Lever 		__field(u32, xid)
16728155524SChuck Lever 		__field(size_t, len)
16828155524SChuck Lever 	),
16928155524SChuck Lever 
17028155524SChuck Lever 	TP_fast_assign(
17128155524SChuck Lever 		__entry->xid = be32_to_cpu(xid);
17228155524SChuck Lever 		__entry->len = len;
17328155524SChuck Lever 	),
17428155524SChuck Lever 
17528155524SChuck Lever 	TP_printk("xid=0x%08x len=%zu",
17628155524SChuck Lever 		__entry->xid, __entry->len
17728155524SChuck Lever 	)
17828155524SChuck Lever );
17928155524SChuck Lever 
1800c77668dSChuck Lever 
1810c77668dSChuck Lever /**
1820c77668dSChuck Lever  ** GSS auth unwrap failures
1830c77668dSChuck Lever  **/
1840c77668dSChuck Lever 
1850c77668dSChuck Lever TRACE_EVENT(rpcgss_unwrap_failed,
1860c77668dSChuck Lever 	TP_PROTO(
1870c77668dSChuck Lever 		const struct rpc_task *task
1880c77668dSChuck Lever 	),
1890c77668dSChuck Lever 
1900c77668dSChuck Lever 	TP_ARGS(task),
1910c77668dSChuck Lever 
1920c77668dSChuck Lever 	TP_STRUCT__entry(
1930c77668dSChuck Lever 		__field(unsigned int, task_id)
1940c77668dSChuck Lever 		__field(unsigned int, client_id)
1950c77668dSChuck Lever 	),
1960c77668dSChuck Lever 
1970c77668dSChuck Lever 	TP_fast_assign(
1980c77668dSChuck Lever 		__entry->task_id = task->tk_pid;
1990c77668dSChuck Lever 		__entry->client_id = task->tk_client->cl_clid;
2000c77668dSChuck Lever 	),
2010c77668dSChuck Lever 
2020c77668dSChuck Lever 	TP_printk("task:%u@%u", __entry->task_id, __entry->client_id)
2030c77668dSChuck Lever );
2040c77668dSChuck Lever 
2050c77668dSChuck Lever TRACE_EVENT(rpcgss_bad_seqno,
2060c77668dSChuck Lever 	TP_PROTO(
2070c77668dSChuck Lever 		const struct rpc_task *task,
2080c77668dSChuck Lever 		u32 expected,
2090c77668dSChuck Lever 		u32 received
2100c77668dSChuck Lever 	),
2110c77668dSChuck Lever 
2120c77668dSChuck Lever 	TP_ARGS(task, expected, received),
2130c77668dSChuck Lever 
2140c77668dSChuck Lever 	TP_STRUCT__entry(
2150c77668dSChuck Lever 		__field(unsigned int, task_id)
2160c77668dSChuck Lever 		__field(unsigned int, client_id)
2170c77668dSChuck Lever 		__field(u32, expected)
2180c77668dSChuck Lever 		__field(u32, received)
2190c77668dSChuck Lever 	),
2200c77668dSChuck Lever 
2210c77668dSChuck Lever 	TP_fast_assign(
2220c77668dSChuck Lever 		__entry->task_id = task->tk_pid;
2230c77668dSChuck Lever 		__entry->client_id = task->tk_client->cl_clid;
2240c77668dSChuck Lever 		__entry->expected = expected;
2250c77668dSChuck Lever 		__entry->received = received;
2260c77668dSChuck Lever 	),
2270c77668dSChuck Lever 
2280c77668dSChuck Lever 	TP_printk("task:%u@%u expected seqno %u, received seqno %u",
2290c77668dSChuck Lever 		__entry->task_id, __entry->client_id,
2300c77668dSChuck Lever 		__entry->expected, __entry->received)
2310c77668dSChuck Lever );
2320c77668dSChuck Lever 
2330c77668dSChuck Lever TRACE_EVENT(rpcgss_seqno,
2340c77668dSChuck Lever 	TP_PROTO(
2350c77668dSChuck Lever 		const struct rpc_task *task
2360c77668dSChuck Lever 	),
2370c77668dSChuck Lever 
2380c77668dSChuck Lever 	TP_ARGS(task),
2390c77668dSChuck Lever 
2400c77668dSChuck Lever 	TP_STRUCT__entry(
2410c77668dSChuck Lever 		__field(unsigned int, task_id)
2420c77668dSChuck Lever 		__field(unsigned int, client_id)
2430c77668dSChuck Lever 		__field(u32, xid)
2440c77668dSChuck Lever 		__field(u32, seqno)
2450c77668dSChuck Lever 	),
2460c77668dSChuck Lever 
2470c77668dSChuck Lever 	TP_fast_assign(
2480c77668dSChuck Lever 		const struct rpc_rqst *rqst = task->tk_rqstp;
2490c77668dSChuck Lever 
2500c77668dSChuck Lever 		__entry->task_id = task->tk_pid;
2510c77668dSChuck Lever 		__entry->client_id = task->tk_client->cl_clid;
2520c77668dSChuck Lever 		__entry->xid = be32_to_cpu(rqst->rq_xid);
2530c77668dSChuck Lever 		__entry->seqno = rqst->rq_seqno;
2540c77668dSChuck Lever 	),
2550c77668dSChuck Lever 
2560c77668dSChuck Lever 	TP_printk("task:%u@%u xid=0x%08x seqno=%u",
2570c77668dSChuck Lever 		__entry->task_id, __entry->client_id,
2580c77668dSChuck Lever 		__entry->xid, __entry->seqno)
2590c77668dSChuck Lever );
2600c77668dSChuck Lever 
2610c77668dSChuck Lever TRACE_EVENT(rpcgss_need_reencode,
2620c77668dSChuck Lever 	TP_PROTO(
2630c77668dSChuck Lever 		const struct rpc_task *task,
2640c77668dSChuck Lever 		u32 seq_xmit,
2650c77668dSChuck Lever 		bool ret
2660c77668dSChuck Lever 	),
2670c77668dSChuck Lever 
2680c77668dSChuck Lever 	TP_ARGS(task, seq_xmit, ret),
2690c77668dSChuck Lever 
2700c77668dSChuck Lever 	TP_STRUCT__entry(
2710c77668dSChuck Lever 		__field(unsigned int, task_id)
2720c77668dSChuck Lever 		__field(unsigned int, client_id)
2730c77668dSChuck Lever 		__field(u32, xid)
2740c77668dSChuck Lever 		__field(u32, seq_xmit)
2750c77668dSChuck Lever 		__field(u32, seqno)
2760c77668dSChuck Lever 		__field(bool, ret)
2770c77668dSChuck Lever 	),
2780c77668dSChuck Lever 
2790c77668dSChuck Lever 	TP_fast_assign(
2800c77668dSChuck Lever 		__entry->task_id = task->tk_pid;
2810c77668dSChuck Lever 		__entry->client_id = task->tk_client->cl_clid;
2820c77668dSChuck Lever 		__entry->xid = be32_to_cpu(task->tk_rqstp->rq_xid);
2830c77668dSChuck Lever 		__entry->seq_xmit = seq_xmit;
2840c77668dSChuck Lever 		__entry->seqno = task->tk_rqstp->rq_seqno;
2850c77668dSChuck Lever 		__entry->ret = ret;
2860c77668dSChuck Lever 	),
2870c77668dSChuck Lever 
2880c77668dSChuck Lever 	TP_printk("task:%u@%u xid=0x%08x rq_seqno=%u seq_xmit=%u reencode %sneeded",
2890c77668dSChuck Lever 		__entry->task_id, __entry->client_id,
2900c77668dSChuck Lever 		__entry->xid, __entry->seqno, __entry->seq_xmit,
2910c77668dSChuck Lever 		__entry->ret ? "" : "un")
2920c77668dSChuck Lever );
2930c77668dSChuck Lever 
294*53bc19f1SChuck Lever TRACE_EVENT(rpcgss_update_slack,
295*53bc19f1SChuck Lever 	TP_PROTO(
296*53bc19f1SChuck Lever 		const struct rpc_task *task,
297*53bc19f1SChuck Lever 		const struct rpc_auth *auth
298*53bc19f1SChuck Lever 	),
299*53bc19f1SChuck Lever 
300*53bc19f1SChuck Lever 	TP_ARGS(task, auth),
301*53bc19f1SChuck Lever 
302*53bc19f1SChuck Lever 	TP_STRUCT__entry(
303*53bc19f1SChuck Lever 		__field(unsigned int, task_id)
304*53bc19f1SChuck Lever 		__field(unsigned int, client_id)
305*53bc19f1SChuck Lever 		__field(u32, xid)
306*53bc19f1SChuck Lever 		__field(const void *, auth)
307*53bc19f1SChuck Lever 		__field(unsigned int, rslack)
308*53bc19f1SChuck Lever 		__field(unsigned int, ralign)
309*53bc19f1SChuck Lever 		__field(unsigned int, verfsize)
310*53bc19f1SChuck Lever 	),
311*53bc19f1SChuck Lever 
312*53bc19f1SChuck Lever 	TP_fast_assign(
313*53bc19f1SChuck Lever 		__entry->task_id = task->tk_pid;
314*53bc19f1SChuck Lever 		__entry->client_id = task->tk_client->cl_clid;
315*53bc19f1SChuck Lever 		__entry->xid = be32_to_cpu(task->tk_rqstp->rq_xid);
316*53bc19f1SChuck Lever 		__entry->auth = auth;
317*53bc19f1SChuck Lever 		__entry->rslack = auth->au_rslack;
318*53bc19f1SChuck Lever 		__entry->ralign = auth->au_ralign;
319*53bc19f1SChuck Lever 		__entry->verfsize = auth->au_verfsize;
320*53bc19f1SChuck Lever 	),
321*53bc19f1SChuck Lever 
322*53bc19f1SChuck Lever 	TP_printk("task:%u@%u xid=0x%08x auth=%p rslack=%u ralign=%u verfsize=%u\n",
323*53bc19f1SChuck Lever 		__entry->task_id, __entry->client_id, __entry->xid,
324*53bc19f1SChuck Lever 		__entry->auth, __entry->rslack, __entry->ralign,
325*53bc19f1SChuck Lever 		__entry->verfsize)
326*53bc19f1SChuck Lever );
327*53bc19f1SChuck Lever 
32828155524SChuck Lever DECLARE_EVENT_CLASS(rpcgss_svc_seqno_class,
32928155524SChuck Lever 	TP_PROTO(
33028155524SChuck Lever 		__be32 xid,
33128155524SChuck Lever 		u32 seqno
33228155524SChuck Lever 	),
33328155524SChuck Lever 
33428155524SChuck Lever 	TP_ARGS(xid, seqno),
33528155524SChuck Lever 
33628155524SChuck Lever 	TP_STRUCT__entry(
33728155524SChuck Lever 		__field(u32, xid)
33828155524SChuck Lever 		__field(u32, seqno)
33928155524SChuck Lever 	),
34028155524SChuck Lever 
34128155524SChuck Lever 	TP_fast_assign(
34228155524SChuck Lever 		__entry->xid = be32_to_cpu(xid);
34328155524SChuck Lever 		__entry->seqno = seqno;
34428155524SChuck Lever 	),
34528155524SChuck Lever 
34628155524SChuck Lever 	TP_printk("xid=0x%08x seqno=%u, request discarded",
34728155524SChuck Lever 		__entry->xid, __entry->seqno)
34828155524SChuck Lever );
34928155524SChuck Lever 
35028155524SChuck Lever #define DEFINE_SVC_SEQNO_EVENT(name)					\
35128155524SChuck Lever 	DEFINE_EVENT(rpcgss_svc_seqno_class, rpcgss_svc_##name,		\
35228155524SChuck Lever 			TP_PROTO(					\
35328155524SChuck Lever 				__be32 xid,				\
35428155524SChuck Lever 				u32 seqno				\
35528155524SChuck Lever 			),						\
35628155524SChuck Lever 			TP_ARGS(xid, seqno))
35728155524SChuck Lever 
35828155524SChuck Lever DEFINE_SVC_SEQNO_EVENT(large_seqno);
35928155524SChuck Lever DEFINE_SVC_SEQNO_EVENT(old_seqno);
36028155524SChuck Lever 
36128155524SChuck Lever 
3620c77668dSChuck Lever /**
3630c77668dSChuck Lever  ** gssd upcall related trace events
3640c77668dSChuck Lever  **/
3650c77668dSChuck Lever 
3660c77668dSChuck Lever TRACE_EVENT(rpcgss_upcall_msg,
3670c77668dSChuck Lever 	TP_PROTO(
3680c77668dSChuck Lever 		const char *buf
3690c77668dSChuck Lever 	),
3700c77668dSChuck Lever 
3710c77668dSChuck Lever 	TP_ARGS(buf),
3720c77668dSChuck Lever 
3730c77668dSChuck Lever 	TP_STRUCT__entry(
3740c77668dSChuck Lever 		__string(msg, buf)
3750c77668dSChuck Lever 	),
3760c77668dSChuck Lever 
3770c77668dSChuck Lever 	TP_fast_assign(
3780c77668dSChuck Lever 		__assign_str(msg, buf)
3790c77668dSChuck Lever 	),
3800c77668dSChuck Lever 
3810c77668dSChuck Lever 	TP_printk("msg='%s'", __get_str(msg))
3820c77668dSChuck Lever );
3830c77668dSChuck Lever 
3840c77668dSChuck Lever TRACE_EVENT(rpcgss_upcall_result,
3850c77668dSChuck Lever 	TP_PROTO(
3860c77668dSChuck Lever 		u32 uid,
3870c77668dSChuck Lever 		int result
3880c77668dSChuck Lever 	),
3890c77668dSChuck Lever 
3900c77668dSChuck Lever 	TP_ARGS(uid, result),
3910c77668dSChuck Lever 
3920c77668dSChuck Lever 	TP_STRUCT__entry(
3930c77668dSChuck Lever 		__field(u32, uid)
3940c77668dSChuck Lever 		__field(int, result)
3950c77668dSChuck Lever 
3960c77668dSChuck Lever 	),
3970c77668dSChuck Lever 
3980c77668dSChuck Lever 	TP_fast_assign(
3990c77668dSChuck Lever 		__entry->uid = uid;
4000c77668dSChuck Lever 		__entry->result = result;
4010c77668dSChuck Lever 	),
4020c77668dSChuck Lever 
4030c77668dSChuck Lever 	TP_printk("for uid %u, result=%d", __entry->uid, __entry->result)
4040c77668dSChuck Lever );
4050c77668dSChuck Lever 
4060c77668dSChuck Lever TRACE_EVENT(rpcgss_context,
4070c77668dSChuck Lever 	TP_PROTO(
4080c77668dSChuck Lever 		unsigned long expiry,
4090c77668dSChuck Lever 		unsigned long now,
4100c77668dSChuck Lever 		unsigned int timeout,
4110c77668dSChuck Lever 		unsigned int len,
4120c77668dSChuck Lever 		const u8 *data
4130c77668dSChuck Lever 	),
4140c77668dSChuck Lever 
4150c77668dSChuck Lever 	TP_ARGS(expiry, now, timeout, len, data),
4160c77668dSChuck Lever 
4170c77668dSChuck Lever 	TP_STRUCT__entry(
4180c77668dSChuck Lever 		__field(unsigned long, expiry)
4190c77668dSChuck Lever 		__field(unsigned long, now)
4200c77668dSChuck Lever 		__field(unsigned int, timeout)
4210c77668dSChuck Lever 		__field(int, len)
4220c77668dSChuck Lever 		__string(acceptor, data)
4230c77668dSChuck Lever 	),
4240c77668dSChuck Lever 
4250c77668dSChuck Lever 	TP_fast_assign(
4260c77668dSChuck Lever 		__entry->expiry = expiry;
4270c77668dSChuck Lever 		__entry->now = now;
4280c77668dSChuck Lever 		__entry->timeout = timeout;
4290c77668dSChuck Lever 		__entry->len = len;
4300c77668dSChuck Lever 		strncpy(__get_str(acceptor), data, len);
4310c77668dSChuck Lever 	),
4320c77668dSChuck Lever 
4330c77668dSChuck Lever 	TP_printk("gc_expiry=%lu now=%lu timeout=%u acceptor=%.*s",
4340c77668dSChuck Lever 		__entry->expiry, __entry->now, __entry->timeout,
4350c77668dSChuck Lever 		__entry->len, __get_str(acceptor))
4360c77668dSChuck Lever );
4370c77668dSChuck Lever 
4380c77668dSChuck Lever 
4390c77668dSChuck Lever /**
4400c77668dSChuck Lever  ** Miscellaneous events
4410c77668dSChuck Lever  */
4420c77668dSChuck Lever 
4430c77668dSChuck Lever TRACE_DEFINE_ENUM(RPC_AUTH_GSS_KRB5);
4440c77668dSChuck Lever TRACE_DEFINE_ENUM(RPC_AUTH_GSS_KRB5I);
4450c77668dSChuck Lever TRACE_DEFINE_ENUM(RPC_AUTH_GSS_KRB5P);
4460c77668dSChuck Lever 
4470c77668dSChuck Lever #define show_pseudoflavor(x)						\
4480c77668dSChuck Lever 	__print_symbolic(x,						\
4490c77668dSChuck Lever 		{ RPC_AUTH_GSS_KRB5, "RPC_AUTH_GSS_KRB5" },		\
4500c77668dSChuck Lever 		{ RPC_AUTH_GSS_KRB5I, "RPC_AUTH_GSS_KRB5I" },		\
4510c77668dSChuck Lever 		{ RPC_AUTH_GSS_KRB5P, "RPC_AUTH_GSS_KRB5P" })
4520c77668dSChuck Lever 
4530c77668dSChuck Lever 
4540c77668dSChuck Lever TRACE_EVENT(rpcgss_createauth,
4550c77668dSChuck Lever 	TP_PROTO(
4560c77668dSChuck Lever 		unsigned int flavor,
4570c77668dSChuck Lever 		int error
4580c77668dSChuck Lever 	),
4590c77668dSChuck Lever 
4600c77668dSChuck Lever 	TP_ARGS(flavor, error),
4610c77668dSChuck Lever 
4620c77668dSChuck Lever 	TP_STRUCT__entry(
4630c77668dSChuck Lever 		__field(unsigned int, flavor)
4640c77668dSChuck Lever 		__field(int, error)
4650c77668dSChuck Lever 
4660c77668dSChuck Lever 	),
4670c77668dSChuck Lever 
4680c77668dSChuck Lever 	TP_fast_assign(
4690c77668dSChuck Lever 		__entry->flavor = flavor;
4700c77668dSChuck Lever 		__entry->error = error;
4710c77668dSChuck Lever 	),
4720c77668dSChuck Lever 
4730c77668dSChuck Lever 	TP_printk("flavor=%s error=%d",
4740c77668dSChuck Lever 		show_pseudoflavor(__entry->flavor), __entry->error)
4750c77668dSChuck Lever );
4760c77668dSChuck Lever 
477ff27e9f7SChuck Lever TRACE_EVENT(rpcgss_oid_to_mech,
478ff27e9f7SChuck Lever 	TP_PROTO(
479ff27e9f7SChuck Lever 		const char *oid
480ff27e9f7SChuck Lever 	),
481ff27e9f7SChuck Lever 
482ff27e9f7SChuck Lever 	TP_ARGS(oid),
483ff27e9f7SChuck Lever 
484ff27e9f7SChuck Lever 	TP_STRUCT__entry(
485ff27e9f7SChuck Lever 		__string(oid, oid)
486ff27e9f7SChuck Lever 	),
487ff27e9f7SChuck Lever 
488ff27e9f7SChuck Lever 	TP_fast_assign(
489ff27e9f7SChuck Lever 		__assign_str(oid, oid);
490ff27e9f7SChuck Lever 	),
491ff27e9f7SChuck Lever 
492ff27e9f7SChuck Lever 	TP_printk("mech for oid %s was not found", __get_str(oid))
493ff27e9f7SChuck Lever );
4940c77668dSChuck Lever 
4950c77668dSChuck Lever #endif	/* _TRACE_RPCGSS_H */
4960c77668dSChuck Lever 
4970c77668dSChuck Lever #include <trace/define_trace.h>
498