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 TRACE_EVENT(nfsd_compound
,
16 TP_PROTO(const struct svc_rqst
*rqst
,
18 TP_ARGS(rqst
, args_opcnt
),
21 __field(u32
, args_opcnt
)
24 __entry
->xid
= be32_to_cpu(rqst
->rq_xid
);
25 __entry
->args_opcnt
= args_opcnt
;
27 TP_printk("xid=0x%08x opcnt=%u",
28 __entry
->xid
, __entry
->args_opcnt
)
31 TRACE_EVENT(nfsd_compound_status
,
32 TP_PROTO(u32 args_opcnt
,
36 TP_ARGS(args_opcnt
, resp_opcnt
, status
, name
),
38 __field(u32
, args_opcnt
)
39 __field(u32
, resp_opcnt
)
44 __entry
->args_opcnt
= args_opcnt
;
45 __entry
->resp_opcnt
= resp_opcnt
;
46 __entry
->status
= be32_to_cpu(status
);
47 __assign_str(name
, name
);
49 TP_printk("op=%u/%u %s status=%d",
50 __entry
->resp_opcnt
, __entry
->args_opcnt
,
51 __get_str(name
), __entry
->status
)
54 DECLARE_EVENT_CLASS(nfsd_fh_err_class
,
55 TP_PROTO(struct svc_rqst
*rqstp
,
58 TP_ARGS(rqstp
, fhp
, status
),
65 __entry
->xid
= be32_to_cpu(rqstp
->rq_xid
);
66 __entry
->fh_hash
= knfsd_fh_hash(&fhp
->fh_handle
);
67 __entry
->status
= status
;
69 TP_printk("xid=0x%08x fh_hash=0x%08x status=%d",
70 __entry
->xid
, __entry
->fh_hash
,
74 #define DEFINE_NFSD_FH_ERR_EVENT(name) \
75 DEFINE_EVENT(nfsd_fh_err_class, nfsd_##name, \
76 TP_PROTO(struct svc_rqst *rqstp, \
79 TP_ARGS(rqstp, fhp, status))
81 DEFINE_NFSD_FH_ERR_EVENT(set_fh_dentry_badexport
);
82 DEFINE_NFSD_FH_ERR_EVENT(set_fh_dentry_badhandle
);
84 TRACE_EVENT(nfsd_exp_find_key
,
85 TP_PROTO(const struct svc_expkey
*key
,
89 __field(int, fsidtype
)
91 __string(auth_domain
, key
->ek_client
->name
)
95 __entry
->fsidtype
= key
->ek_fsidtype
;
96 memcpy(__entry
->fsid
, key
->ek_fsid
, 4*6);
97 __assign_str(auth_domain
, key
->ek_client
->name
);
98 __entry
->status
= status
;
100 TP_printk("fsid=%x::%s domain=%s status=%d",
102 __print_array(__entry
->fsid
, 6, 4),
103 __get_str(auth_domain
),
108 TRACE_EVENT(nfsd_expkey_update
,
109 TP_PROTO(const struct svc_expkey
*key
, const char *exp_path
),
110 TP_ARGS(key
, exp_path
),
112 __field(int, fsidtype
)
113 __array(u32
, fsid
, 6)
114 __string(auth_domain
, key
->ek_client
->name
)
115 __string(path
, exp_path
)
119 __entry
->fsidtype
= key
->ek_fsidtype
;
120 memcpy(__entry
->fsid
, key
->ek_fsid
, 4*6);
121 __assign_str(auth_domain
, key
->ek_client
->name
);
122 __assign_str(path
, exp_path
);
123 __entry
->cache
= !test_bit(CACHE_NEGATIVE
, &key
->h
.flags
);
125 TP_printk("fsid=%x::%s domain=%s path=%s cache=%s",
127 __print_array(__entry
->fsid
, 6, 4),
128 __get_str(auth_domain
),
130 __entry
->cache
? "pos" : "neg"
134 TRACE_EVENT(nfsd_exp_get_by_name
,
135 TP_PROTO(const struct svc_export
*key
,
137 TP_ARGS(key
, status
),
139 __string(path
, key
->ex_path
.dentry
->d_name
.name
)
140 __string(auth_domain
, key
->ex_client
->name
)
144 __assign_str(path
, key
->ex_path
.dentry
->d_name
.name
);
145 __assign_str(auth_domain
, key
->ex_client
->name
);
146 __entry
->status
= status
;
148 TP_printk("path=%s domain=%s status=%d",
150 __get_str(auth_domain
),
155 TRACE_EVENT(nfsd_export_update
,
156 TP_PROTO(const struct svc_export
*key
),
159 __string(path
, key
->ex_path
.dentry
->d_name
.name
)
160 __string(auth_domain
, key
->ex_client
->name
)
164 __assign_str(path
, key
->ex_path
.dentry
->d_name
.name
);
165 __assign_str(auth_domain
, key
->ex_client
->name
);
166 __entry
->cache
= !test_bit(CACHE_NEGATIVE
, &key
->h
.flags
);
168 TP_printk("path=%s domain=%s cache=%s",
170 __get_str(auth_domain
),
171 __entry
->cache
? "pos" : "neg"
175 DECLARE_EVENT_CLASS(nfsd_io_class
,
176 TP_PROTO(struct svc_rqst
*rqstp
,
180 TP_ARGS(rqstp
, fhp
, offset
, len
),
183 __field(u32
, fh_hash
)
184 __field(loff_t
, offset
)
185 __field(unsigned long, len
)
188 __entry
->xid
= be32_to_cpu(rqstp
->rq_xid
);
189 __entry
->fh_hash
= knfsd_fh_hash(&fhp
->fh_handle
);
190 __entry
->offset
= offset
;
193 TP_printk("xid=0x%08x fh_hash=0x%08x offset=%lld len=%lu",
194 __entry
->xid
, __entry
->fh_hash
,
195 __entry
->offset
, __entry
->len
)
198 #define DEFINE_NFSD_IO_EVENT(name) \
199 DEFINE_EVENT(nfsd_io_class, nfsd_##name, \
200 TP_PROTO(struct svc_rqst *rqstp, \
201 struct svc_fh *fhp, \
203 unsigned long len), \
204 TP_ARGS(rqstp, fhp, offset, len))
206 DEFINE_NFSD_IO_EVENT(read_start
);
207 DEFINE_NFSD_IO_EVENT(read_splice
);
208 DEFINE_NFSD_IO_EVENT(read_vector
);
209 DEFINE_NFSD_IO_EVENT(read_io_done
);
210 DEFINE_NFSD_IO_EVENT(read_done
);
211 DEFINE_NFSD_IO_EVENT(write_start
);
212 DEFINE_NFSD_IO_EVENT(write_opened
);
213 DEFINE_NFSD_IO_EVENT(write_io_done
);
214 DEFINE_NFSD_IO_EVENT(write_done
);
216 DECLARE_EVENT_CLASS(nfsd_err_class
,
217 TP_PROTO(struct svc_rqst
*rqstp
,
221 TP_ARGS(rqstp
, fhp
, offset
, status
),
224 __field(u32
, fh_hash
)
225 __field(loff_t
, offset
)
229 __entry
->xid
= be32_to_cpu(rqstp
->rq_xid
);
230 __entry
->fh_hash
= knfsd_fh_hash(&fhp
->fh_handle
);
231 __entry
->offset
= offset
;
232 __entry
->status
= status
;
234 TP_printk("xid=0x%08x fh_hash=0x%08x offset=%lld status=%d",
235 __entry
->xid
, __entry
->fh_hash
,
236 __entry
->offset
, __entry
->status
)
239 #define DEFINE_NFSD_ERR_EVENT(name) \
240 DEFINE_EVENT(nfsd_err_class, nfsd_##name, \
241 TP_PROTO(struct svc_rqst *rqstp, \
242 struct svc_fh *fhp, \
245 TP_ARGS(rqstp, fhp, offset, len))
247 DEFINE_NFSD_ERR_EVENT(read_err
);
248 DEFINE_NFSD_ERR_EVENT(write_err
);
251 #include "filecache.h"
254 DECLARE_EVENT_CLASS(nfsd_stateid_class
,
255 TP_PROTO(stateid_t
*stp
),
258 __field(u32
, cl_boot
)
261 __field(u32
, si_generation
)
264 __entry
->cl_boot
= stp
->si_opaque
.so_clid
.cl_boot
;
265 __entry
->cl_id
= stp
->si_opaque
.so_clid
.cl_id
;
266 __entry
->si_id
= stp
->si_opaque
.so_id
;
267 __entry
->si_generation
= stp
->si_generation
;
269 TP_printk("client %08x:%08x stateid %08x:%08x",
273 __entry
->si_generation
)
276 #define DEFINE_STATEID_EVENT(name) \
277 DEFINE_EVENT(nfsd_stateid_class, nfsd_##name, \
278 TP_PROTO(stateid_t *stp), \
281 DEFINE_STATEID_EVENT(layoutstate_alloc
);
282 DEFINE_STATEID_EVENT(layoutstate_unhash
);
283 DEFINE_STATEID_EVENT(layoutstate_free
);
284 DEFINE_STATEID_EVENT(layout_get_lookup_fail
);
285 DEFINE_STATEID_EVENT(layout_commit_lookup_fail
);
286 DEFINE_STATEID_EVENT(layout_return_lookup_fail
);
287 DEFINE_STATEID_EVENT(layout_recall
);
288 DEFINE_STATEID_EVENT(layout_recall_done
);
289 DEFINE_STATEID_EVENT(layout_recall_fail
);
290 DEFINE_STATEID_EVENT(layout_recall_release
);
292 DEFINE_STATEID_EVENT(deleg_open
);
293 DEFINE_STATEID_EVENT(deleg_none
);
294 DEFINE_STATEID_EVENT(deleg_break
);
295 DEFINE_STATEID_EVENT(deleg_recall
);
297 DECLARE_EVENT_CLASS(nfsd_stateseqid_class
,
298 TP_PROTO(u32 seqid
, const stateid_t
*stp
),
302 __field(u32
, cl_boot
)
305 __field(u32
, si_generation
)
308 __entry
->seqid
= seqid
;
309 __entry
->cl_boot
= stp
->si_opaque
.so_clid
.cl_boot
;
310 __entry
->cl_id
= stp
->si_opaque
.so_clid
.cl_id
;
311 __entry
->si_id
= stp
->si_opaque
.so_id
;
312 __entry
->si_generation
= stp
->si_generation
;
314 TP_printk("seqid=%u client %08x:%08x stateid %08x:%08x",
315 __entry
->seqid
, __entry
->cl_boot
, __entry
->cl_id
,
316 __entry
->si_id
, __entry
->si_generation
)
319 #define DEFINE_STATESEQID_EVENT(name) \
320 DEFINE_EVENT(nfsd_stateseqid_class, nfsd_##name, \
321 TP_PROTO(u32 seqid, const stateid_t *stp), \
324 DEFINE_STATESEQID_EVENT(preprocess
);
325 DEFINE_STATESEQID_EVENT(open_confirm
);
327 DECLARE_EVENT_CLASS(nfsd_clientid_class
,
328 TP_PROTO(const clientid_t
*clid
),
331 __field(u32
, cl_boot
)
335 __entry
->cl_boot
= clid
->cl_boot
;
336 __entry
->cl_id
= clid
->cl_id
;
338 TP_printk("client %08x:%08x", __entry
->cl_boot
, __entry
->cl_id
)
341 #define DEFINE_CLIENTID_EVENT(name) \
342 DEFINE_EVENT(nfsd_clientid_class, nfsd_clid_##name, \
343 TP_PROTO(const clientid_t *clid), \
346 DEFINE_CLIENTID_EVENT(expired
);
347 DEFINE_CLIENTID_EVENT(purged
);
348 DEFINE_CLIENTID_EVENT(renew
);
349 DEFINE_CLIENTID_EVENT(stale
);
351 DECLARE_EVENT_CLASS(nfsd_net_class
,
352 TP_PROTO(const struct nfsd_net
*nn
),
355 __field(unsigned long long, boot_time
)
358 __entry
->boot_time
= nn
->boot_time
;
360 TP_printk("boot_time=%16llx", __entry
->boot_time
)
363 #define DEFINE_NET_EVENT(name) \
364 DEFINE_EVENT(nfsd_net_class, nfsd_##name, \
365 TP_PROTO(const struct nfsd_net *nn), \
368 DEFINE_NET_EVENT(grace_start
);
369 DEFINE_NET_EVENT(grace_complete
);
371 DECLARE_EVENT_CLASS(nfsd_clid_class
,
372 TP_PROTO(const struct nfsd_net
*nn
,
373 unsigned int namelen
,
374 const unsigned char *namedata
),
375 TP_ARGS(nn
, namelen
, namedata
),
377 __field(unsigned long long, boot_time
)
378 __field(unsigned int, namelen
)
379 __dynamic_array(unsigned char, name
, namelen
)
382 __entry
->boot_time
= nn
->boot_time
;
383 __entry
->namelen
= namelen
;
384 memcpy(__get_dynamic_array(name
), namedata
, namelen
);
386 TP_printk("boot_time=%16llx nfs4_clientid=%.*s",
387 __entry
->boot_time
, __entry
->namelen
, __get_str(name
))
390 #define DEFINE_CLID_EVENT(name) \
391 DEFINE_EVENT(nfsd_clid_class, nfsd_clid_##name, \
392 TP_PROTO(const struct nfsd_net *nn, \
393 unsigned int namelen, \
394 const unsigned char *namedata), \
395 TP_ARGS(nn, namelen, namedata))
397 DEFINE_CLID_EVENT(find
);
398 DEFINE_CLID_EVENT(reclaim
);
400 TRACE_EVENT(nfsd_clid_inuse_err
,
401 TP_PROTO(const struct nfs4_client
*clp
),
404 __field(u32
, cl_boot
)
406 __array(unsigned char, addr
, sizeof(struct sockaddr_in6
))
407 __field(unsigned int, namelen
)
408 __dynamic_array(unsigned char, name
, clp
->cl_name
.len
)
411 __entry
->cl_boot
= clp
->cl_clientid
.cl_boot
;
412 __entry
->cl_id
= clp
->cl_clientid
.cl_id
;
413 memcpy(__entry
->addr
, &clp
->cl_addr
,
414 sizeof(struct sockaddr_in6
));
415 __entry
->namelen
= clp
->cl_name
.len
;
416 memcpy(__get_dynamic_array(name
), clp
->cl_name
.data
,
419 TP_printk("nfs4_clientid %.*s already in use by %pISpc, client %08x:%08x",
420 __entry
->namelen
, __get_str(name
), __entry
->addr
,
421 __entry
->cl_boot
, __entry
->cl_id
)
424 TRACE_DEFINE_ENUM(NFSD_FILE_HASHED
);
425 TRACE_DEFINE_ENUM(NFSD_FILE_PENDING
);
426 TRACE_DEFINE_ENUM(NFSD_FILE_BREAK_READ
);
427 TRACE_DEFINE_ENUM(NFSD_FILE_BREAK_WRITE
);
428 TRACE_DEFINE_ENUM(NFSD_FILE_REFERENCED
);
430 #define show_nf_flags(val) \
431 __print_flags(val, "|", \
432 { 1 << NFSD_FILE_HASHED, "HASHED" }, \
433 { 1 << NFSD_FILE_PENDING, "PENDING" }, \
434 { 1 << NFSD_FILE_BREAK_READ, "BREAK_READ" }, \
435 { 1 << NFSD_FILE_BREAK_WRITE, "BREAK_WRITE" }, \
436 { 1 << NFSD_FILE_REFERENCED, "REFERENCED"})
438 /* FIXME: This should probably be fleshed out in the future. */
439 #define show_nf_may(val) \
440 __print_flags(val, "|", \
441 { NFSD_MAY_READ, "READ" }, \
442 { NFSD_MAY_WRITE, "WRITE" }, \
443 { NFSD_MAY_NOT_BREAK_LEASE, "NOT_BREAK_LEASE" })
445 DECLARE_EVENT_CLASS(nfsd_file_class
,
446 TP_PROTO(struct nfsd_file
*nf
),
449 __field(unsigned int, nf_hashval
)
450 __field(void *, nf_inode
)
452 __field(unsigned long, nf_flags
)
453 __field(unsigned char, nf_may
)
454 __field(struct file
*, nf_file
)
457 __entry
->nf_hashval
= nf
->nf_hashval
;
458 __entry
->nf_inode
= nf
->nf_inode
;
459 __entry
->nf_ref
= refcount_read(&nf
->nf_ref
);
460 __entry
->nf_flags
= nf
->nf_flags
;
461 __entry
->nf_may
= nf
->nf_may
;
462 __entry
->nf_file
= nf
->nf_file
;
464 TP_printk("hash=0x%x inode=0x%p ref=%d flags=%s may=%s file=%p",
468 show_nf_flags(__entry
->nf_flags
),
469 show_nf_may(__entry
->nf_may
),
473 #define DEFINE_NFSD_FILE_EVENT(name) \
474 DEFINE_EVENT(nfsd_file_class, name, \
475 TP_PROTO(struct nfsd_file *nf), \
478 DEFINE_NFSD_FILE_EVENT(nfsd_file_alloc
);
479 DEFINE_NFSD_FILE_EVENT(nfsd_file_put_final
);
480 DEFINE_NFSD_FILE_EVENT(nfsd_file_unhash
);
481 DEFINE_NFSD_FILE_EVENT(nfsd_file_put
);
482 DEFINE_NFSD_FILE_EVENT(nfsd_file_unhash_and_release_locked
);
484 TRACE_EVENT(nfsd_file_acquire
,
485 TP_PROTO(struct svc_rqst
*rqstp
, unsigned int hash
,
486 struct inode
*inode
, unsigned int may_flags
,
487 struct nfsd_file
*nf
, __be32 status
),
489 TP_ARGS(rqstp
, hash
, inode
, may_flags
, nf
, status
),
493 __field(unsigned int, hash
)
494 __field(void *, inode
)
495 __field(unsigned int, may_flags
)
497 __field(unsigned long, nf_flags
)
498 __field(unsigned char, nf_may
)
499 __field(struct file
*, nf_file
)
504 __entry
->xid
= be32_to_cpu(rqstp
->rq_xid
);
505 __entry
->hash
= hash
;
506 __entry
->inode
= inode
;
507 __entry
->may_flags
= may_flags
;
508 __entry
->nf_ref
= nf
? refcount_read(&nf
->nf_ref
) : 0;
509 __entry
->nf_flags
= nf
? nf
->nf_flags
: 0;
510 __entry
->nf_may
= nf
? nf
->nf_may
: 0;
511 __entry
->nf_file
= nf
? nf
->nf_file
: NULL
;
512 __entry
->status
= be32_to_cpu(status
);
515 TP_printk("xid=0x%x hash=0x%x inode=0x%p may_flags=%s ref=%d nf_flags=%s nf_may=%s nf_file=0x%p status=%u",
516 __entry
->xid
, __entry
->hash
, __entry
->inode
,
517 show_nf_may(__entry
->may_flags
), __entry
->nf_ref
,
518 show_nf_flags(__entry
->nf_flags
),
519 show_nf_may(__entry
->nf_may
), __entry
->nf_file
,
523 DECLARE_EVENT_CLASS(nfsd_file_search_class
,
524 TP_PROTO(struct inode
*inode
, unsigned int hash
, int found
),
525 TP_ARGS(inode
, hash
, found
),
527 __field(struct inode
*, inode
)
528 __field(unsigned int, hash
)
532 __entry
->inode
= inode
;
533 __entry
->hash
= hash
;
534 __entry
->found
= found
;
536 TP_printk("hash=0x%x inode=0x%p found=%d", __entry
->hash
,
537 __entry
->inode
, __entry
->found
)
540 #define DEFINE_NFSD_FILE_SEARCH_EVENT(name) \
541 DEFINE_EVENT(nfsd_file_search_class, name, \
542 TP_PROTO(struct inode *inode, unsigned int hash, int found), \
543 TP_ARGS(inode, hash, found))
545 DEFINE_NFSD_FILE_SEARCH_EVENT(nfsd_file_close_inode_sync
);
546 DEFINE_NFSD_FILE_SEARCH_EVENT(nfsd_file_close_inode
);
547 DEFINE_NFSD_FILE_SEARCH_EVENT(nfsd_file_is_cached
);
549 TRACE_EVENT(nfsd_file_fsnotify_handle_event
,
550 TP_PROTO(struct inode
*inode
, u32 mask
),
551 TP_ARGS(inode
, mask
),
553 __field(struct inode
*, inode
)
554 __field(unsigned int, nlink
)
555 __field(umode_t
, mode
)
559 __entry
->inode
= inode
;
560 __entry
->nlink
= inode
->i_nlink
;
561 __entry
->mode
= inode
->i_mode
;
562 __entry
->mask
= mask
;
564 TP_printk("inode=0x%p nlink=%u mode=0%ho mask=0x%x", __entry
->inode
,
565 __entry
->nlink
, __entry
->mode
, __entry
->mask
)
570 TRACE_DEFINE_ENUM(RC_DROPIT
);
571 TRACE_DEFINE_ENUM(RC_REPLY
);
572 TRACE_DEFINE_ENUM(RC_DOIT
);
574 #define show_drc_retval(x) \
575 __print_symbolic(x, \
576 { RC_DROPIT, "DROPIT" }, \
577 { RC_REPLY, "REPLY" }, \
580 TRACE_EVENT(nfsd_drc_found
,
582 const struct nfsd_net
*nn
,
583 const struct svc_rqst
*rqstp
,
586 TP_ARGS(nn
, rqstp
, result
),
588 __field(unsigned long long, boot_time
)
589 __field(unsigned long, result
)
593 __entry
->boot_time
= nn
->boot_time
;
594 __entry
->result
= result
;
595 __entry
->xid
= be32_to_cpu(rqstp
->rq_xid
);
597 TP_printk("boot_time=%16llx xid=0x%08x result=%s",
598 __entry
->boot_time
, __entry
->xid
,
599 show_drc_retval(__entry
->result
))
603 TRACE_EVENT(nfsd_drc_mismatch
,
605 const struct nfsd_net
*nn
,
606 const struct svc_cacherep
*key
,
607 const struct svc_cacherep
*rp
609 TP_ARGS(nn
, key
, rp
),
611 __field(unsigned long long, boot_time
)
614 __field(u32
, ingress
)
617 __entry
->boot_time
= nn
->boot_time
;
618 __entry
->xid
= be32_to_cpu(key
->c_key
.k_xid
);
619 __entry
->cached
= (__force u32
)key
->c_key
.k_csum
;
620 __entry
->ingress
= (__force u32
)rp
->c_key
.k_csum
;
622 TP_printk("boot_time=%16llx xid=0x%08x cached-csum=0x%08x ingress-csum=0x%08x",
623 __entry
->boot_time
, __entry
->xid
, __entry
->cached
,
627 TRACE_EVENT(nfsd_cb_args
,
629 const struct nfs4_client
*clp
,
630 const struct nfs4_cb_conn
*conn
634 __field(u32
, cl_boot
)
638 __array(unsigned char, addr
, sizeof(struct sockaddr_in6
))
641 __entry
->cl_boot
= clp
->cl_clientid
.cl_boot
;
642 __entry
->cl_id
= clp
->cl_clientid
.cl_id
;
643 __entry
->prog
= conn
->cb_prog
;
644 __entry
->ident
= conn
->cb_ident
;
645 memcpy(__entry
->addr
, &conn
->cb_addr
,
646 sizeof(struct sockaddr_in6
));
648 TP_printk("client %08x:%08x callback addr=%pISpc prog=%u ident=%u",
649 __entry
->cl_boot
, __entry
->cl_id
,
650 __entry
->addr
, __entry
->prog
, __entry
->ident
)
653 TRACE_EVENT(nfsd_cb_nodelegs
,
654 TP_PROTO(const struct nfs4_client
*clp
),
657 __field(u32
, cl_boot
)
661 __entry
->cl_boot
= clp
->cl_clientid
.cl_boot
;
662 __entry
->cl_id
= clp
->cl_clientid
.cl_id
;
664 TP_printk("client %08x:%08x", __entry
->cl_boot
, __entry
->cl_id
)
667 TRACE_DEFINE_ENUM(NFSD4_CB_UP
);
668 TRACE_DEFINE_ENUM(NFSD4_CB_UNKNOWN
);
669 TRACE_DEFINE_ENUM(NFSD4_CB_DOWN
);
670 TRACE_DEFINE_ENUM(NFSD4_CB_FAULT
);
672 #define show_cb_state(val) \
673 __print_symbolic(val, \
674 { NFSD4_CB_UP, "UP" }, \
675 { NFSD4_CB_UNKNOWN, "UNKNOWN" }, \
676 { NFSD4_CB_DOWN, "DOWN" }, \
677 { NFSD4_CB_FAULT, "FAULT"})
679 DECLARE_EVENT_CLASS(nfsd_cb_class
,
680 TP_PROTO(const struct nfs4_client
*clp
),
683 __field(unsigned long, state
)
684 __field(u32
, cl_boot
)
686 __array(unsigned char, addr
, sizeof(struct sockaddr_in6
))
689 __entry
->state
= clp
->cl_cb_state
;
690 __entry
->cl_boot
= clp
->cl_clientid
.cl_boot
;
691 __entry
->cl_id
= clp
->cl_clientid
.cl_id
;
692 memcpy(__entry
->addr
, &clp
->cl_cb_conn
.cb_addr
,
693 sizeof(struct sockaddr_in6
));
695 TP_printk("addr=%pISpc client %08x:%08x state=%s",
696 __entry
->addr
, __entry
->cl_boot
, __entry
->cl_id
,
697 show_cb_state(__entry
->state
))
700 #define DEFINE_NFSD_CB_EVENT(name) \
701 DEFINE_EVENT(nfsd_cb_class, nfsd_cb_##name, \
702 TP_PROTO(const struct nfs4_client *clp), \
705 DEFINE_NFSD_CB_EVENT(setup
);
706 DEFINE_NFSD_CB_EVENT(state
);
707 DEFINE_NFSD_CB_EVENT(shutdown
);
709 TRACE_EVENT(nfsd_cb_setup_err
,
711 const struct nfs4_client
*clp
,
717 __field(u32
, cl_boot
)
719 __array(unsigned char, addr
, sizeof(struct sockaddr_in6
))
722 __entry
->error
= error
;
723 __entry
->cl_boot
= clp
->cl_clientid
.cl_boot
;
724 __entry
->cl_id
= clp
->cl_clientid
.cl_id
;
725 memcpy(__entry
->addr
, &clp
->cl_cb_conn
.cb_addr
,
726 sizeof(struct sockaddr_in6
));
728 TP_printk("addr=%pISpc client %08x:%08x error=%ld",
729 __entry
->addr
, __entry
->cl_boot
, __entry
->cl_id
, __entry
->error
)
732 TRACE_EVENT(nfsd_cb_work
,
734 const struct nfs4_client
*clp
,
735 const char *procedure
737 TP_ARGS(clp
, procedure
),
739 __field(u32
, cl_boot
)
741 __string(procedure
, procedure
)
742 __array(unsigned char, addr
, sizeof(struct sockaddr_in6
))
745 __entry
->cl_boot
= clp
->cl_clientid
.cl_boot
;
746 __entry
->cl_id
= clp
->cl_clientid
.cl_id
;
747 __assign_str(procedure
, procedure
)
748 memcpy(__entry
->addr
, &clp
->cl_cb_conn
.cb_addr
,
749 sizeof(struct sockaddr_in6
));
751 TP_printk("addr=%pISpc client %08x:%08x procedure=%s",
752 __entry
->addr
, __entry
->cl_boot
, __entry
->cl_id
,
753 __get_str(procedure
))
756 TRACE_EVENT(nfsd_cb_done
,
758 const struct nfs4_client
*clp
,
761 TP_ARGS(clp
, status
),
763 __field(u32
, cl_boot
)
766 __array(unsigned char, addr
, sizeof(struct sockaddr_in6
))
769 __entry
->cl_boot
= clp
->cl_clientid
.cl_boot
;
770 __entry
->cl_id
= clp
->cl_clientid
.cl_id
;
771 __entry
->status
= status
;
772 memcpy(__entry
->addr
, &clp
->cl_cb_conn
.cb_addr
,
773 sizeof(struct sockaddr_in6
));
775 TP_printk("addr=%pISpc client %08x:%08x status=%d",
776 __entry
->addr
, __entry
->cl_boot
, __entry
->cl_id
,
780 #endif /* _NFSD_TRACE_H */
782 #undef TRACE_INCLUDE_PATH
783 #define TRACE_INCLUDE_PATH .
784 #define TRACE_INCLUDE_FILE trace
785 #include <trace/define_trace.h>