1 /* SPDX-License-Identifier: GPL-2.0 */ 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 2 /* 3 * Copyright (c) 2018 Oracle. All rights rese 3 * Copyright (c) 2018 Oracle. All rights reserved. 4 * 4 * 5 * Trace point definitions for the "rpcgss" su 5 * Trace point definitions for the "rpcgss" subsystem. 6 */ 6 */ 7 7 8 #undef TRACE_SYSTEM 8 #undef TRACE_SYSTEM 9 #define TRACE_SYSTEM rpcgss 9 #define TRACE_SYSTEM rpcgss 10 10 11 #if !defined(_TRACE_RPCGSS_H) || defined(TRACE !! 11 #if !defined(_TRACE_RPCRDMA_H) || defined(TRACE_HEADER_MULTI_READ) 12 #define _TRACE_RPCGSS_H 12 #define _TRACE_RPCGSS_H 13 13 14 #include <linux/tracepoint.h> 14 #include <linux/tracepoint.h> 15 15 16 #include <trace/misc/sunrpc.h> << 17 << 18 /** 16 /** 19 ** GSS-API related trace events 17 ** GSS-API related trace events 20 **/ 18 **/ 21 19 22 TRACE_DEFINE_ENUM(RPC_GSS_SVC_NONE); 20 TRACE_DEFINE_ENUM(RPC_GSS_SVC_NONE); 23 TRACE_DEFINE_ENUM(RPC_GSS_SVC_INTEGRITY); 21 TRACE_DEFINE_ENUM(RPC_GSS_SVC_INTEGRITY); 24 TRACE_DEFINE_ENUM(RPC_GSS_SVC_PRIVACY); 22 TRACE_DEFINE_ENUM(RPC_GSS_SVC_PRIVACY); 25 23 26 #define show_gss_service(x) 24 #define show_gss_service(x) \ 27 __print_symbolic(x, 25 __print_symbolic(x, \ 28 { RPC_GSS_SVC_NONE, 26 { RPC_GSS_SVC_NONE, "none" }, \ 29 { RPC_GSS_SVC_INTEGRITY, 27 { RPC_GSS_SVC_INTEGRITY, "integrity" }, \ 30 { RPC_GSS_SVC_PRIVACY, 28 { RPC_GSS_SVC_PRIVACY, "privacy" }) 31 29 32 TRACE_DEFINE_ENUM(GSS_S_BAD_MECH); 30 TRACE_DEFINE_ENUM(GSS_S_BAD_MECH); 33 TRACE_DEFINE_ENUM(GSS_S_BAD_NAME); 31 TRACE_DEFINE_ENUM(GSS_S_BAD_NAME); 34 TRACE_DEFINE_ENUM(GSS_S_BAD_NAMETYPE); 32 TRACE_DEFINE_ENUM(GSS_S_BAD_NAMETYPE); 35 TRACE_DEFINE_ENUM(GSS_S_BAD_BINDINGS); 33 TRACE_DEFINE_ENUM(GSS_S_BAD_BINDINGS); 36 TRACE_DEFINE_ENUM(GSS_S_BAD_STATUS); 34 TRACE_DEFINE_ENUM(GSS_S_BAD_STATUS); 37 TRACE_DEFINE_ENUM(GSS_S_BAD_SIG); 35 TRACE_DEFINE_ENUM(GSS_S_BAD_SIG); 38 TRACE_DEFINE_ENUM(GSS_S_NO_CRED); 36 TRACE_DEFINE_ENUM(GSS_S_NO_CRED); 39 TRACE_DEFINE_ENUM(GSS_S_NO_CONTEXT); 37 TRACE_DEFINE_ENUM(GSS_S_NO_CONTEXT); 40 TRACE_DEFINE_ENUM(GSS_S_DEFECTIVE_TOKEN); 38 TRACE_DEFINE_ENUM(GSS_S_DEFECTIVE_TOKEN); 41 TRACE_DEFINE_ENUM(GSS_S_DEFECTIVE_CREDENTIAL); 39 TRACE_DEFINE_ENUM(GSS_S_DEFECTIVE_CREDENTIAL); 42 TRACE_DEFINE_ENUM(GSS_S_CREDENTIALS_EXPIRED); 40 TRACE_DEFINE_ENUM(GSS_S_CREDENTIALS_EXPIRED); 43 TRACE_DEFINE_ENUM(GSS_S_CONTEXT_EXPIRED); 41 TRACE_DEFINE_ENUM(GSS_S_CONTEXT_EXPIRED); 44 TRACE_DEFINE_ENUM(GSS_S_FAILURE); 42 TRACE_DEFINE_ENUM(GSS_S_FAILURE); 45 TRACE_DEFINE_ENUM(GSS_S_BAD_QOP); 43 TRACE_DEFINE_ENUM(GSS_S_BAD_QOP); 46 TRACE_DEFINE_ENUM(GSS_S_UNAUTHORIZED); 44 TRACE_DEFINE_ENUM(GSS_S_UNAUTHORIZED); 47 TRACE_DEFINE_ENUM(GSS_S_UNAVAILABLE); 45 TRACE_DEFINE_ENUM(GSS_S_UNAVAILABLE); 48 TRACE_DEFINE_ENUM(GSS_S_DUPLICATE_ELEMENT); 46 TRACE_DEFINE_ENUM(GSS_S_DUPLICATE_ELEMENT); 49 TRACE_DEFINE_ENUM(GSS_S_NAME_NOT_MN); 47 TRACE_DEFINE_ENUM(GSS_S_NAME_NOT_MN); 50 TRACE_DEFINE_ENUM(GSS_S_CONTINUE_NEEDED); 48 TRACE_DEFINE_ENUM(GSS_S_CONTINUE_NEEDED); 51 TRACE_DEFINE_ENUM(GSS_S_DUPLICATE_TOKEN); 49 TRACE_DEFINE_ENUM(GSS_S_DUPLICATE_TOKEN); 52 TRACE_DEFINE_ENUM(GSS_S_OLD_TOKEN); 50 TRACE_DEFINE_ENUM(GSS_S_OLD_TOKEN); 53 TRACE_DEFINE_ENUM(GSS_S_UNSEQ_TOKEN); 51 TRACE_DEFINE_ENUM(GSS_S_UNSEQ_TOKEN); 54 TRACE_DEFINE_ENUM(GSS_S_GAP_TOKEN); 52 TRACE_DEFINE_ENUM(GSS_S_GAP_TOKEN); 55 53 56 #define show_gss_status(x) 54 #define show_gss_status(x) \ 57 __print_symbolic(x, !! 55 __print_flags(x, "|", \ 58 { GSS_S_BAD_MECH, "GSS_S_BAD_M 56 { GSS_S_BAD_MECH, "GSS_S_BAD_MECH" }, \ 59 { GSS_S_BAD_NAME, "GSS_S_BAD_N 57 { GSS_S_BAD_NAME, "GSS_S_BAD_NAME" }, \ 60 { GSS_S_BAD_NAMETYPE, "GSS_S_B 58 { GSS_S_BAD_NAMETYPE, "GSS_S_BAD_NAMETYPE" }, \ 61 { GSS_S_BAD_BINDINGS, "GSS_S_B 59 { GSS_S_BAD_BINDINGS, "GSS_S_BAD_BINDINGS" }, \ 62 { GSS_S_BAD_STATUS, "GSS_S_BAD 60 { GSS_S_BAD_STATUS, "GSS_S_BAD_STATUS" }, \ 63 { GSS_S_BAD_SIG, "GSS_S_BAD_SI 61 { GSS_S_BAD_SIG, "GSS_S_BAD_SIG" }, \ 64 { GSS_S_NO_CRED, "GSS_S_NO_CRE 62 { GSS_S_NO_CRED, "GSS_S_NO_CRED" }, \ 65 { GSS_S_NO_CONTEXT, "GSS_S_NO_ 63 { GSS_S_NO_CONTEXT, "GSS_S_NO_CONTEXT" }, \ 66 { GSS_S_DEFECTIVE_TOKEN, "GSS_ 64 { GSS_S_DEFECTIVE_TOKEN, "GSS_S_DEFECTIVE_TOKEN" }, \ 67 { GSS_S_DEFECTIVE_CREDENTIAL, 65 { GSS_S_DEFECTIVE_CREDENTIAL, "GSS_S_DEFECTIVE_CREDENTIAL" }, \ 68 { GSS_S_CREDENTIALS_EXPIRED, " 66 { GSS_S_CREDENTIALS_EXPIRED, "GSS_S_CREDENTIALS_EXPIRED" }, \ 69 { GSS_S_CONTEXT_EXPIRED, "GSS_ 67 { GSS_S_CONTEXT_EXPIRED, "GSS_S_CONTEXT_EXPIRED" }, \ 70 { GSS_S_FAILURE, "GSS_S_FAILUR 68 { GSS_S_FAILURE, "GSS_S_FAILURE" }, \ 71 { GSS_S_BAD_QOP, "GSS_S_BAD_QO 69 { GSS_S_BAD_QOP, "GSS_S_BAD_QOP" }, \ 72 { GSS_S_UNAUTHORIZED, "GSS_S_U 70 { GSS_S_UNAUTHORIZED, "GSS_S_UNAUTHORIZED" }, \ 73 { GSS_S_UNAVAILABLE, "GSS_S_UN 71 { GSS_S_UNAVAILABLE, "GSS_S_UNAVAILABLE" }, \ 74 { GSS_S_DUPLICATE_ELEMENT, "GS 72 { GSS_S_DUPLICATE_ELEMENT, "GSS_S_DUPLICATE_ELEMENT" }, \ 75 { GSS_S_NAME_NOT_MN, "GSS_S_NA 73 { GSS_S_NAME_NOT_MN, "GSS_S_NAME_NOT_MN" }, \ 76 { GSS_S_CONTINUE_NEEDED, "GSS_ 74 { GSS_S_CONTINUE_NEEDED, "GSS_S_CONTINUE_NEEDED" }, \ 77 { GSS_S_DUPLICATE_TOKEN, "GSS_ 75 { GSS_S_DUPLICATE_TOKEN, "GSS_S_DUPLICATE_TOKEN" }, \ 78 { GSS_S_OLD_TOKEN, "GSS_S_OLD_ 76 { GSS_S_OLD_TOKEN, "GSS_S_OLD_TOKEN" }, \ 79 { GSS_S_UNSEQ_TOKEN, "GSS_S_UN 77 { GSS_S_UNSEQ_TOKEN, "GSS_S_UNSEQ_TOKEN" }, \ 80 { GSS_S_GAP_TOKEN, "GSS_S_GAP_ 78 { GSS_S_GAP_TOKEN, "GSS_S_GAP_TOKEN" }) 81 79 82 80 83 DECLARE_EVENT_CLASS(rpcgss_gssapi_event, 81 DECLARE_EVENT_CLASS(rpcgss_gssapi_event, 84 TP_PROTO( 82 TP_PROTO( 85 const struct rpc_task *task, 83 const struct rpc_task *task, 86 u32 maj_stat 84 u32 maj_stat 87 ), 85 ), 88 86 89 TP_ARGS(task, maj_stat), 87 TP_ARGS(task, maj_stat), 90 88 91 TP_STRUCT__entry( 89 TP_STRUCT__entry( 92 __field(unsigned int, task_id) 90 __field(unsigned int, task_id) 93 __field(unsigned int, client_i 91 __field(unsigned int, client_id) 94 __field(u32, maj_stat) 92 __field(u32, maj_stat) 95 93 96 ), 94 ), 97 95 98 TP_fast_assign( 96 TP_fast_assign( 99 __entry->task_id = task->tk_pi 97 __entry->task_id = task->tk_pid; 100 __entry->client_id = task->tk_ 98 __entry->client_id = task->tk_client->cl_clid; 101 __entry->maj_stat = maj_stat; 99 __entry->maj_stat = maj_stat; 102 ), 100 ), 103 101 104 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER !! 102 TP_printk("task:%u@%u maj_stat=%s", 105 __entry->task_id, __entry->cli 103 __entry->task_id, __entry->client_id, 106 __entry->maj_stat == 0 ? 104 __entry->maj_stat == 0 ? 107 "GSS_S_COMPLETE" : show_gss_st 105 "GSS_S_COMPLETE" : show_gss_status(__entry->maj_stat)) 108 ); 106 ); 109 107 110 #define DEFINE_GSSAPI_EVENT(name) 108 #define DEFINE_GSSAPI_EVENT(name) \ 111 DEFINE_EVENT(rpcgss_gssapi_event, rpcg 109 DEFINE_EVENT(rpcgss_gssapi_event, rpcgss_##name, \ 112 TP_PROTO( 110 TP_PROTO( \ 113 const struct r 111 const struct rpc_task *task, \ 114 u32 maj_stat 112 u32 maj_stat \ 115 ), 113 ), \ 116 TP_ARGS(task, maj_stat 114 TP_ARGS(task, maj_stat)) 117 115 118 TRACE_EVENT(rpcgss_import_ctx, 116 TRACE_EVENT(rpcgss_import_ctx, 119 TP_PROTO( 117 TP_PROTO( 120 int status 118 int status 121 ), 119 ), 122 120 123 TP_ARGS(status), 121 TP_ARGS(status), 124 122 125 TP_STRUCT__entry( 123 TP_STRUCT__entry( 126 __field(int, status) 124 __field(int, status) 127 ), 125 ), 128 126 129 TP_fast_assign( 127 TP_fast_assign( 130 __entry->status = status; 128 __entry->status = status; 131 ), 129 ), 132 130 133 TP_printk("status=%d", __entry->status 131 TP_printk("status=%d", __entry->status) 134 ); 132 ); 135 133 136 DEFINE_GSSAPI_EVENT(get_mic); 134 DEFINE_GSSAPI_EVENT(get_mic); 137 DEFINE_GSSAPI_EVENT(verify_mic); 135 DEFINE_GSSAPI_EVENT(verify_mic); 138 DEFINE_GSSAPI_EVENT(wrap); 136 DEFINE_GSSAPI_EVENT(wrap); 139 DEFINE_GSSAPI_EVENT(unwrap); 137 DEFINE_GSSAPI_EVENT(unwrap); 140 138 141 DECLARE_EVENT_CLASS(rpcgss_ctx_class, 139 DECLARE_EVENT_CLASS(rpcgss_ctx_class, 142 TP_PROTO( 140 TP_PROTO( 143 const struct gss_cred *gc 141 const struct gss_cred *gc 144 ), 142 ), 145 143 146 TP_ARGS(gc), 144 TP_ARGS(gc), 147 145 148 TP_STRUCT__entry( 146 TP_STRUCT__entry( 149 __field(const void *, cred) 147 __field(const void *, cred) 150 __field(unsigned long, service 148 __field(unsigned long, service) 151 __string(principal, gc->gc_pri 149 __string(principal, gc->gc_principal) 152 ), 150 ), 153 151 154 TP_fast_assign( 152 TP_fast_assign( 155 __entry->cred = gc; 153 __entry->cred = gc; 156 __entry->service = gc->gc_serv 154 __entry->service = gc->gc_service; 157 __assign_str(principal); !! 155 __assign_str(principal, gc->gc_principal) 158 ), 156 ), 159 157 160 TP_printk("cred=%p service=%s principa 158 TP_printk("cred=%p service=%s principal='%s'", 161 __entry->cred, show_gss_servic 159 __entry->cred, show_gss_service(__entry->service), 162 __get_str(principal)) 160 __get_str(principal)) 163 ); 161 ); 164 162 165 #define DEFINE_CTX_EVENT(name) 163 #define DEFINE_CTX_EVENT(name) \ 166 DEFINE_EVENT(rpcgss_ctx_class, rpcgss_ 164 DEFINE_EVENT(rpcgss_ctx_class, rpcgss_ctx_##name, \ 167 TP_PROTO( 165 TP_PROTO( \ 168 const struct g 166 const struct gss_cred *gc \ 169 ), 167 ), \ 170 TP_ARGS(gc)) 168 TP_ARGS(gc)) 171 169 172 DEFINE_CTX_EVENT(init); 170 DEFINE_CTX_EVENT(init); 173 DEFINE_CTX_EVENT(destroy); 171 DEFINE_CTX_EVENT(destroy); 174 172 175 DECLARE_EVENT_CLASS(rpcgss_svc_gssapi_class, << 176 TP_PROTO( << 177 const struct svc_rqst *rqstp, << 178 u32 maj_stat << 179 ), << 180 << 181 TP_ARGS(rqstp, maj_stat), << 182 << 183 TP_STRUCT__entry( << 184 __field(u32, xid) << 185 __field(u32, maj_stat) << 186 __string(addr, rqstp->rq_xprt- << 187 ), << 188 << 189 TP_fast_assign( << 190 __entry->xid = __be32_to_cpu(r << 191 __entry->maj_stat = maj_stat; << 192 __assign_str(addr); << 193 ), << 194 << 195 TP_printk("addr=%s xid=0x%08x maj_stat << 196 __get_str(addr), __entry->xid, << 197 __entry->maj_stat == 0 ? << 198 "GSS_S_COMPLETE" : show_gss_st << 199 ); << 200 << 201 #define DEFINE_SVC_GSSAPI_EVENT(name) << 202 DEFINE_EVENT(rpcgss_svc_gssapi_class, << 203 TP_PROTO( << 204 const struct s << 205 u32 maj_stat << 206 ), << 207 TP_ARGS(rqstp, maj_sta << 208 << 209 DEFINE_SVC_GSSAPI_EVENT(wrap); << 210 DEFINE_SVC_GSSAPI_EVENT(unwrap); << 211 DEFINE_SVC_GSSAPI_EVENT(mic); << 212 DEFINE_SVC_GSSAPI_EVENT(get_mic); << 213 << 214 TRACE_EVENT(rpcgss_svc_wrap_failed, << 215 TP_PROTO( << 216 const struct svc_rqst *rqstp << 217 ), << 218 << 219 TP_ARGS(rqstp), << 220 << 221 TP_STRUCT__entry( << 222 __field(u32, xid) << 223 __string(addr, rqstp->rq_xprt- << 224 ), << 225 << 226 TP_fast_assign( << 227 __entry->xid = be32_to_cpu(rqs << 228 __assign_str(addr); << 229 ), << 230 << 231 TP_printk("addr=%s xid=0x%08x", __get_ << 232 ); << 233 << 234 TRACE_EVENT(rpcgss_svc_unwrap_failed, << 235 TP_PROTO( << 236 const struct svc_rqst *rqstp << 237 ), << 238 << 239 TP_ARGS(rqstp), << 240 << 241 TP_STRUCT__entry( << 242 __field(u32, xid) << 243 __string(addr, rqstp->rq_xprt- << 244 ), << 245 << 246 TP_fast_assign( << 247 __entry->xid = be32_to_cpu(rqs << 248 __assign_str(addr); << 249 ), << 250 << 251 TP_printk("addr=%s xid=0x%08x", __get_ << 252 ); << 253 << 254 TRACE_EVENT(rpcgss_svc_seqno_bad, << 255 TP_PROTO( << 256 const struct svc_rqst *rqstp, << 257 u32 expected, << 258 u32 received << 259 ), << 260 << 261 TP_ARGS(rqstp, expected, received), << 262 << 263 TP_STRUCT__entry( << 264 __field(u32, expected) << 265 __field(u32, received) << 266 __field(u32, xid) << 267 __string(addr, rqstp->rq_xprt- << 268 ), << 269 << 270 TP_fast_assign( << 271 __entry->expected = expected; << 272 __entry->received = received; << 273 __entry->xid = __be32_to_cpu(r << 274 __assign_str(addr); << 275 ), << 276 << 277 TP_printk("addr=%s xid=0x%08x expected << 278 __get_str(addr), __entry->xid, << 279 __entry->expected, __entry->re << 280 ); << 281 << 282 TRACE_EVENT(rpcgss_svc_accept_upcall, 173 TRACE_EVENT(rpcgss_svc_accept_upcall, 283 TP_PROTO( 174 TP_PROTO( 284 const struct svc_rqst *rqstp, !! 175 __be32 xid, 285 u32 major_status, 176 u32 major_status, 286 u32 minor_status 177 u32 minor_status 287 ), 178 ), 288 179 289 TP_ARGS(rqstp, major_status, minor_sta !! 180 TP_ARGS(xid, major_status, minor_status), 290 181 291 TP_STRUCT__entry( 182 TP_STRUCT__entry( >> 183 __field(u32, xid) 292 __field(u32, minor_status) 184 __field(u32, minor_status) 293 __field(unsigned long, major_s 185 __field(unsigned long, major_status) 294 __field(u32, xid) << 295 __string(addr, rqstp->rq_xprt- << 296 ), 186 ), 297 187 298 TP_fast_assign( 188 TP_fast_assign( >> 189 __entry->xid = be32_to_cpu(xid); 299 __entry->minor_status = minor_ 190 __entry->minor_status = minor_status; 300 __entry->major_status = major_ 191 __entry->major_status = major_status; 301 __entry->xid = be32_to_cpu(rqs << 302 __assign_str(addr); << 303 ), 192 ), 304 193 305 TP_printk("addr=%s xid=0x%08x major_st !! 194 TP_printk("xid=0x%08x major_status=%s (0x%08lx) minor_status=%u", 306 __get_str(addr), __entry->xid, !! 195 __entry->xid, __entry->major_status == 0 ? "GSS_S_COMPLETE" : 307 (__entry->major_status == 0) ? !! 196 show_gss_status(__entry->major_status), 308 show_gss_status(__entr << 309 __entry->major_status, __entry 197 __entry->major_status, __entry->minor_status 310 ) 198 ) 311 ); 199 ); 312 200 313 TRACE_EVENT(rpcgss_svc_authenticate, !! 201 TRACE_EVENT(rpcgss_svc_accept, 314 TP_PROTO( 202 TP_PROTO( 315 const struct svc_rqst *rqstp, !! 203 __be32 xid, 316 const struct rpc_gss_wire_cred !! 204 size_t len 317 ), 205 ), 318 206 319 TP_ARGS(rqstp, gc), !! 207 TP_ARGS(xid, len), 320 208 321 TP_STRUCT__entry( 209 TP_STRUCT__entry( 322 __field(u32, seqno) << 323 __field(u32, xid) 210 __field(u32, xid) 324 __string(addr, rqstp->rq_xprt- !! 211 __field(size_t, len) 325 ), 212 ), 326 213 327 TP_fast_assign( 214 TP_fast_assign( 328 __entry->xid = be32_to_cpu(rqs !! 215 __entry->xid = be32_to_cpu(xid); 329 __entry->seqno = gc->gc_seq; !! 216 __entry->len = len; 330 __assign_str(addr); << 331 ), 217 ), 332 218 333 TP_printk("addr=%s xid=0x%08x seqno=%u !! 219 TP_printk("xid=0x%08x len=%zu", 334 __entry->xid, __entry->seqno) !! 220 __entry->xid, __entry->len >> 221 ) 335 ); 222 ); 336 223 337 224 338 /** 225 /** 339 ** GSS auth unwrap failures 226 ** GSS auth unwrap failures 340 **/ 227 **/ 341 228 342 TRACE_EVENT(rpcgss_unwrap_failed, 229 TRACE_EVENT(rpcgss_unwrap_failed, 343 TP_PROTO( 230 TP_PROTO( 344 const struct rpc_task *task 231 const struct rpc_task *task 345 ), 232 ), 346 233 347 TP_ARGS(task), 234 TP_ARGS(task), 348 235 349 TP_STRUCT__entry( 236 TP_STRUCT__entry( 350 __field(unsigned int, task_id) 237 __field(unsigned int, task_id) 351 __field(unsigned int, client_i 238 __field(unsigned int, client_id) 352 ), 239 ), 353 240 354 TP_fast_assign( 241 TP_fast_assign( 355 __entry->task_id = task->tk_pi 242 __entry->task_id = task->tk_pid; 356 __entry->client_id = task->tk_ 243 __entry->client_id = task->tk_client->cl_clid; 357 ), 244 ), 358 245 359 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER, !! 246 TP_printk("task:%u@%u", __entry->task_id, __entry->client_id) 360 __entry->task_id, __entry->cli << 361 ); 247 ); 362 248 363 TRACE_EVENT(rpcgss_bad_seqno, 249 TRACE_EVENT(rpcgss_bad_seqno, 364 TP_PROTO( 250 TP_PROTO( 365 const struct rpc_task *task, 251 const struct rpc_task *task, 366 u32 expected, 252 u32 expected, 367 u32 received 253 u32 received 368 ), 254 ), 369 255 370 TP_ARGS(task, expected, received), 256 TP_ARGS(task, expected, received), 371 257 372 TP_STRUCT__entry( 258 TP_STRUCT__entry( 373 __field(unsigned int, task_id) 259 __field(unsigned int, task_id) 374 __field(unsigned int, client_i 260 __field(unsigned int, client_id) 375 __field(u32, expected) 261 __field(u32, expected) 376 __field(u32, received) 262 __field(u32, received) 377 ), 263 ), 378 264 379 TP_fast_assign( 265 TP_fast_assign( 380 __entry->task_id = task->tk_pi 266 __entry->task_id = task->tk_pid; 381 __entry->client_id = task->tk_ 267 __entry->client_id = task->tk_client->cl_clid; 382 __entry->expected = expected; 268 __entry->expected = expected; 383 __entry->received = received; 269 __entry->received = received; 384 ), 270 ), 385 271 386 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER !! 272 TP_printk("task:%u@%u expected seqno %u, received seqno %u", 387 " expected seqno %u, receive << 388 __entry->task_id, __entry->cli 273 __entry->task_id, __entry->client_id, 389 __entry->expected, __entry->re 274 __entry->expected, __entry->received) 390 ); 275 ); 391 276 392 TRACE_EVENT(rpcgss_seqno, 277 TRACE_EVENT(rpcgss_seqno, 393 TP_PROTO( 278 TP_PROTO( 394 const struct rpc_task *task 279 const struct rpc_task *task 395 ), 280 ), 396 281 397 TP_ARGS(task), 282 TP_ARGS(task), 398 283 399 TP_STRUCT__entry( 284 TP_STRUCT__entry( 400 __field(unsigned int, task_id) 285 __field(unsigned int, task_id) 401 __field(unsigned int, client_i 286 __field(unsigned int, client_id) 402 __field(u32, xid) 287 __field(u32, xid) 403 __field(u32, seqno) 288 __field(u32, seqno) 404 ), 289 ), 405 290 406 TP_fast_assign( 291 TP_fast_assign( 407 const struct rpc_rqst *rqst = 292 const struct rpc_rqst *rqst = task->tk_rqstp; 408 293 409 __entry->task_id = task->tk_pi 294 __entry->task_id = task->tk_pid; 410 __entry->client_id = task->tk_ 295 __entry->client_id = task->tk_client->cl_clid; 411 __entry->xid = be32_to_cpu(rqs 296 __entry->xid = be32_to_cpu(rqst->rq_xid); 412 __entry->seqno = rqst->rq_seqn 297 __entry->seqno = rqst->rq_seqno; 413 ), 298 ), 414 299 415 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER !! 300 TP_printk("task:%u@%u xid=0x%08x seqno=%u", 416 __entry->task_id, __entry->cli 301 __entry->task_id, __entry->client_id, 417 __entry->xid, __entry->seqno) 302 __entry->xid, __entry->seqno) 418 ); 303 ); 419 304 420 TRACE_EVENT(rpcgss_need_reencode, 305 TRACE_EVENT(rpcgss_need_reencode, 421 TP_PROTO( 306 TP_PROTO( 422 const struct rpc_task *task, 307 const struct rpc_task *task, 423 u32 seq_xmit, 308 u32 seq_xmit, 424 bool ret 309 bool ret 425 ), 310 ), 426 311 427 TP_ARGS(task, seq_xmit, ret), 312 TP_ARGS(task, seq_xmit, ret), 428 313 429 TP_STRUCT__entry( 314 TP_STRUCT__entry( 430 __field(unsigned int, task_id) 315 __field(unsigned int, task_id) 431 __field(unsigned int, client_i 316 __field(unsigned int, client_id) 432 __field(u32, xid) 317 __field(u32, xid) 433 __field(u32, seq_xmit) 318 __field(u32, seq_xmit) 434 __field(u32, seqno) 319 __field(u32, seqno) 435 __field(bool, ret) 320 __field(bool, ret) 436 ), 321 ), 437 322 438 TP_fast_assign( 323 TP_fast_assign( 439 __entry->task_id = task->tk_pi 324 __entry->task_id = task->tk_pid; 440 __entry->client_id = task->tk_ 325 __entry->client_id = task->tk_client->cl_clid; 441 __entry->xid = be32_to_cpu(tas 326 __entry->xid = be32_to_cpu(task->tk_rqstp->rq_xid); 442 __entry->seq_xmit = seq_xmit; 327 __entry->seq_xmit = seq_xmit; 443 __entry->seqno = task->tk_rqst 328 __entry->seqno = task->tk_rqstp->rq_seqno; 444 __entry->ret = ret; 329 __entry->ret = ret; 445 ), 330 ), 446 331 447 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER !! 332 TP_printk("task:%u@%u xid=0x%08x rq_seqno=%u seq_xmit=%u reencode %sneeded", 448 " xid=0x%08x rq_seqno=%u seq << 449 __entry->task_id, __entry->cli 333 __entry->task_id, __entry->client_id, 450 __entry->xid, __entry->seqno, 334 __entry->xid, __entry->seqno, __entry->seq_xmit, 451 __entry->ret ? "" : "un") 335 __entry->ret ? "" : "un") 452 ); 336 ); 453 337 454 TRACE_EVENT(rpcgss_update_slack, 338 TRACE_EVENT(rpcgss_update_slack, 455 TP_PROTO( 339 TP_PROTO( 456 const struct rpc_task *task, 340 const struct rpc_task *task, 457 const struct rpc_auth *auth 341 const struct rpc_auth *auth 458 ), 342 ), 459 343 460 TP_ARGS(task, auth), 344 TP_ARGS(task, auth), 461 345 462 TP_STRUCT__entry( 346 TP_STRUCT__entry( 463 __field(unsigned int, task_id) 347 __field(unsigned int, task_id) 464 __field(unsigned int, client_i 348 __field(unsigned int, client_id) 465 __field(u32, xid) 349 __field(u32, xid) 466 __field(const void *, auth) 350 __field(const void *, auth) 467 __field(unsigned int, rslack) 351 __field(unsigned int, rslack) 468 __field(unsigned int, ralign) 352 __field(unsigned int, ralign) 469 __field(unsigned int, verfsize 353 __field(unsigned int, verfsize) 470 ), 354 ), 471 355 472 TP_fast_assign( 356 TP_fast_assign( 473 __entry->task_id = task->tk_pi 357 __entry->task_id = task->tk_pid; 474 __entry->client_id = task->tk_ 358 __entry->client_id = task->tk_client->cl_clid; 475 __entry->xid = be32_to_cpu(tas 359 __entry->xid = be32_to_cpu(task->tk_rqstp->rq_xid); 476 __entry->auth = auth; 360 __entry->auth = auth; 477 __entry->rslack = auth->au_rsl 361 __entry->rslack = auth->au_rslack; 478 __entry->ralign = auth->au_ral 362 __entry->ralign = auth->au_ralign; 479 __entry->verfsize = auth->au_v 363 __entry->verfsize = auth->au_verfsize; 480 ), 364 ), 481 365 482 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER !! 366 TP_printk("task:%u@%u xid=0x%08x auth=%p rslack=%u ralign=%u verfsize=%u\n", 483 " xid=0x%08x auth=%p rslack= << 484 __entry->task_id, __entry->cli 367 __entry->task_id, __entry->client_id, __entry->xid, 485 __entry->auth, __entry->rslack 368 __entry->auth, __entry->rslack, __entry->ralign, 486 __entry->verfsize) 369 __entry->verfsize) 487 ); 370 ); 488 371 489 DECLARE_EVENT_CLASS(rpcgss_svc_seqno_class, 372 DECLARE_EVENT_CLASS(rpcgss_svc_seqno_class, 490 TP_PROTO( 373 TP_PROTO( 491 const struct svc_rqst *rqstp, !! 374 __be32 xid, 492 u32 seqno 375 u32 seqno 493 ), 376 ), 494 377 495 TP_ARGS(rqstp, seqno), !! 378 TP_ARGS(xid, seqno), 496 379 497 TP_STRUCT__entry( 380 TP_STRUCT__entry( 498 __field(u32, xid) 381 __field(u32, xid) 499 __field(u32, seqno) 382 __field(u32, seqno) 500 ), 383 ), 501 384 502 TP_fast_assign( 385 TP_fast_assign( 503 __entry->xid = be32_to_cpu(rqs !! 386 __entry->xid = be32_to_cpu(xid); 504 __entry->seqno = seqno; 387 __entry->seqno = seqno; 505 ), 388 ), 506 389 507 TP_printk("xid=0x%08x seqno=%u", !! 390 TP_printk("xid=0x%08x seqno=%u, request discarded", 508 __entry->xid, __entry->seqno) 391 __entry->xid, __entry->seqno) 509 ); 392 ); 510 393 511 #define DEFINE_SVC_SEQNO_EVENT(name) 394 #define DEFINE_SVC_SEQNO_EVENT(name) \ 512 DEFINE_EVENT(rpcgss_svc_seqno_class, r !! 395 DEFINE_EVENT(rpcgss_svc_seqno_class, rpcgss_svc_##name, \ 513 TP_PROTO( 396 TP_PROTO( \ 514 const struct s !! 397 __be32 xid, \ 515 u32 seqno 398 u32 seqno \ 516 ), 399 ), \ 517 TP_ARGS(rqstp, seqno)) !! 400 TP_ARGS(xid, seqno)) 518 << 519 DEFINE_SVC_SEQNO_EVENT(large); << 520 DEFINE_SVC_SEQNO_EVENT(seen); << 521 << 522 TRACE_EVENT(rpcgss_svc_seqno_low, << 523 TP_PROTO( << 524 const struct svc_rqst *rqstp, << 525 u32 seqno, << 526 u32 min, << 527 u32 max << 528 ), << 529 << 530 TP_ARGS(rqstp, seqno, min, max), << 531 401 532 TP_STRUCT__entry( !! 402 DEFINE_SVC_SEQNO_EVENT(large_seqno); 533 __field(u32, xid) !! 403 DEFINE_SVC_SEQNO_EVENT(old_seqno); 534 __field(u32, seqno) << 535 __field(u32, min) << 536 __field(u32, max) << 537 ), << 538 404 539 TP_fast_assign( << 540 __entry->xid = be32_to_cpu(rqs << 541 __entry->seqno = seqno; << 542 __entry->min = min; << 543 __entry->max = max; << 544 ), << 545 << 546 TP_printk("xid=0x%08x seqno=%u window= << 547 __entry->xid, __entry->seqno, << 548 ); << 549 405 550 /** 406 /** 551 ** gssd upcall related trace events 407 ** gssd upcall related trace events 552 **/ 408 **/ 553 409 554 TRACE_EVENT(rpcgss_upcall_msg, 410 TRACE_EVENT(rpcgss_upcall_msg, 555 TP_PROTO( 411 TP_PROTO( 556 const char *buf 412 const char *buf 557 ), 413 ), 558 414 559 TP_ARGS(buf), 415 TP_ARGS(buf), 560 416 561 TP_STRUCT__entry( 417 TP_STRUCT__entry( 562 __string(msg, buf) 418 __string(msg, buf) 563 ), 419 ), 564 420 565 TP_fast_assign( 421 TP_fast_assign( 566 __assign_str(msg); !! 422 __assign_str(msg, buf) 567 ), 423 ), 568 424 569 TP_printk("msg='%s'", __get_str(msg)) 425 TP_printk("msg='%s'", __get_str(msg)) 570 ); 426 ); 571 427 572 TRACE_EVENT(rpcgss_upcall_result, 428 TRACE_EVENT(rpcgss_upcall_result, 573 TP_PROTO( 429 TP_PROTO( 574 u32 uid, 430 u32 uid, 575 int result 431 int result 576 ), 432 ), 577 433 578 TP_ARGS(uid, result), 434 TP_ARGS(uid, result), 579 435 580 TP_STRUCT__entry( 436 TP_STRUCT__entry( 581 __field(u32, uid) 437 __field(u32, uid) 582 __field(int, result) 438 __field(int, result) 583 439 584 ), 440 ), 585 441 586 TP_fast_assign( 442 TP_fast_assign( 587 __entry->uid = uid; 443 __entry->uid = uid; 588 __entry->result = result; 444 __entry->result = result; 589 ), 445 ), 590 446 591 TP_printk("for uid %u, result=%d", __e 447 TP_printk("for uid %u, result=%d", __entry->uid, __entry->result) 592 ); 448 ); 593 449 594 TRACE_EVENT(rpcgss_context, 450 TRACE_EVENT(rpcgss_context, 595 TP_PROTO( 451 TP_PROTO( 596 u32 window_size, 452 u32 window_size, 597 unsigned long expiry, 453 unsigned long expiry, 598 unsigned long now, 454 unsigned long now, 599 unsigned int timeout, 455 unsigned int timeout, 600 unsigned int len, 456 unsigned int len, 601 const u8 *data 457 const u8 *data 602 ), 458 ), 603 459 604 TP_ARGS(window_size, expiry, now, time 460 TP_ARGS(window_size, expiry, now, timeout, len, data), 605 461 606 TP_STRUCT__entry( 462 TP_STRUCT__entry( 607 __field(unsigned long, expiry) 463 __field(unsigned long, expiry) 608 __field(unsigned long, now) 464 __field(unsigned long, now) 609 __field(unsigned int, timeout) 465 __field(unsigned int, timeout) 610 __field(u32, window_size) 466 __field(u32, window_size) 611 __field(int, len) 467 __field(int, len) 612 __string_len(acceptor, data, l !! 468 __string(acceptor, data) 613 ), 469 ), 614 470 615 TP_fast_assign( 471 TP_fast_assign( 616 __entry->expiry = expiry; 472 __entry->expiry = expiry; 617 __entry->now = now; 473 __entry->now = now; 618 __entry->timeout = timeout; 474 __entry->timeout = timeout; 619 __entry->window_size = window_ 475 __entry->window_size = window_size; 620 __entry->len = len; 476 __entry->len = len; 621 __assign_str(acceptor); !! 477 strncpy(__get_str(acceptor), data, len); 622 ), 478 ), 623 479 624 TP_printk("win_size=%u expiry=%lu now= 480 TP_printk("win_size=%u expiry=%lu now=%lu timeout=%u acceptor=%.*s", 625 __entry->window_size, __entry- 481 __entry->window_size, __entry->expiry, __entry->now, 626 __entry->timeout, __entry->len 482 __entry->timeout, __entry->len, __get_str(acceptor)) 627 ); 483 ); 628 484 629 485 630 /** 486 /** 631 ** Miscellaneous events 487 ** Miscellaneous events 632 */ 488 */ 633 489 634 TRACE_DEFINE_ENUM(RPC_AUTH_GSS_KRB5); 490 TRACE_DEFINE_ENUM(RPC_AUTH_GSS_KRB5); 635 TRACE_DEFINE_ENUM(RPC_AUTH_GSS_KRB5I); 491 TRACE_DEFINE_ENUM(RPC_AUTH_GSS_KRB5I); 636 TRACE_DEFINE_ENUM(RPC_AUTH_GSS_KRB5P); 492 TRACE_DEFINE_ENUM(RPC_AUTH_GSS_KRB5P); 637 493 638 #define show_pseudoflavor(x) 494 #define show_pseudoflavor(x) \ 639 __print_symbolic(x, 495 __print_symbolic(x, \ 640 { RPC_AUTH_GSS_KRB5, "RPC_AUTH 496 { RPC_AUTH_GSS_KRB5, "RPC_AUTH_GSS_KRB5" }, \ 641 { RPC_AUTH_GSS_KRB5I, "RPC_AUT 497 { RPC_AUTH_GSS_KRB5I, "RPC_AUTH_GSS_KRB5I" }, \ 642 { RPC_AUTH_GSS_KRB5P, "RPC_AUT 498 { RPC_AUTH_GSS_KRB5P, "RPC_AUTH_GSS_KRB5P" }) 643 499 644 500 645 TRACE_EVENT(rpcgss_createauth, 501 TRACE_EVENT(rpcgss_createauth, 646 TP_PROTO( 502 TP_PROTO( 647 unsigned int flavor, 503 unsigned int flavor, 648 int error 504 int error 649 ), 505 ), 650 506 651 TP_ARGS(flavor, error), 507 TP_ARGS(flavor, error), 652 508 653 TP_STRUCT__entry( 509 TP_STRUCT__entry( 654 __field(unsigned int, flavor) 510 __field(unsigned int, flavor) 655 __field(int, error) 511 __field(int, error) 656 512 657 ), 513 ), 658 514 659 TP_fast_assign( 515 TP_fast_assign( 660 __entry->flavor = flavor; 516 __entry->flavor = flavor; 661 __entry->error = error; 517 __entry->error = error; 662 ), 518 ), 663 519 664 TP_printk("flavor=%s error=%d", 520 TP_printk("flavor=%s error=%d", 665 show_pseudoflavor(__entry->fla 521 show_pseudoflavor(__entry->flavor), __entry->error) 666 ); 522 ); 667 523 668 TRACE_EVENT(rpcgss_oid_to_mech, 524 TRACE_EVENT(rpcgss_oid_to_mech, 669 TP_PROTO( 525 TP_PROTO( 670 const char *oid 526 const char *oid 671 ), 527 ), 672 528 673 TP_ARGS(oid), 529 TP_ARGS(oid), 674 530 675 TP_STRUCT__entry( 531 TP_STRUCT__entry( 676 __string(oid, oid) 532 __string(oid, oid) 677 ), 533 ), 678 534 679 TP_fast_assign( 535 TP_fast_assign( 680 __assign_str(oid); !! 536 __assign_str(oid, oid); 681 ), 537 ), 682 538 683 TP_printk("mech for oid %s was not fou 539 TP_printk("mech for oid %s was not found", __get_str(oid)) 684 ); 540 ); 685 541 686 #endif /* _TRACE_RPCGSS_H */ 542 #endif /* _TRACE_RPCGSS_H */ 687 543 688 #include <trace/define_trace.h> 544 #include <trace/define_trace.h> 689 545
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.