xref: /openbmc/linux/include/trace/events/rpcgss.h (revision 28155524)
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 
129*28155524SChuck 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 
157*28155524SChuck Lever TRACE_EVENT(rpcgss_svc_accept,
158*28155524SChuck Lever 	TP_PROTO(
159*28155524SChuck Lever 		__be32 xid,
160*28155524SChuck Lever 		size_t len
161*28155524SChuck Lever 	),
162*28155524SChuck Lever 
163*28155524SChuck Lever 	TP_ARGS(xid, len),
164*28155524SChuck Lever 
165*28155524SChuck Lever 	TP_STRUCT__entry(
166*28155524SChuck Lever 		__field(u32, xid)
167*28155524SChuck Lever 		__field(size_t, len)
168*28155524SChuck Lever 	),
169*28155524SChuck Lever 
170*28155524SChuck Lever 	TP_fast_assign(
171*28155524SChuck Lever 		__entry->xid = be32_to_cpu(xid);
172*28155524SChuck Lever 		__entry->len = len;
173*28155524SChuck Lever 	),
174*28155524SChuck Lever 
175*28155524SChuck Lever 	TP_printk("xid=0x%08x len=%zu",
176*28155524SChuck Lever 		__entry->xid, __entry->len
177*28155524SChuck Lever 	)
178*28155524SChuck Lever );
179*28155524SChuck 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*28155524SChuck Lever DECLARE_EVENT_CLASS(rpcgss_svc_seqno_class,
295*28155524SChuck Lever 	TP_PROTO(
296*28155524SChuck Lever 		__be32 xid,
297*28155524SChuck Lever 		u32 seqno
298*28155524SChuck Lever 	),
299*28155524SChuck Lever 
300*28155524SChuck Lever 	TP_ARGS(xid, seqno),
301*28155524SChuck Lever 
302*28155524SChuck Lever 	TP_STRUCT__entry(
303*28155524SChuck Lever 		__field(u32, xid)
304*28155524SChuck Lever 		__field(u32, seqno)
305*28155524SChuck Lever 	),
306*28155524SChuck Lever 
307*28155524SChuck Lever 	TP_fast_assign(
308*28155524SChuck Lever 		__entry->xid = be32_to_cpu(xid);
309*28155524SChuck Lever 		__entry->seqno = seqno;
310*28155524SChuck Lever 	),
311*28155524SChuck Lever 
312*28155524SChuck Lever 	TP_printk("xid=0x%08x seqno=%u, request discarded",
313*28155524SChuck Lever 		__entry->xid, __entry->seqno)
314*28155524SChuck Lever );
315*28155524SChuck Lever 
316*28155524SChuck Lever #define DEFINE_SVC_SEQNO_EVENT(name)					\
317*28155524SChuck Lever 	DEFINE_EVENT(rpcgss_svc_seqno_class, rpcgss_svc_##name,		\
318*28155524SChuck Lever 			TP_PROTO(					\
319*28155524SChuck Lever 				__be32 xid,				\
320*28155524SChuck Lever 				u32 seqno				\
321*28155524SChuck Lever 			),						\
322*28155524SChuck Lever 			TP_ARGS(xid, seqno))
323*28155524SChuck Lever 
324*28155524SChuck Lever DEFINE_SVC_SEQNO_EVENT(large_seqno);
325*28155524SChuck Lever DEFINE_SVC_SEQNO_EVENT(old_seqno);
326*28155524SChuck Lever 
327*28155524SChuck Lever 
3280c77668dSChuck Lever /**
3290c77668dSChuck Lever  ** gssd upcall related trace events
3300c77668dSChuck Lever  **/
3310c77668dSChuck Lever 
3320c77668dSChuck Lever TRACE_EVENT(rpcgss_upcall_msg,
3330c77668dSChuck Lever 	TP_PROTO(
3340c77668dSChuck Lever 		const char *buf
3350c77668dSChuck Lever 	),
3360c77668dSChuck Lever 
3370c77668dSChuck Lever 	TP_ARGS(buf),
3380c77668dSChuck Lever 
3390c77668dSChuck Lever 	TP_STRUCT__entry(
3400c77668dSChuck Lever 		__string(msg, buf)
3410c77668dSChuck Lever 	),
3420c77668dSChuck Lever 
3430c77668dSChuck Lever 	TP_fast_assign(
3440c77668dSChuck Lever 		__assign_str(msg, buf)
3450c77668dSChuck Lever 	),
3460c77668dSChuck Lever 
3470c77668dSChuck Lever 	TP_printk("msg='%s'", __get_str(msg))
3480c77668dSChuck Lever );
3490c77668dSChuck Lever 
3500c77668dSChuck Lever TRACE_EVENT(rpcgss_upcall_result,
3510c77668dSChuck Lever 	TP_PROTO(
3520c77668dSChuck Lever 		u32 uid,
3530c77668dSChuck Lever 		int result
3540c77668dSChuck Lever 	),
3550c77668dSChuck Lever 
3560c77668dSChuck Lever 	TP_ARGS(uid, result),
3570c77668dSChuck Lever 
3580c77668dSChuck Lever 	TP_STRUCT__entry(
3590c77668dSChuck Lever 		__field(u32, uid)
3600c77668dSChuck Lever 		__field(int, result)
3610c77668dSChuck Lever 
3620c77668dSChuck Lever 	),
3630c77668dSChuck Lever 
3640c77668dSChuck Lever 	TP_fast_assign(
3650c77668dSChuck Lever 		__entry->uid = uid;
3660c77668dSChuck Lever 		__entry->result = result;
3670c77668dSChuck Lever 	),
3680c77668dSChuck Lever 
3690c77668dSChuck Lever 	TP_printk("for uid %u, result=%d", __entry->uid, __entry->result)
3700c77668dSChuck Lever );
3710c77668dSChuck Lever 
3720c77668dSChuck Lever TRACE_EVENT(rpcgss_context,
3730c77668dSChuck Lever 	TP_PROTO(
3740c77668dSChuck Lever 		unsigned long expiry,
3750c77668dSChuck Lever 		unsigned long now,
3760c77668dSChuck Lever 		unsigned int timeout,
3770c77668dSChuck Lever 		unsigned int len,
3780c77668dSChuck Lever 		const u8 *data
3790c77668dSChuck Lever 	),
3800c77668dSChuck Lever 
3810c77668dSChuck Lever 	TP_ARGS(expiry, now, timeout, len, data),
3820c77668dSChuck Lever 
3830c77668dSChuck Lever 	TP_STRUCT__entry(
3840c77668dSChuck Lever 		__field(unsigned long, expiry)
3850c77668dSChuck Lever 		__field(unsigned long, now)
3860c77668dSChuck Lever 		__field(unsigned int, timeout)
3870c77668dSChuck Lever 		__field(int, len)
3880c77668dSChuck Lever 		__string(acceptor, data)
3890c77668dSChuck Lever 	),
3900c77668dSChuck Lever 
3910c77668dSChuck Lever 	TP_fast_assign(
3920c77668dSChuck Lever 		__entry->expiry = expiry;
3930c77668dSChuck Lever 		__entry->now = now;
3940c77668dSChuck Lever 		__entry->timeout = timeout;
3950c77668dSChuck Lever 		__entry->len = len;
3960c77668dSChuck Lever 		strncpy(__get_str(acceptor), data, len);
3970c77668dSChuck Lever 	),
3980c77668dSChuck Lever 
3990c77668dSChuck Lever 	TP_printk("gc_expiry=%lu now=%lu timeout=%u acceptor=%.*s",
4000c77668dSChuck Lever 		__entry->expiry, __entry->now, __entry->timeout,
4010c77668dSChuck Lever 		__entry->len, __get_str(acceptor))
4020c77668dSChuck Lever );
4030c77668dSChuck Lever 
4040c77668dSChuck Lever 
4050c77668dSChuck Lever /**
4060c77668dSChuck Lever  ** Miscellaneous events
4070c77668dSChuck Lever  */
4080c77668dSChuck Lever 
4090c77668dSChuck Lever TRACE_DEFINE_ENUM(RPC_AUTH_GSS_KRB5);
4100c77668dSChuck Lever TRACE_DEFINE_ENUM(RPC_AUTH_GSS_KRB5I);
4110c77668dSChuck Lever TRACE_DEFINE_ENUM(RPC_AUTH_GSS_KRB5P);
4120c77668dSChuck Lever 
4130c77668dSChuck Lever #define show_pseudoflavor(x)						\
4140c77668dSChuck Lever 	__print_symbolic(x,						\
4150c77668dSChuck Lever 		{ RPC_AUTH_GSS_KRB5, "RPC_AUTH_GSS_KRB5" },		\
4160c77668dSChuck Lever 		{ RPC_AUTH_GSS_KRB5I, "RPC_AUTH_GSS_KRB5I" },		\
4170c77668dSChuck Lever 		{ RPC_AUTH_GSS_KRB5P, "RPC_AUTH_GSS_KRB5P" })
4180c77668dSChuck Lever 
4190c77668dSChuck Lever 
4200c77668dSChuck Lever TRACE_EVENT(rpcgss_createauth,
4210c77668dSChuck Lever 	TP_PROTO(
4220c77668dSChuck Lever 		unsigned int flavor,
4230c77668dSChuck Lever 		int error
4240c77668dSChuck Lever 	),
4250c77668dSChuck Lever 
4260c77668dSChuck Lever 	TP_ARGS(flavor, error),
4270c77668dSChuck Lever 
4280c77668dSChuck Lever 	TP_STRUCT__entry(
4290c77668dSChuck Lever 		__field(unsigned int, flavor)
4300c77668dSChuck Lever 		__field(int, error)
4310c77668dSChuck Lever 
4320c77668dSChuck Lever 	),
4330c77668dSChuck Lever 
4340c77668dSChuck Lever 	TP_fast_assign(
4350c77668dSChuck Lever 		__entry->flavor = flavor;
4360c77668dSChuck Lever 		__entry->error = error;
4370c77668dSChuck Lever 	),
4380c77668dSChuck Lever 
4390c77668dSChuck Lever 	TP_printk("flavor=%s error=%d",
4400c77668dSChuck Lever 		show_pseudoflavor(__entry->flavor), __entry->error)
4410c77668dSChuck Lever );
4420c77668dSChuck Lever 
443ff27e9f7SChuck Lever TRACE_EVENT(rpcgss_oid_to_mech,
444ff27e9f7SChuck Lever 	TP_PROTO(
445ff27e9f7SChuck Lever 		const char *oid
446ff27e9f7SChuck Lever 	),
447ff27e9f7SChuck Lever 
448ff27e9f7SChuck Lever 	TP_ARGS(oid),
449ff27e9f7SChuck Lever 
450ff27e9f7SChuck Lever 	TP_STRUCT__entry(
451ff27e9f7SChuck Lever 		__string(oid, oid)
452ff27e9f7SChuck Lever 	),
453ff27e9f7SChuck Lever 
454ff27e9f7SChuck Lever 	TP_fast_assign(
455ff27e9f7SChuck Lever 		__assign_str(oid, oid);
456ff27e9f7SChuck Lever 	),
457ff27e9f7SChuck Lever 
458ff27e9f7SChuck Lever 	TP_printk("mech for oid %s was not found", __get_str(oid))
459ff27e9f7SChuck Lever );
4600c77668dSChuck Lever 
4610c77668dSChuck Lever #endif	/* _TRACE_RPCGSS_H */
4620c77668dSChuck Lever 
4630c77668dSChuck Lever #include <trace/define_trace.h>
464