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);
394 TRACE_EVENT(nfsd_dirent,
395 TP_PROTO(struct svc_fh *fhp,
399 TP_ARGS(fhp, ino, name, namlen),
401 __field(u32, fh_hash)
403 __string_len(name, name, namlen)
406 __entry->fh_hash = fhp ? knfsd_fh_hash(&fhp->fh_handle) : 0;
408 __assign_str_len(name, name, namlen)
410 TP_printk("fh_hash=0x%08x ino=%llu name=%s",
411 __entry->fh_hash, __entry->ino, __get_str(name)
416 #include "filecache.h"
419 DECLARE_EVENT_CLASS(nfsd_stateid_class,
420 TP_PROTO(stateid_t *stp),
423 __field(u32, cl_boot)
426 __field(u32, si_generation)
429 __entry->cl_boot = stp->si_opaque.so_clid.cl_boot;
430 __entry->cl_id = stp->si_opaque.so_clid.cl_id;
431 __entry->si_id = stp->si_opaque.so_id;
432 __entry->si_generation = stp->si_generation;
434 TP_printk("client %08x:%08x stateid %08x:%08x",
438 __entry->si_generation)
441 #define DEFINE_STATEID_EVENT(name) \
442 DEFINE_EVENT(nfsd_stateid_class, nfsd_##name, \
443 TP_PROTO(stateid_t *stp), \
446 DEFINE_STATEID_EVENT(layoutstate_alloc);
447 DEFINE_STATEID_EVENT(layoutstate_unhash);
448 DEFINE_STATEID_EVENT(layoutstate_free);
449 DEFINE_STATEID_EVENT(layout_get_lookup_fail);
450 DEFINE_STATEID_EVENT(layout_commit_lookup_fail);
451 DEFINE_STATEID_EVENT(layout_return_lookup_fail);
452 DEFINE_STATEID_EVENT(layout_recall);
453 DEFINE_STATEID_EVENT(layout_recall_done);
454 DEFINE_STATEID_EVENT(layout_recall_fail);
455 DEFINE_STATEID_EVENT(layout_recall_release);
457 DEFINE_STATEID_EVENT(open);
458 DEFINE_STATEID_EVENT(deleg_read);
459 DEFINE_STATEID_EVENT(deleg_recall);
461 DECLARE_EVENT_CLASS(nfsd_stateseqid_class,
462 TP_PROTO(u32 seqid, const stateid_t *stp),
466 __field(u32, cl_boot)
469 __field(u32, si_generation)
472 __entry->seqid = seqid;
473 __entry->cl_boot = stp->si_opaque.so_clid.cl_boot;
474 __entry->cl_id = stp->si_opaque.so_clid.cl_id;
475 __entry->si_id = stp->si_opaque.so_id;
476 __entry->si_generation = stp->si_generation;
478 TP_printk("seqid=%u client %08x:%08x stateid %08x:%08x",
479 __entry->seqid, __entry->cl_boot, __entry->cl_id,
480 __entry->si_id, __entry->si_generation)
483 #define DEFINE_STATESEQID_EVENT(name) \
484 DEFINE_EVENT(nfsd_stateseqid_class, nfsd_##name, \
485 TP_PROTO(u32 seqid, const stateid_t *stp), \
488 DEFINE_STATESEQID_EVENT(preprocess);
489 DEFINE_STATESEQID_EVENT(open_confirm);
491 DECLARE_EVENT_CLASS(nfsd_clientid_class,
492 TP_PROTO(const clientid_t *clid),
495 __field(u32, cl_boot)
499 __entry->cl_boot = clid->cl_boot;
500 __entry->cl_id = clid->cl_id;
502 TP_printk("client %08x:%08x", __entry->cl_boot, __entry->cl_id)
505 #define DEFINE_CLIENTID_EVENT(name) \
506 DEFINE_EVENT(nfsd_clientid_class, nfsd_clid_##name, \
507 TP_PROTO(const clientid_t *clid), \
510 DEFINE_CLIENTID_EVENT(expire_unconf);
511 DEFINE_CLIENTID_EVENT(reclaim_complete);
512 DEFINE_CLIENTID_EVENT(confirmed);
513 DEFINE_CLIENTID_EVENT(destroyed);
514 DEFINE_CLIENTID_EVENT(admin_expired);
515 DEFINE_CLIENTID_EVENT(replaced);
516 DEFINE_CLIENTID_EVENT(purged);
517 DEFINE_CLIENTID_EVENT(renew);
518 DEFINE_CLIENTID_EVENT(stale);
520 DECLARE_EVENT_CLASS(nfsd_net_class,
521 TP_PROTO(const struct nfsd_net *nn),
524 __field(unsigned long long, boot_time)
527 __entry->boot_time = nn->boot_time;
529 TP_printk("boot_time=%16llx", __entry->boot_time)
532 #define DEFINE_NET_EVENT(name) \
533 DEFINE_EVENT(nfsd_net_class, nfsd_##name, \
534 TP_PROTO(const struct nfsd_net *nn), \
537 DEFINE_NET_EVENT(grace_start);
538 DEFINE_NET_EVENT(grace_complete);
540 TRACE_EVENT(nfsd_clid_cred_mismatch,
542 const struct nfs4_client *clp,
543 const struct svc_rqst *rqstp
547 __field(u32, cl_boot)
549 __field(unsigned long, cl_flavor)
550 __field(unsigned long, new_flavor)
551 __array(unsigned char, addr, sizeof(struct sockaddr_in6))
554 __entry->cl_boot = clp->cl_clientid.cl_boot;
555 __entry->cl_id = clp->cl_clientid.cl_id;
556 __entry->cl_flavor = clp->cl_cred.cr_flavor;
557 __entry->new_flavor = rqstp->rq_cred.cr_flavor;
558 memcpy(__entry->addr, &rqstp->rq_xprt->xpt_remote,
559 sizeof(struct sockaddr_in6));
561 TP_printk("client %08x:%08x flavor=%s, conflict=%s from addr=%pISpc",
562 __entry->cl_boot, __entry->cl_id,
563 show_nfsd_authflavor(__entry->cl_flavor),
564 show_nfsd_authflavor(__entry->new_flavor), __entry->addr
568 TRACE_EVENT(nfsd_clid_verf_mismatch,
570 const struct nfs4_client *clp,
571 const struct svc_rqst *rqstp,
572 const nfs4_verifier *verf
574 TP_ARGS(clp, rqstp, verf),
576 __field(u32, cl_boot)
578 __array(unsigned char, cl_verifier, NFS4_VERIFIER_SIZE)
579 __array(unsigned char, new_verifier, NFS4_VERIFIER_SIZE)
580 __array(unsigned char, addr, sizeof(struct sockaddr_in6))
583 __entry->cl_boot = clp->cl_clientid.cl_boot;
584 __entry->cl_id = clp->cl_clientid.cl_id;
585 memcpy(__entry->cl_verifier, (void *)&clp->cl_verifier,
587 memcpy(__entry->new_verifier, (void *)verf,
589 memcpy(__entry->addr, &rqstp->rq_xprt->xpt_remote,
590 sizeof(struct sockaddr_in6));
592 TP_printk("client %08x:%08x verf=0x%s, updated=0x%s from addr=%pISpc",
593 __entry->cl_boot, __entry->cl_id,
594 __print_hex_str(__entry->cl_verifier, NFS4_VERIFIER_SIZE),
595 __print_hex_str(__entry->new_verifier, NFS4_VERIFIER_SIZE),
600 DECLARE_EVENT_CLASS(nfsd_clid_class,
601 TP_PROTO(const struct nfs4_client *clp),
604 __field(u32, cl_boot)
606 __array(unsigned char, addr, sizeof(struct sockaddr_in6))
607 __field(unsigned long, flavor)
608 __array(unsigned char, verifier, NFS4_VERIFIER_SIZE)
609 __string_len(name, name, clp->cl_name.len)
612 __entry->cl_boot = clp->cl_clientid.cl_boot;
613 __entry->cl_id = clp->cl_clientid.cl_id;
614 memcpy(__entry->addr, &clp->cl_addr,
615 sizeof(struct sockaddr_in6));
616 __entry->flavor = clp->cl_cred.cr_flavor;
617 memcpy(__entry->verifier, (void *)&clp->cl_verifier,
619 __assign_str_len(name, clp->cl_name.data, clp->cl_name.len);
621 TP_printk("addr=%pISpc name='%s' verifier=0x%s flavor=%s client=%08x:%08x",
622 __entry->addr, __get_str(name),
623 __print_hex_str(__entry->verifier, NFS4_VERIFIER_SIZE),
624 show_nfsd_authflavor(__entry->flavor),
625 __entry->cl_boot, __entry->cl_id)
628 #define DEFINE_CLID_EVENT(name) \
629 DEFINE_EVENT(nfsd_clid_class, nfsd_clid_##name, \
630 TP_PROTO(const struct nfs4_client *clp), \
633 DEFINE_CLID_EVENT(fresh);
634 DEFINE_CLID_EVENT(confirmed_r);
637 * from fs/nfsd/filecache.h
639 TRACE_DEFINE_ENUM(NFSD_FILE_HASHED);
640 TRACE_DEFINE_ENUM(NFSD_FILE_PENDING);
641 TRACE_DEFINE_ENUM(NFSD_FILE_BREAK_READ);
642 TRACE_DEFINE_ENUM(NFSD_FILE_BREAK_WRITE);
643 TRACE_DEFINE_ENUM(NFSD_FILE_REFERENCED);
645 #define show_nf_flags(val) \
646 __print_flags(val, "|", \
647 { 1 << NFSD_FILE_HASHED, "HASHED" }, \
648 { 1 << NFSD_FILE_PENDING, "PENDING" }, \
649 { 1 << NFSD_FILE_BREAK_READ, "BREAK_READ" }, \
650 { 1 << NFSD_FILE_BREAK_WRITE, "BREAK_WRITE" }, \
651 { 1 << NFSD_FILE_REFERENCED, "REFERENCED"})
653 DECLARE_EVENT_CLASS(nfsd_file_class,
654 TP_PROTO(struct nfsd_file *nf),
657 __field(unsigned int, nf_hashval)
658 __field(void *, nf_inode)
660 __field(unsigned long, nf_flags)
661 __field(unsigned char, nf_may)
662 __field(struct file *, nf_file)
665 __entry->nf_hashval = nf->nf_hashval;
666 __entry->nf_inode = nf->nf_inode;
667 __entry->nf_ref = refcount_read(&nf->nf_ref);
668 __entry->nf_flags = nf->nf_flags;
669 __entry->nf_may = nf->nf_may;
670 __entry->nf_file = nf->nf_file;
672 TP_printk("hash=0x%x inode=%p ref=%d flags=%s may=%s file=%p",
676 show_nf_flags(__entry->nf_flags),
677 show_nfsd_may_flags(__entry->nf_may),
681 #define DEFINE_NFSD_FILE_EVENT(name) \
682 DEFINE_EVENT(nfsd_file_class, name, \
683 TP_PROTO(struct nfsd_file *nf), \
686 DEFINE_NFSD_FILE_EVENT(nfsd_file_alloc);
687 DEFINE_NFSD_FILE_EVENT(nfsd_file_put_final);
688 DEFINE_NFSD_FILE_EVENT(nfsd_file_unhash);
689 DEFINE_NFSD_FILE_EVENT(nfsd_file_put);
690 DEFINE_NFSD_FILE_EVENT(nfsd_file_unhash_and_release_locked);
692 TRACE_EVENT(nfsd_file_acquire,
693 TP_PROTO(struct svc_rqst *rqstp, unsigned int hash,
694 struct inode *inode, unsigned int may_flags,
695 struct nfsd_file *nf, __be32 status),
697 TP_ARGS(rqstp, hash, inode, may_flags, nf, status),
701 __field(unsigned int, hash)
702 __field(void *, inode)
703 __field(unsigned long, may_flags)
705 __field(unsigned long, nf_flags)
706 __field(unsigned long, nf_may)
707 __field(struct file *, nf_file)
712 __entry->xid = be32_to_cpu(rqstp->rq_xid);
713 __entry->hash = hash;
714 __entry->inode = inode;
715 __entry->may_flags = may_flags;
716 __entry->nf_ref = nf ? refcount_read(&nf->nf_ref) : 0;
717 __entry->nf_flags = nf ? nf->nf_flags : 0;
718 __entry->nf_may = nf ? nf->nf_may : 0;
719 __entry->nf_file = nf ? nf->nf_file : NULL;
720 __entry->status = be32_to_cpu(status);
723 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",
724 __entry->xid, __entry->hash, __entry->inode,
725 show_nfsd_may_flags(__entry->may_flags),
726 __entry->nf_ref, show_nf_flags(__entry->nf_flags),
727 show_nfsd_may_flags(__entry->nf_may),
728 __entry->nf_file, __entry->status)
731 DECLARE_EVENT_CLASS(nfsd_file_search_class,
732 TP_PROTO(struct inode *inode, unsigned int hash, int found),
733 TP_ARGS(inode, hash, found),
735 __field(struct inode *, inode)
736 __field(unsigned int, hash)
740 __entry->inode = inode;
741 __entry->hash = hash;
742 __entry->found = found;
744 TP_printk("hash=0x%x inode=%p found=%d", __entry->hash,
745 __entry->inode, __entry->found)
748 #define DEFINE_NFSD_FILE_SEARCH_EVENT(name) \
749 DEFINE_EVENT(nfsd_file_search_class, name, \
750 TP_PROTO(struct inode *inode, unsigned int hash, int found), \
751 TP_ARGS(inode, hash, found))
753 DEFINE_NFSD_FILE_SEARCH_EVENT(nfsd_file_close_inode_sync);
754 DEFINE_NFSD_FILE_SEARCH_EVENT(nfsd_file_close_inode);
755 DEFINE_NFSD_FILE_SEARCH_EVENT(nfsd_file_is_cached);
757 TRACE_EVENT(nfsd_file_fsnotify_handle_event,
758 TP_PROTO(struct inode *inode, u32 mask),
759 TP_ARGS(inode, mask),
761 __field(struct inode *, inode)
762 __field(unsigned int, nlink)
763 __field(umode_t, mode)
767 __entry->inode = inode;
768 __entry->nlink = inode->i_nlink;
769 __entry->mode = inode->i_mode;
770 __entry->mask = mask;
772 TP_printk("inode=%p nlink=%u mode=0%ho mask=0x%x", __entry->inode,
773 __entry->nlink, __entry->mode, __entry->mask)
778 TRACE_DEFINE_ENUM(RC_DROPIT);
779 TRACE_DEFINE_ENUM(RC_REPLY);
780 TRACE_DEFINE_ENUM(RC_DOIT);
782 #define show_drc_retval(x) \
783 __print_symbolic(x, \
784 { RC_DROPIT, "DROPIT" }, \
785 { RC_REPLY, "REPLY" }, \
788 TRACE_EVENT(nfsd_drc_found,
790 const struct nfsd_net *nn,
791 const struct svc_rqst *rqstp,
794 TP_ARGS(nn, rqstp, result),
796 __field(unsigned long long, boot_time)
797 __field(unsigned long, result)
801 __entry->boot_time = nn->boot_time;
802 __entry->result = result;
803 __entry->xid = be32_to_cpu(rqstp->rq_xid);
805 TP_printk("boot_time=%16llx xid=0x%08x result=%s",
806 __entry->boot_time, __entry->xid,
807 show_drc_retval(__entry->result))
811 TRACE_EVENT(nfsd_drc_mismatch,
813 const struct nfsd_net *nn,
814 const struct svc_cacherep *key,
815 const struct svc_cacherep *rp
817 TP_ARGS(nn, key, rp),
819 __field(unsigned long long, boot_time)
822 __field(u32, ingress)
825 __entry->boot_time = nn->boot_time;
826 __entry->xid = be32_to_cpu(key->c_key.k_xid);
827 __entry->cached = (__force u32)key->c_key.k_csum;
828 __entry->ingress = (__force u32)rp->c_key.k_csum;
830 TP_printk("boot_time=%16llx xid=0x%08x cached-csum=0x%08x ingress-csum=0x%08x",
831 __entry->boot_time, __entry->xid, __entry->cached,
835 TRACE_EVENT(nfsd_cb_args,
837 const struct nfs4_client *clp,
838 const struct nfs4_cb_conn *conn
842 __field(u32, cl_boot)
846 __array(unsigned char, addr, sizeof(struct sockaddr_in6))
849 __entry->cl_boot = clp->cl_clientid.cl_boot;
850 __entry->cl_id = clp->cl_clientid.cl_id;
851 __entry->prog = conn->cb_prog;
852 __entry->ident = conn->cb_ident;
853 memcpy(__entry->addr, &conn->cb_addr,
854 sizeof(struct sockaddr_in6));
856 TP_printk("addr=%pISpc client %08x:%08x prog=%u ident=%u",
857 __entry->addr, __entry->cl_boot, __entry->cl_id,
858 __entry->prog, __entry->ident)
861 TRACE_EVENT(nfsd_cb_nodelegs,
862 TP_PROTO(const struct nfs4_client *clp),
865 __field(u32, cl_boot)
869 __entry->cl_boot = clp->cl_clientid.cl_boot;
870 __entry->cl_id = clp->cl_clientid.cl_id;
872 TP_printk("client %08x:%08x", __entry->cl_boot, __entry->cl_id)
875 #define show_cb_state(val) \
876 __print_symbolic(val, \
877 { NFSD4_CB_UP, "UP" }, \
878 { NFSD4_CB_UNKNOWN, "UNKNOWN" }, \
879 { NFSD4_CB_DOWN, "DOWN" }, \
880 { NFSD4_CB_FAULT, "FAULT"})
882 DECLARE_EVENT_CLASS(nfsd_cb_class,
883 TP_PROTO(const struct nfs4_client *clp),
886 __field(unsigned long, state)
887 __field(u32, cl_boot)
889 __array(unsigned char, addr, sizeof(struct sockaddr_in6))
892 __entry->state = clp->cl_cb_state;
893 __entry->cl_boot = clp->cl_clientid.cl_boot;
894 __entry->cl_id = clp->cl_clientid.cl_id;
895 memcpy(__entry->addr, &clp->cl_cb_conn.cb_addr,
896 sizeof(struct sockaddr_in6));
898 TP_printk("addr=%pISpc client %08x:%08x state=%s",
899 __entry->addr, __entry->cl_boot, __entry->cl_id,
900 show_cb_state(__entry->state))
903 #define DEFINE_NFSD_CB_EVENT(name) \
904 DEFINE_EVENT(nfsd_cb_class, nfsd_cb_##name, \
905 TP_PROTO(const struct nfs4_client *clp), \
908 DEFINE_NFSD_CB_EVENT(state);
909 DEFINE_NFSD_CB_EVENT(probe);
910 DEFINE_NFSD_CB_EVENT(lost);
911 DEFINE_NFSD_CB_EVENT(shutdown);
913 TRACE_DEFINE_ENUM(RPC_AUTH_NULL);
914 TRACE_DEFINE_ENUM(RPC_AUTH_UNIX);
915 TRACE_DEFINE_ENUM(RPC_AUTH_GSS);
916 TRACE_DEFINE_ENUM(RPC_AUTH_GSS_KRB5);
917 TRACE_DEFINE_ENUM(RPC_AUTH_GSS_KRB5I);
918 TRACE_DEFINE_ENUM(RPC_AUTH_GSS_KRB5P);
920 #define show_nfsd_authflavor(val) \
921 __print_symbolic(val, \
922 { RPC_AUTH_NULL, "none" }, \
923 { RPC_AUTH_UNIX, "sys" }, \
924 { RPC_AUTH_GSS, "gss" }, \
925 { RPC_AUTH_GSS_KRB5, "krb5" }, \
926 { RPC_AUTH_GSS_KRB5I, "krb5i" }, \
927 { RPC_AUTH_GSS_KRB5P, "krb5p" })
929 TRACE_EVENT(nfsd_cb_setup,
930 TP_PROTO(const struct nfs4_client *clp,
932 rpc_authflavor_t authflavor
934 TP_ARGS(clp, netid, authflavor),
936 __field(u32, cl_boot)
938 __field(unsigned long, authflavor)
939 __array(unsigned char, addr, sizeof(struct sockaddr_in6))
940 __array(unsigned char, netid, 8)
943 __entry->cl_boot = clp->cl_clientid.cl_boot;
944 __entry->cl_id = clp->cl_clientid.cl_id;
945 strlcpy(__entry->netid, netid, sizeof(__entry->netid));
946 __entry->authflavor = authflavor;
947 memcpy(__entry->addr, &clp->cl_cb_conn.cb_addr,
948 sizeof(struct sockaddr_in6));
950 TP_printk("addr=%pISpc client %08x:%08x proto=%s flavor=%s",
951 __entry->addr, __entry->cl_boot, __entry->cl_id,
952 __entry->netid, show_nfsd_authflavor(__entry->authflavor))
955 TRACE_EVENT(nfsd_cb_setup_err,
957 const struct nfs4_client *clp,
963 __field(u32, cl_boot)
965 __array(unsigned char, addr, sizeof(struct sockaddr_in6))
968 __entry->error = error;
969 __entry->cl_boot = clp->cl_clientid.cl_boot;
970 __entry->cl_id = clp->cl_clientid.cl_id;
971 memcpy(__entry->addr, &clp->cl_cb_conn.cb_addr,
972 sizeof(struct sockaddr_in6));
974 TP_printk("addr=%pISpc client %08x:%08x error=%ld",
975 __entry->addr, __entry->cl_boot, __entry->cl_id, __entry->error)
978 TRACE_EVENT(nfsd_cb_recall,
980 const struct nfs4_stid *stid
984 __field(u32, cl_boot)
987 __field(u32, si_generation)
988 __array(unsigned char, addr, sizeof(struct sockaddr_in6))
991 const stateid_t *stp = &stid->sc_stateid;
992 const struct nfs4_client *clp = stid->sc_client;
994 __entry->cl_boot = stp->si_opaque.so_clid.cl_boot;
995 __entry->cl_id = stp->si_opaque.so_clid.cl_id;
996 __entry->si_id = stp->si_opaque.so_id;
997 __entry->si_generation = stp->si_generation;
999 memcpy(__entry->addr, &clp->cl_cb_conn.cb_addr,
1000 sizeof(struct sockaddr_in6));
1002 memset(__entry->addr, 0, sizeof(struct sockaddr_in6));
1004 TP_printk("addr=%pISpc client %08x:%08x stateid %08x:%08x",
1005 __entry->addr, __entry->cl_boot, __entry->cl_id,
1006 __entry->si_id, __entry->si_generation)
1009 TRACE_EVENT(nfsd_cb_notify_lock,
1011 const struct nfs4_lockowner *lo,
1012 const struct nfsd4_blocked_lock *nbl
1016 __field(u32, cl_boot)
1018 __field(u32, fh_hash)
1019 __array(unsigned char, addr, sizeof(struct sockaddr_in6))
1022 const struct nfs4_client *clp = lo->lo_owner.so_client;
1024 __entry->cl_boot = clp->cl_clientid.cl_boot;
1025 __entry->cl_id = clp->cl_clientid.cl_id;
1026 __entry->fh_hash = knfsd_fh_hash(&nbl->nbl_fh);
1027 memcpy(__entry->addr, &clp->cl_cb_conn.cb_addr,
1028 sizeof(struct sockaddr_in6));
1030 TP_printk("addr=%pISpc client %08x:%08x fh_hash=0x%08x",
1031 __entry->addr, __entry->cl_boot, __entry->cl_id,
1035 TRACE_EVENT(nfsd_cb_offload,
1037 const struct nfs4_client *clp,
1038 const stateid_t *stp,
1039 const struct knfsd_fh *fh,
1043 TP_ARGS(clp, stp, fh, count, status),
1045 __field(u32, cl_boot)
1048 __field(u32, si_generation)
1049 __field(u32, fh_hash)
1050 __field(int, status)
1052 __array(unsigned char, addr, sizeof(struct sockaddr_in6))
1055 __entry->cl_boot = stp->si_opaque.so_clid.cl_boot;
1056 __entry->cl_id = stp->si_opaque.so_clid.cl_id;
1057 __entry->si_id = stp->si_opaque.so_id;
1058 __entry->si_generation = stp->si_generation;
1059 __entry->fh_hash = knfsd_fh_hash(fh);
1060 __entry->status = be32_to_cpu(status);
1061 __entry->count = count;
1062 memcpy(__entry->addr, &clp->cl_cb_conn.cb_addr,
1063 sizeof(struct sockaddr_in6));
1065 TP_printk("addr=%pISpc client %08x:%08x stateid %08x:%08x fh_hash=0x%08x count=%llu status=%d",
1066 __entry->addr, __entry->cl_boot, __entry->cl_id,
1067 __entry->si_id, __entry->si_generation,
1068 __entry->fh_hash, __entry->count, __entry->status)
1071 #endif /* _NFSD_TRACE_H */
1073 #undef TRACE_INCLUDE_PATH
1074 #define TRACE_INCLUDE_PATH .
1075 #define TRACE_INCLUDE_FILE trace
1076 #include <trace/define_trace.h>