1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2014 Christoph Hellwig.
6 #define TRACE_SYSTEM nfsd
8 #if !defined(_NFSD_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
11 #include <linux/tracepoint.h>
15 #define NFSD_TRACE_PROC_ARG_FIELDS \
16 __field(unsigned int, netns_ino) \
18 __array(unsigned char, server, sizeof(struct sockaddr_in6)) \
19 __array(unsigned char, client, sizeof(struct sockaddr_in6))
21 #define NFSD_TRACE_PROC_ARG_ASSIGNMENTS \
23 __entry->netns_ino = SVC_NET(rqstp)->ns.inum; \
24 __entry->xid = be32_to_cpu(rqstp->rq_xid); \
25 memcpy(__entry->server, &rqstp->rq_xprt->xpt_local, \
26 rqstp->rq_xprt->xpt_locallen); \
27 memcpy(__entry->client, &rqstp->rq_xprt->xpt_remote, \
28 rqstp->rq_xprt->xpt_remotelen); \
31 #define NFSD_TRACE_PROC_RES_FIELDS \
32 __field(unsigned int, netns_ino) \
34 __field(unsigned long, status) \
35 __array(unsigned char, server, sizeof(struct sockaddr_in6)) \
36 __array(unsigned char, client, sizeof(struct sockaddr_in6))
38 #define NFSD_TRACE_PROC_RES_ASSIGNMENTS(error) \
40 __entry->netns_ino = SVC_NET(rqstp)->ns.inum; \
41 __entry->xid = be32_to_cpu(rqstp->rq_xid); \
42 __entry->status = be32_to_cpu(error); \
43 memcpy(__entry->server, &rqstp->rq_xprt->xpt_local, \
44 rqstp->rq_xprt->xpt_locallen); \
45 memcpy(__entry->client, &rqstp->rq_xprt->xpt_remote, \
46 rqstp->rq_xprt->xpt_remotelen); \
49 TRACE_EVENT(nfsd_garbage_args_err
,
51 const struct svc_rqst
*rqstp
55 NFSD_TRACE_PROC_ARG_FIELDS
61 NFSD_TRACE_PROC_ARG_ASSIGNMENTS
63 __entry
->vers
= rqstp
->rq_vers
;
64 __entry
->proc
= rqstp
->rq_proc
;
66 TP_printk("xid=0x%08x vers=%u proc=%u",
67 __entry
->xid
, __entry
->vers
, __entry
->proc
71 TRACE_EVENT(nfsd_cant_encode_err
,
73 const struct svc_rqst
*rqstp
77 NFSD_TRACE_PROC_ARG_FIELDS
83 NFSD_TRACE_PROC_ARG_ASSIGNMENTS
85 __entry
->vers
= rqstp
->rq_vers
;
86 __entry
->proc
= rqstp
->rq_proc
;
88 TP_printk("xid=0x%08x vers=%u proc=%u",
89 __entry
->xid
, __entry
->vers
, __entry
->proc
93 #define show_nfsd_may_flags(x) \
94 __print_flags(x, "|", \
95 { NFSD_MAY_EXEC, "EXEC" }, \
96 { NFSD_MAY_WRITE, "WRITE" }, \
97 { NFSD_MAY_READ, "READ" }, \
98 { NFSD_MAY_SATTR, "SATTR" }, \
99 { NFSD_MAY_TRUNC, "TRUNC" }, \
100 { NFSD_MAY_LOCK, "LOCK" }, \
101 { NFSD_MAY_OWNER_OVERRIDE, "OWNER_OVERRIDE" }, \
102 { NFSD_MAY_LOCAL_ACCESS, "LOCAL_ACCESS" }, \
103 { NFSD_MAY_BYPASS_GSS_ON_ROOT, "BYPASS_GSS_ON_ROOT" }, \
104 { NFSD_MAY_NOT_BREAK_LEASE, "NOT_BREAK_LEASE" }, \
105 { NFSD_MAY_BYPASS_GSS, "BYPASS_GSS" }, \
106 { NFSD_MAY_READ_IF_EXEC, "READ_IF_EXEC" }, \
107 { NFSD_MAY_64BIT_COOKIE, "64BIT_COOKIE" })
109 TRACE_EVENT(nfsd_compound
,
110 TP_PROTO(const struct svc_rqst
*rqst
,
112 TP_ARGS(rqst
, args_opcnt
),
115 __field(u32
, args_opcnt
)
118 __entry
->xid
= be32_to_cpu(rqst
->rq_xid
);
119 __entry
->args_opcnt
= args_opcnt
;
121 TP_printk("xid=0x%08x opcnt=%u",
122 __entry
->xid
, __entry
->args_opcnt
)
125 TRACE_EVENT(nfsd_compound_status
,
126 TP_PROTO(u32 args_opcnt
,
130 TP_ARGS(args_opcnt
, resp_opcnt
, status
, name
),
132 __field(u32
, args_opcnt
)
133 __field(u32
, resp_opcnt
)
138 __entry
->args_opcnt
= args_opcnt
;
139 __entry
->resp_opcnt
= resp_opcnt
;
140 __entry
->status
= be32_to_cpu(status
);
141 __assign_str(name
, name
);
143 TP_printk("op=%u/%u %s status=%d",
144 __entry
->resp_opcnt
, __entry
->args_opcnt
,
145 __get_str(name
), __entry
->status
)
148 TRACE_EVENT(nfsd_compound_decode_err
,
150 const struct svc_rqst
*rqstp
,
156 TP_ARGS(rqstp
, args_opcnt
, resp_opcnt
, opnum
, status
),
158 NFSD_TRACE_PROC_RES_FIELDS
160 __field(u32
, args_opcnt
)
161 __field(u32
, resp_opcnt
)
165 NFSD_TRACE_PROC_RES_ASSIGNMENTS(status
)
167 __entry
->args_opcnt
= args_opcnt
;
168 __entry
->resp_opcnt
= resp_opcnt
;
169 __entry
->opnum
= opnum
;
171 TP_printk("op=%u/%u opnum=%u status=%lu",
172 __entry
->resp_opcnt
, __entry
->args_opcnt
,
173 __entry
->opnum
, __entry
->status
)
176 TRACE_EVENT(nfsd_compound_encode_err
,
178 const struct svc_rqst
*rqstp
,
182 TP_ARGS(rqstp
, opnum
, status
),
184 NFSD_TRACE_PROC_RES_FIELDS
189 NFSD_TRACE_PROC_RES_ASSIGNMENTS(status
)
191 __entry
->opnum
= opnum
;
193 TP_printk("opnum=%u status=%lu",
194 __entry
->opnum
, __entry
->status
)
198 DECLARE_EVENT_CLASS(nfsd_fh_err_class
,
199 TP_PROTO(struct svc_rqst
*rqstp
,
202 TP_ARGS(rqstp
, fhp
, status
),
205 __field(u32
, fh_hash
)
209 __entry
->xid
= be32_to_cpu(rqstp
->rq_xid
);
210 __entry
->fh_hash
= knfsd_fh_hash(&fhp
->fh_handle
);
211 __entry
->status
= status
;
213 TP_printk("xid=0x%08x fh_hash=0x%08x status=%d",
214 __entry
->xid
, __entry
->fh_hash
,
218 #define DEFINE_NFSD_FH_ERR_EVENT(name) \
219 DEFINE_EVENT(nfsd_fh_err_class, nfsd_##name, \
220 TP_PROTO(struct svc_rqst *rqstp, \
221 struct svc_fh *fhp, \
223 TP_ARGS(rqstp, fhp, status))
225 DEFINE_NFSD_FH_ERR_EVENT(set_fh_dentry_badexport
);
226 DEFINE_NFSD_FH_ERR_EVENT(set_fh_dentry_badhandle
);
228 TRACE_EVENT(nfsd_exp_find_key
,
229 TP_PROTO(const struct svc_expkey
*key
,
231 TP_ARGS(key
, status
),
233 __field(int, fsidtype
)
234 __array(u32
, fsid
, 6)
235 __string(auth_domain
, key
->ek_client
->name
)
239 __entry
->fsidtype
= key
->ek_fsidtype
;
240 memcpy(__entry
->fsid
, key
->ek_fsid
, 4*6);
241 __assign_str(auth_domain
, key
->ek_client
->name
);
242 __entry
->status
= status
;
244 TP_printk("fsid=%x::%s domain=%s status=%d",
246 __print_array(__entry
->fsid
, 6, 4),
247 __get_str(auth_domain
),
252 TRACE_EVENT(nfsd_expkey_update
,
253 TP_PROTO(const struct svc_expkey
*key
, const char *exp_path
),
254 TP_ARGS(key
, exp_path
),
256 __field(int, fsidtype
)
257 __array(u32
, fsid
, 6)
258 __string(auth_domain
, key
->ek_client
->name
)
259 __string(path
, exp_path
)
263 __entry
->fsidtype
= key
->ek_fsidtype
;
264 memcpy(__entry
->fsid
, key
->ek_fsid
, 4*6);
265 __assign_str(auth_domain
, key
->ek_client
->name
);
266 __assign_str(path
, exp_path
);
267 __entry
->cache
= !test_bit(CACHE_NEGATIVE
, &key
->h
.flags
);
269 TP_printk("fsid=%x::%s domain=%s path=%s cache=%s",
271 __print_array(__entry
->fsid
, 6, 4),
272 __get_str(auth_domain
),
274 __entry
->cache
? "pos" : "neg"
278 TRACE_EVENT(nfsd_exp_get_by_name
,
279 TP_PROTO(const struct svc_export
*key
,
281 TP_ARGS(key
, status
),
283 __string(path
, key
->ex_path
.dentry
->d_name
.name
)
284 __string(auth_domain
, key
->ex_client
->name
)
288 __assign_str(path
, key
->ex_path
.dentry
->d_name
.name
);
289 __assign_str(auth_domain
, key
->ex_client
->name
);
290 __entry
->status
= status
;
292 TP_printk("path=%s domain=%s status=%d",
294 __get_str(auth_domain
),
299 TRACE_EVENT(nfsd_export_update
,
300 TP_PROTO(const struct svc_export
*key
),
303 __string(path
, key
->ex_path
.dentry
->d_name
.name
)
304 __string(auth_domain
, key
->ex_client
->name
)
308 __assign_str(path
, key
->ex_path
.dentry
->d_name
.name
);
309 __assign_str(auth_domain
, key
->ex_client
->name
);
310 __entry
->cache
= !test_bit(CACHE_NEGATIVE
, &key
->h
.flags
);
312 TP_printk("path=%s domain=%s cache=%s",
314 __get_str(auth_domain
),
315 __entry
->cache
? "pos" : "neg"
319 DECLARE_EVENT_CLASS(nfsd_io_class
,
320 TP_PROTO(struct svc_rqst
*rqstp
,
324 TP_ARGS(rqstp
, fhp
, offset
, len
),
327 __field(u32
, fh_hash
)
328 __field(loff_t
, offset
)
329 __field(unsigned long, len
)
332 __entry
->xid
= be32_to_cpu(rqstp
->rq_xid
);
333 __entry
->fh_hash
= knfsd_fh_hash(&fhp
->fh_handle
);
334 __entry
->offset
= offset
;
337 TP_printk("xid=0x%08x fh_hash=0x%08x offset=%lld len=%lu",
338 __entry
->xid
, __entry
->fh_hash
,
339 __entry
->offset
, __entry
->len
)
342 #define DEFINE_NFSD_IO_EVENT(name) \
343 DEFINE_EVENT(nfsd_io_class, nfsd_##name, \
344 TP_PROTO(struct svc_rqst *rqstp, \
345 struct svc_fh *fhp, \
347 unsigned long len), \
348 TP_ARGS(rqstp, fhp, offset, len))
350 DEFINE_NFSD_IO_EVENT(read_start
);
351 DEFINE_NFSD_IO_EVENT(read_splice
);
352 DEFINE_NFSD_IO_EVENT(read_vector
);
353 DEFINE_NFSD_IO_EVENT(read_io_done
);
354 DEFINE_NFSD_IO_EVENT(read_done
);
355 DEFINE_NFSD_IO_EVENT(write_start
);
356 DEFINE_NFSD_IO_EVENT(write_opened
);
357 DEFINE_NFSD_IO_EVENT(write_io_done
);
358 DEFINE_NFSD_IO_EVENT(write_done
);
360 DECLARE_EVENT_CLASS(nfsd_err_class
,
361 TP_PROTO(struct svc_rqst
*rqstp
,
365 TP_ARGS(rqstp
, fhp
, offset
, status
),
368 __field(u32
, fh_hash
)
369 __field(loff_t
, offset
)
373 __entry
->xid
= be32_to_cpu(rqstp
->rq_xid
);
374 __entry
->fh_hash
= knfsd_fh_hash(&fhp
->fh_handle
);
375 __entry
->offset
= offset
;
376 __entry
->status
= status
;
378 TP_printk("xid=0x%08x fh_hash=0x%08x offset=%lld status=%d",
379 __entry
->xid
, __entry
->fh_hash
,
380 __entry
->offset
, __entry
->status
)
383 #define DEFINE_NFSD_ERR_EVENT(name) \
384 DEFINE_EVENT(nfsd_err_class, nfsd_##name, \
385 TP_PROTO(struct svc_rqst *rqstp, \
386 struct svc_fh *fhp, \
389 TP_ARGS(rqstp, fhp, offset, len))
391 DEFINE_NFSD_ERR_EVENT(read_err
);
392 DEFINE_NFSD_ERR_EVENT(write_err
);
395 #include "filecache.h"
398 DECLARE_EVENT_CLASS(nfsd_stateid_class
,
399 TP_PROTO(stateid_t
*stp
),
402 __field(u32
, cl_boot
)
405 __field(u32
, si_generation
)
408 __entry
->cl_boot
= stp
->si_opaque
.so_clid
.cl_boot
;
409 __entry
->cl_id
= stp
->si_opaque
.so_clid
.cl_id
;
410 __entry
->si_id
= stp
->si_opaque
.so_id
;
411 __entry
->si_generation
= stp
->si_generation
;
413 TP_printk("client %08x:%08x stateid %08x:%08x",
417 __entry
->si_generation
)
420 #define DEFINE_STATEID_EVENT(name) \
421 DEFINE_EVENT(nfsd_stateid_class, nfsd_##name, \
422 TP_PROTO(stateid_t *stp), \
425 DEFINE_STATEID_EVENT(layoutstate_alloc
);
426 DEFINE_STATEID_EVENT(layoutstate_unhash
);
427 DEFINE_STATEID_EVENT(layoutstate_free
);
428 DEFINE_STATEID_EVENT(layout_get_lookup_fail
);
429 DEFINE_STATEID_EVENT(layout_commit_lookup_fail
);
430 DEFINE_STATEID_EVENT(layout_return_lookup_fail
);
431 DEFINE_STATEID_EVENT(layout_recall
);
432 DEFINE_STATEID_EVENT(layout_recall_done
);
433 DEFINE_STATEID_EVENT(layout_recall_fail
);
434 DEFINE_STATEID_EVENT(layout_recall_release
);
436 DEFINE_STATEID_EVENT(open
);
437 DEFINE_STATEID_EVENT(deleg_read
);
438 DEFINE_STATEID_EVENT(deleg_break
);
439 DEFINE_STATEID_EVENT(deleg_recall
);
441 DECLARE_EVENT_CLASS(nfsd_stateseqid_class
,
442 TP_PROTO(u32 seqid
, const stateid_t
*stp
),
446 __field(u32
, cl_boot
)
449 __field(u32
, si_generation
)
452 __entry
->seqid
= seqid
;
453 __entry
->cl_boot
= stp
->si_opaque
.so_clid
.cl_boot
;
454 __entry
->cl_id
= stp
->si_opaque
.so_clid
.cl_id
;
455 __entry
->si_id
= stp
->si_opaque
.so_id
;
456 __entry
->si_generation
= stp
->si_generation
;
458 TP_printk("seqid=%u client %08x:%08x stateid %08x:%08x",
459 __entry
->seqid
, __entry
->cl_boot
, __entry
->cl_id
,
460 __entry
->si_id
, __entry
->si_generation
)
463 #define DEFINE_STATESEQID_EVENT(name) \
464 DEFINE_EVENT(nfsd_stateseqid_class, nfsd_##name, \
465 TP_PROTO(u32 seqid, const stateid_t *stp), \
468 DEFINE_STATESEQID_EVENT(preprocess
);
469 DEFINE_STATESEQID_EVENT(open_confirm
);
471 DECLARE_EVENT_CLASS(nfsd_clientid_class
,
472 TP_PROTO(const clientid_t
*clid
),
475 __field(u32
, cl_boot
)
479 __entry
->cl_boot
= clid
->cl_boot
;
480 __entry
->cl_id
= clid
->cl_id
;
482 TP_printk("client %08x:%08x", __entry
->cl_boot
, __entry
->cl_id
)
485 #define DEFINE_CLIENTID_EVENT(name) \
486 DEFINE_EVENT(nfsd_clientid_class, nfsd_clid_##name, \
487 TP_PROTO(const clientid_t *clid), \
490 DEFINE_CLIENTID_EVENT(expired
);
491 DEFINE_CLIENTID_EVENT(purged
);
492 DEFINE_CLIENTID_EVENT(renew
);
493 DEFINE_CLIENTID_EVENT(stale
);
495 DECLARE_EVENT_CLASS(nfsd_net_class
,
496 TP_PROTO(const struct nfsd_net
*nn
),
499 __field(unsigned long long, boot_time
)
502 __entry
->boot_time
= nn
->boot_time
;
504 TP_printk("boot_time=%16llx", __entry
->boot_time
)
507 #define DEFINE_NET_EVENT(name) \
508 DEFINE_EVENT(nfsd_net_class, nfsd_##name, \
509 TP_PROTO(const struct nfsd_net *nn), \
512 DEFINE_NET_EVENT(grace_start
);
513 DEFINE_NET_EVENT(grace_complete
);
515 DECLARE_EVENT_CLASS(nfsd_clid_class
,
516 TP_PROTO(const struct nfsd_net
*nn
,
517 unsigned int namelen
,
518 const unsigned char *namedata
),
519 TP_ARGS(nn
, namelen
, namedata
),
521 __field(unsigned long long, boot_time
)
522 __field(unsigned int, namelen
)
523 __dynamic_array(unsigned char, name
, namelen
)
526 __entry
->boot_time
= nn
->boot_time
;
527 __entry
->namelen
= namelen
;
528 memcpy(__get_dynamic_array(name
), namedata
, namelen
);
530 TP_printk("boot_time=%16llx nfs4_clientid=%.*s",
531 __entry
->boot_time
, __entry
->namelen
, __get_str(name
))
534 #define DEFINE_CLID_EVENT(name) \
535 DEFINE_EVENT(nfsd_clid_class, nfsd_clid_##name, \
536 TP_PROTO(const struct nfsd_net *nn, \
537 unsigned int namelen, \
538 const unsigned char *namedata), \
539 TP_ARGS(nn, namelen, namedata))
541 DEFINE_CLID_EVENT(find
);
542 DEFINE_CLID_EVENT(reclaim
);
544 TRACE_EVENT(nfsd_clid_inuse_err
,
545 TP_PROTO(const struct nfs4_client
*clp
),
548 __field(u32
, cl_boot
)
550 __array(unsigned char, addr
, sizeof(struct sockaddr_in6
))
551 __field(unsigned int, namelen
)
552 __dynamic_array(unsigned char, name
, clp
->cl_name
.len
)
555 __entry
->cl_boot
= clp
->cl_clientid
.cl_boot
;
556 __entry
->cl_id
= clp
->cl_clientid
.cl_id
;
557 memcpy(__entry
->addr
, &clp
->cl_addr
,
558 sizeof(struct sockaddr_in6
));
559 __entry
->namelen
= clp
->cl_name
.len
;
560 memcpy(__get_dynamic_array(name
), clp
->cl_name
.data
,
563 TP_printk("nfs4_clientid %.*s already in use by %pISpc, client %08x:%08x",
564 __entry
->namelen
, __get_str(name
), __entry
->addr
,
565 __entry
->cl_boot
, __entry
->cl_id
)
569 * from fs/nfsd/filecache.h
571 TRACE_DEFINE_ENUM(NFSD_FILE_HASHED
);
572 TRACE_DEFINE_ENUM(NFSD_FILE_PENDING
);
573 TRACE_DEFINE_ENUM(NFSD_FILE_BREAK_READ
);
574 TRACE_DEFINE_ENUM(NFSD_FILE_BREAK_WRITE
);
575 TRACE_DEFINE_ENUM(NFSD_FILE_REFERENCED
);
577 #define show_nf_flags(val) \
578 __print_flags(val, "|", \
579 { 1 << NFSD_FILE_HASHED, "HASHED" }, \
580 { 1 << NFSD_FILE_PENDING, "PENDING" }, \
581 { 1 << NFSD_FILE_BREAK_READ, "BREAK_READ" }, \
582 { 1 << NFSD_FILE_BREAK_WRITE, "BREAK_WRITE" }, \
583 { 1 << NFSD_FILE_REFERENCED, "REFERENCED"})
585 DECLARE_EVENT_CLASS(nfsd_file_class
,
586 TP_PROTO(struct nfsd_file
*nf
),
589 __field(unsigned int, nf_hashval
)
590 __field(void *, nf_inode
)
592 __field(unsigned long, nf_flags
)
593 __field(unsigned char, nf_may
)
594 __field(struct file
*, nf_file
)
597 __entry
->nf_hashval
= nf
->nf_hashval
;
598 __entry
->nf_inode
= nf
->nf_inode
;
599 __entry
->nf_ref
= refcount_read(&nf
->nf_ref
);
600 __entry
->nf_flags
= nf
->nf_flags
;
601 __entry
->nf_may
= nf
->nf_may
;
602 __entry
->nf_file
= nf
->nf_file
;
604 TP_printk("hash=0x%x inode=%p ref=%d flags=%s may=%s file=%p",
608 show_nf_flags(__entry
->nf_flags
),
609 show_nfsd_may_flags(__entry
->nf_may
),
613 #define DEFINE_NFSD_FILE_EVENT(name) \
614 DEFINE_EVENT(nfsd_file_class, name, \
615 TP_PROTO(struct nfsd_file *nf), \
618 DEFINE_NFSD_FILE_EVENT(nfsd_file_alloc
);
619 DEFINE_NFSD_FILE_EVENT(nfsd_file_put_final
);
620 DEFINE_NFSD_FILE_EVENT(nfsd_file_unhash
);
621 DEFINE_NFSD_FILE_EVENT(nfsd_file_put
);
622 DEFINE_NFSD_FILE_EVENT(nfsd_file_unhash_and_release_locked
);
624 TRACE_EVENT(nfsd_file_acquire
,
625 TP_PROTO(struct svc_rqst
*rqstp
, unsigned int hash
,
626 struct inode
*inode
, unsigned int may_flags
,
627 struct nfsd_file
*nf
, __be32 status
),
629 TP_ARGS(rqstp
, hash
, inode
, may_flags
, nf
, status
),
633 __field(unsigned int, hash
)
634 __field(void *, inode
)
635 __field(unsigned long, may_flags
)
637 __field(unsigned long, nf_flags
)
638 __field(unsigned long, nf_may
)
639 __field(struct file
*, nf_file
)
644 __entry
->xid
= be32_to_cpu(rqstp
->rq_xid
);
645 __entry
->hash
= hash
;
646 __entry
->inode
= inode
;
647 __entry
->may_flags
= may_flags
;
648 __entry
->nf_ref
= nf
? refcount_read(&nf
->nf_ref
) : 0;
649 __entry
->nf_flags
= nf
? nf
->nf_flags
: 0;
650 __entry
->nf_may
= nf
? nf
->nf_may
: 0;
651 __entry
->nf_file
= nf
? nf
->nf_file
: NULL
;
652 __entry
->status
= be32_to_cpu(status
);
655 TP_printk("xid=0x%x hash=0x%x inode=%p may_flags=%s ref=%d nf_flags=%s nf_may=%s nf_file=%p status=%u",
656 __entry
->xid
, __entry
->hash
, __entry
->inode
,
657 show_nfsd_may_flags(__entry
->may_flags
),
658 __entry
->nf_ref
, show_nf_flags(__entry
->nf_flags
),
659 show_nfsd_may_flags(__entry
->nf_may
),
660 __entry
->nf_file
, __entry
->status
)
663 DECLARE_EVENT_CLASS(nfsd_file_search_class
,
664 TP_PROTO(struct inode
*inode
, unsigned int hash
, int found
),
665 TP_ARGS(inode
, hash
, found
),
667 __field(struct inode
*, inode
)
668 __field(unsigned int, hash
)
672 __entry
->inode
= inode
;
673 __entry
->hash
= hash
;
674 __entry
->found
= found
;
676 TP_printk("hash=0x%x inode=%p found=%d", __entry
->hash
,
677 __entry
->inode
, __entry
->found
)
680 #define DEFINE_NFSD_FILE_SEARCH_EVENT(name) \
681 DEFINE_EVENT(nfsd_file_search_class, name, \
682 TP_PROTO(struct inode *inode, unsigned int hash, int found), \
683 TP_ARGS(inode, hash, found))
685 DEFINE_NFSD_FILE_SEARCH_EVENT(nfsd_file_close_inode_sync
);
686 DEFINE_NFSD_FILE_SEARCH_EVENT(nfsd_file_close_inode
);
687 DEFINE_NFSD_FILE_SEARCH_EVENT(nfsd_file_is_cached
);
689 TRACE_EVENT(nfsd_file_fsnotify_handle_event
,
690 TP_PROTO(struct inode
*inode
, u32 mask
),
691 TP_ARGS(inode
, mask
),
693 __field(struct inode
*, inode
)
694 __field(unsigned int, nlink
)
695 __field(umode_t
, mode
)
699 __entry
->inode
= inode
;
700 __entry
->nlink
= inode
->i_nlink
;
701 __entry
->mode
= inode
->i_mode
;
702 __entry
->mask
= mask
;
704 TP_printk("inode=%p nlink=%u mode=0%ho mask=0x%x", __entry
->inode
,
705 __entry
->nlink
, __entry
->mode
, __entry
->mask
)
710 TRACE_DEFINE_ENUM(RC_DROPIT
);
711 TRACE_DEFINE_ENUM(RC_REPLY
);
712 TRACE_DEFINE_ENUM(RC_DOIT
);
714 #define show_drc_retval(x) \
715 __print_symbolic(x, \
716 { RC_DROPIT, "DROPIT" }, \
717 { RC_REPLY, "REPLY" }, \
720 TRACE_EVENT(nfsd_drc_found
,
722 const struct nfsd_net
*nn
,
723 const struct svc_rqst
*rqstp
,
726 TP_ARGS(nn
, rqstp
, result
),
728 __field(unsigned long long, boot_time
)
729 __field(unsigned long, result
)
733 __entry
->boot_time
= nn
->boot_time
;
734 __entry
->result
= result
;
735 __entry
->xid
= be32_to_cpu(rqstp
->rq_xid
);
737 TP_printk("boot_time=%16llx xid=0x%08x result=%s",
738 __entry
->boot_time
, __entry
->xid
,
739 show_drc_retval(__entry
->result
))
743 TRACE_EVENT(nfsd_drc_mismatch
,
745 const struct nfsd_net
*nn
,
746 const struct svc_cacherep
*key
,
747 const struct svc_cacherep
*rp
749 TP_ARGS(nn
, key
, rp
),
751 __field(unsigned long long, boot_time
)
754 __field(u32
, ingress
)
757 __entry
->boot_time
= nn
->boot_time
;
758 __entry
->xid
= be32_to_cpu(key
->c_key
.k_xid
);
759 __entry
->cached
= (__force u32
)key
->c_key
.k_csum
;
760 __entry
->ingress
= (__force u32
)rp
->c_key
.k_csum
;
762 TP_printk("boot_time=%16llx xid=0x%08x cached-csum=0x%08x ingress-csum=0x%08x",
763 __entry
->boot_time
, __entry
->xid
, __entry
->cached
,
767 TRACE_EVENT(nfsd_cb_args
,
769 const struct nfs4_client
*clp
,
770 const struct nfs4_cb_conn
*conn
774 __field(u32
, cl_boot
)
778 __array(unsigned char, addr
, sizeof(struct sockaddr_in6
))
781 __entry
->cl_boot
= clp
->cl_clientid
.cl_boot
;
782 __entry
->cl_id
= clp
->cl_clientid
.cl_id
;
783 __entry
->prog
= conn
->cb_prog
;
784 __entry
->ident
= conn
->cb_ident
;
785 memcpy(__entry
->addr
, &conn
->cb_addr
,
786 sizeof(struct sockaddr_in6
));
788 TP_printk("client %08x:%08x callback addr=%pISpc prog=%u ident=%u",
789 __entry
->cl_boot
, __entry
->cl_id
,
790 __entry
->addr
, __entry
->prog
, __entry
->ident
)
793 TRACE_EVENT(nfsd_cb_nodelegs
,
794 TP_PROTO(const struct nfs4_client
*clp
),
797 __field(u32
, cl_boot
)
801 __entry
->cl_boot
= clp
->cl_clientid
.cl_boot
;
802 __entry
->cl_id
= clp
->cl_clientid
.cl_id
;
804 TP_printk("client %08x:%08x", __entry
->cl_boot
, __entry
->cl_id
)
807 TRACE_DEFINE_ENUM(NFSD4_CB_UP
);
808 TRACE_DEFINE_ENUM(NFSD4_CB_UNKNOWN
);
809 TRACE_DEFINE_ENUM(NFSD4_CB_DOWN
);
810 TRACE_DEFINE_ENUM(NFSD4_CB_FAULT
);
812 #define show_cb_state(val) \
813 __print_symbolic(val, \
814 { NFSD4_CB_UP, "UP" }, \
815 { NFSD4_CB_UNKNOWN, "UNKNOWN" }, \
816 { NFSD4_CB_DOWN, "DOWN" }, \
817 { NFSD4_CB_FAULT, "FAULT"})
819 DECLARE_EVENT_CLASS(nfsd_cb_class
,
820 TP_PROTO(const struct nfs4_client
*clp
),
823 __field(unsigned long, state
)
824 __field(u32
, cl_boot
)
826 __array(unsigned char, addr
, sizeof(struct sockaddr_in6
))
829 __entry
->state
= clp
->cl_cb_state
;
830 __entry
->cl_boot
= clp
->cl_clientid
.cl_boot
;
831 __entry
->cl_id
= clp
->cl_clientid
.cl_id
;
832 memcpy(__entry
->addr
, &clp
->cl_cb_conn
.cb_addr
,
833 sizeof(struct sockaddr_in6
));
835 TP_printk("addr=%pISpc client %08x:%08x state=%s",
836 __entry
->addr
, __entry
->cl_boot
, __entry
->cl_id
,
837 show_cb_state(__entry
->state
))
840 #define DEFINE_NFSD_CB_EVENT(name) \
841 DEFINE_EVENT(nfsd_cb_class, nfsd_cb_##name, \
842 TP_PROTO(const struct nfs4_client *clp), \
845 DEFINE_NFSD_CB_EVENT(setup
);
846 DEFINE_NFSD_CB_EVENT(state
);
847 DEFINE_NFSD_CB_EVENT(shutdown
);
849 TRACE_EVENT(nfsd_cb_setup_err
,
851 const struct nfs4_client
*clp
,
857 __field(u32
, cl_boot
)
859 __array(unsigned char, addr
, sizeof(struct sockaddr_in6
))
862 __entry
->error
= error
;
863 __entry
->cl_boot
= clp
->cl_clientid
.cl_boot
;
864 __entry
->cl_id
= clp
->cl_clientid
.cl_id
;
865 memcpy(__entry
->addr
, &clp
->cl_cb_conn
.cb_addr
,
866 sizeof(struct sockaddr_in6
));
868 TP_printk("addr=%pISpc client %08x:%08x error=%ld",
869 __entry
->addr
, __entry
->cl_boot
, __entry
->cl_id
, __entry
->error
)
872 TRACE_EVENT(nfsd_cb_work
,
874 const struct nfs4_client
*clp
,
875 const char *procedure
877 TP_ARGS(clp
, procedure
),
879 __field(u32
, cl_boot
)
881 __string(procedure
, procedure
)
882 __array(unsigned char, addr
, sizeof(struct sockaddr_in6
))
885 __entry
->cl_boot
= clp
->cl_clientid
.cl_boot
;
886 __entry
->cl_id
= clp
->cl_clientid
.cl_id
;
887 __assign_str(procedure
, procedure
)
888 memcpy(__entry
->addr
, &clp
->cl_cb_conn
.cb_addr
,
889 sizeof(struct sockaddr_in6
));
891 TP_printk("addr=%pISpc client %08x:%08x procedure=%s",
892 __entry
->addr
, __entry
->cl_boot
, __entry
->cl_id
,
893 __get_str(procedure
))
896 TRACE_EVENT(nfsd_cb_done
,
898 const struct nfs4_client
*clp
,
901 TP_ARGS(clp
, status
),
903 __field(u32
, cl_boot
)
906 __array(unsigned char, addr
, sizeof(struct sockaddr_in6
))
909 __entry
->cl_boot
= clp
->cl_clientid
.cl_boot
;
910 __entry
->cl_id
= clp
->cl_clientid
.cl_id
;
911 __entry
->status
= status
;
912 memcpy(__entry
->addr
, &clp
->cl_cb_conn
.cb_addr
,
913 sizeof(struct sockaddr_in6
));
915 TP_printk("addr=%pISpc client %08x:%08x status=%d",
916 __entry
->addr
, __entry
->cl_boot
, __entry
->cl_id
,
920 #endif /* _NFSD_TRACE_H */
922 #undef TRACE_INCLUDE_PATH
923 #define TRACE_INCLUDE_PATH .
924 #define TRACE_INCLUDE_FILE trace
925 #include <trace/define_trace.h>