^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright (c) 2014 Christoph Hellwig.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #undef TRACE_SYSTEM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #define TRACE_SYSTEM nfsd
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #if !defined(_NFSD_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #define _NFSD_TRACE_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/tracepoint.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include "export.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include "nfsfh.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) TRACE_EVENT(nfsd_compound,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) TP_PROTO(const struct svc_rqst *rqst,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) u32 args_opcnt),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) TP_ARGS(rqst, args_opcnt),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) __field(u32, xid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) __field(u32, args_opcnt)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) __entry->xid = be32_to_cpu(rqst->rq_xid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) __entry->args_opcnt = args_opcnt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) TP_printk("xid=0x%08x opcnt=%u",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) __entry->xid, __entry->args_opcnt)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) TRACE_EVENT(nfsd_compound_status,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) TP_PROTO(u32 args_opcnt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) u32 resp_opcnt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) __be32 status,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) const char *name),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) TP_ARGS(args_opcnt, resp_opcnt, status, name),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) __field(u32, args_opcnt)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) __field(u32, resp_opcnt)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) __field(int, status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) __string(name, name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) __entry->args_opcnt = args_opcnt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) __entry->resp_opcnt = resp_opcnt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) __entry->status = be32_to_cpu(status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) __assign_str(name, name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) TP_printk("op=%u/%u %s status=%d",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) __entry->resp_opcnt, __entry->args_opcnt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) __get_str(name), __entry->status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) DECLARE_EVENT_CLASS(nfsd_fh_err_class,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) TP_PROTO(struct svc_rqst *rqstp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) struct svc_fh *fhp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) int status),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) TP_ARGS(rqstp, fhp, status),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) __field(u32, xid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) __field(u32, fh_hash)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) __field(int, status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) __entry->xid = be32_to_cpu(rqstp->rq_xid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) __entry->fh_hash = knfsd_fh_hash(&fhp->fh_handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) __entry->status = status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) TP_printk("xid=0x%08x fh_hash=0x%08x status=%d",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) __entry->xid, __entry->fh_hash,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) __entry->status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) #define DEFINE_NFSD_FH_ERR_EVENT(name) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) DEFINE_EVENT(nfsd_fh_err_class, nfsd_##name, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) TP_PROTO(struct svc_rqst *rqstp, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) struct svc_fh *fhp, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) int status), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) TP_ARGS(rqstp, fhp, status))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) DEFINE_NFSD_FH_ERR_EVENT(set_fh_dentry_badexport);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) DEFINE_NFSD_FH_ERR_EVENT(set_fh_dentry_badhandle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) TRACE_EVENT(nfsd_exp_find_key,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) TP_PROTO(const struct svc_expkey *key,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) int status),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) TP_ARGS(key, status),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) __field(int, fsidtype)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) __array(u32, fsid, 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) __string(auth_domain, key->ek_client->name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) __field(int, status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) __entry->fsidtype = key->ek_fsidtype;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) memcpy(__entry->fsid, key->ek_fsid, 4*6);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) __assign_str(auth_domain, key->ek_client->name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) __entry->status = status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) TP_printk("fsid=%x::%s domain=%s status=%d",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) __entry->fsidtype,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) __print_array(__entry->fsid, 6, 4),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) __get_str(auth_domain),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) __entry->status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) TRACE_EVENT(nfsd_expkey_update,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) TP_PROTO(const struct svc_expkey *key, const char *exp_path),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) TP_ARGS(key, exp_path),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) __field(int, fsidtype)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) __array(u32, fsid, 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) __string(auth_domain, key->ek_client->name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) __string(path, exp_path)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) __field(bool, cache)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) __entry->fsidtype = key->ek_fsidtype;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) memcpy(__entry->fsid, key->ek_fsid, 4*6);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) __assign_str(auth_domain, key->ek_client->name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) __assign_str(path, exp_path);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) __entry->cache = !test_bit(CACHE_NEGATIVE, &key->h.flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) TP_printk("fsid=%x::%s domain=%s path=%s cache=%s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) __entry->fsidtype,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) __print_array(__entry->fsid, 6, 4),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) __get_str(auth_domain),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) __get_str(path),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) __entry->cache ? "pos" : "neg"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) TRACE_EVENT(nfsd_exp_get_by_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) TP_PROTO(const struct svc_export *key,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) int status),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) TP_ARGS(key, status),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) __string(path, key->ex_path.dentry->d_name.name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) __string(auth_domain, key->ex_client->name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) __field(int, status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) __assign_str(path, key->ex_path.dentry->d_name.name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) __assign_str(auth_domain, key->ex_client->name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) __entry->status = status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) TP_printk("path=%s domain=%s status=%d",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) __get_str(path),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) __get_str(auth_domain),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) __entry->status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) TRACE_EVENT(nfsd_export_update,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) TP_PROTO(const struct svc_export *key),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) TP_ARGS(key),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) __string(path, key->ex_path.dentry->d_name.name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) __string(auth_domain, key->ex_client->name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) __field(bool, cache)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) __assign_str(path, key->ex_path.dentry->d_name.name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) __assign_str(auth_domain, key->ex_client->name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) __entry->cache = !test_bit(CACHE_NEGATIVE, &key->h.flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) TP_printk("path=%s domain=%s cache=%s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) __get_str(path),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) __get_str(auth_domain),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) __entry->cache ? "pos" : "neg"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) DECLARE_EVENT_CLASS(nfsd_io_class,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) TP_PROTO(struct svc_rqst *rqstp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) struct svc_fh *fhp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) u64 offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) u32 len),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) TP_ARGS(rqstp, fhp, offset, len),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) __field(u32, xid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) __field(u32, fh_hash)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) __field(u64, offset)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) __field(u32, len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) __entry->xid = be32_to_cpu(rqstp->rq_xid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) __entry->fh_hash = knfsd_fh_hash(&fhp->fh_handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) __entry->offset = offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) __entry->len = len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) TP_printk("xid=0x%08x fh_hash=0x%08x offset=%llu len=%u",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) __entry->xid, __entry->fh_hash,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) __entry->offset, __entry->len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) #define DEFINE_NFSD_IO_EVENT(name) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) DEFINE_EVENT(nfsd_io_class, nfsd_##name, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) TP_PROTO(struct svc_rqst *rqstp, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) struct svc_fh *fhp, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) u64 offset, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) u32 len), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) TP_ARGS(rqstp, fhp, offset, len))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) DEFINE_NFSD_IO_EVENT(read_start);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) DEFINE_NFSD_IO_EVENT(read_splice);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) DEFINE_NFSD_IO_EVENT(read_vector);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) DEFINE_NFSD_IO_EVENT(read_io_done);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) DEFINE_NFSD_IO_EVENT(read_done);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) DEFINE_NFSD_IO_EVENT(write_start);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) DEFINE_NFSD_IO_EVENT(write_opened);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) DEFINE_NFSD_IO_EVENT(write_io_done);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) DEFINE_NFSD_IO_EVENT(write_done);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) DECLARE_EVENT_CLASS(nfsd_err_class,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) TP_PROTO(struct svc_rqst *rqstp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) struct svc_fh *fhp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) loff_t offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) int status),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) TP_ARGS(rqstp, fhp, offset, status),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) __field(u32, xid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) __field(u32, fh_hash)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) __field(loff_t, offset)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) __field(int, status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) __entry->xid = be32_to_cpu(rqstp->rq_xid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) __entry->fh_hash = knfsd_fh_hash(&fhp->fh_handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) __entry->offset = offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) __entry->status = status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) TP_printk("xid=0x%08x fh_hash=0x%08x offset=%lld status=%d",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) __entry->xid, __entry->fh_hash,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) __entry->offset, __entry->status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) #define DEFINE_NFSD_ERR_EVENT(name) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) DEFINE_EVENT(nfsd_err_class, nfsd_##name, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) TP_PROTO(struct svc_rqst *rqstp, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) struct svc_fh *fhp, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) loff_t offset, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) int len), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) TP_ARGS(rqstp, fhp, offset, len))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) DEFINE_NFSD_ERR_EVENT(read_err);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) DEFINE_NFSD_ERR_EVENT(write_err);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) #include "state.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) #include "filecache.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) #include "vfs.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) DECLARE_EVENT_CLASS(nfsd_stateid_class,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) TP_PROTO(stateid_t *stp),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) TP_ARGS(stp),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) __field(u32, cl_boot)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) __field(u32, cl_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) __field(u32, si_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) __field(u32, si_generation)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) __entry->cl_boot = stp->si_opaque.so_clid.cl_boot;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) __entry->cl_id = stp->si_opaque.so_clid.cl_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) __entry->si_id = stp->si_opaque.so_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) __entry->si_generation = stp->si_generation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) TP_printk("client %08x:%08x stateid %08x:%08x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) __entry->cl_boot,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) __entry->cl_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) __entry->si_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) __entry->si_generation)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) #define DEFINE_STATEID_EVENT(name) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) DEFINE_EVENT(nfsd_stateid_class, nfsd_##name, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) TP_PROTO(stateid_t *stp), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) TP_ARGS(stp))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) DEFINE_STATEID_EVENT(layoutstate_alloc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) DEFINE_STATEID_EVENT(layoutstate_unhash);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) DEFINE_STATEID_EVENT(layoutstate_free);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) DEFINE_STATEID_EVENT(layout_get_lookup_fail);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) DEFINE_STATEID_EVENT(layout_commit_lookup_fail);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) DEFINE_STATEID_EVENT(layout_return_lookup_fail);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) DEFINE_STATEID_EVENT(layout_recall);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) DEFINE_STATEID_EVENT(layout_recall_done);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) DEFINE_STATEID_EVENT(layout_recall_fail);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) DEFINE_STATEID_EVENT(layout_recall_release);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) DEFINE_STATEID_EVENT(open);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) DEFINE_STATEID_EVENT(deleg_read);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) DEFINE_STATEID_EVENT(deleg_break);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) DEFINE_STATEID_EVENT(deleg_recall);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) DECLARE_EVENT_CLASS(nfsd_stateseqid_class,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) TP_PROTO(u32 seqid, const stateid_t *stp),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) TP_ARGS(seqid, stp),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) __field(u32, seqid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) __field(u32, cl_boot)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) __field(u32, cl_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) __field(u32, si_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) __field(u32, si_generation)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) __entry->seqid = seqid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) __entry->cl_boot = stp->si_opaque.so_clid.cl_boot;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) __entry->cl_id = stp->si_opaque.so_clid.cl_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) __entry->si_id = stp->si_opaque.so_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) __entry->si_generation = stp->si_generation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) TP_printk("seqid=%u client %08x:%08x stateid %08x:%08x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) __entry->seqid, __entry->cl_boot, __entry->cl_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) __entry->si_id, __entry->si_generation)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) #define DEFINE_STATESEQID_EVENT(name) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) DEFINE_EVENT(nfsd_stateseqid_class, nfsd_##name, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) TP_PROTO(u32 seqid, const stateid_t *stp), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) TP_ARGS(seqid, stp))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) DEFINE_STATESEQID_EVENT(preprocess);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) DEFINE_STATESEQID_EVENT(open_confirm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) DECLARE_EVENT_CLASS(nfsd_clientid_class,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) TP_PROTO(const clientid_t *clid),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) TP_ARGS(clid),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) __field(u32, cl_boot)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) __field(u32, cl_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) __entry->cl_boot = clid->cl_boot;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) __entry->cl_id = clid->cl_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) TP_printk("client %08x:%08x", __entry->cl_boot, __entry->cl_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) #define DEFINE_CLIENTID_EVENT(name) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) DEFINE_EVENT(nfsd_clientid_class, nfsd_clid_##name, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) TP_PROTO(const clientid_t *clid), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) TP_ARGS(clid))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) DEFINE_CLIENTID_EVENT(expired);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) DEFINE_CLIENTID_EVENT(purged);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) DEFINE_CLIENTID_EVENT(renew);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) DEFINE_CLIENTID_EVENT(stale);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) DECLARE_EVENT_CLASS(nfsd_net_class,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) TP_PROTO(const struct nfsd_net *nn),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) TP_ARGS(nn),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) __field(unsigned long long, boot_time)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) __entry->boot_time = nn->boot_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) TP_printk("boot_time=%16llx", __entry->boot_time)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) #define DEFINE_NET_EVENT(name) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) DEFINE_EVENT(nfsd_net_class, nfsd_##name, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) TP_PROTO(const struct nfsd_net *nn), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) TP_ARGS(nn))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) DEFINE_NET_EVENT(grace_start);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) DEFINE_NET_EVENT(grace_complete);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) TRACE_EVENT(nfsd_clid_inuse_err,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) TP_PROTO(const struct nfs4_client *clp),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) TP_ARGS(clp),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) __field(u32, cl_boot)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) __field(u32, cl_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) __array(unsigned char, addr, sizeof(struct sockaddr_in6))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) __field(unsigned int, namelen)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) __dynamic_array(unsigned char, name, clp->cl_name.len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) __entry->cl_boot = clp->cl_clientid.cl_boot;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) __entry->cl_id = clp->cl_clientid.cl_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) memcpy(__entry->addr, &clp->cl_addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) sizeof(struct sockaddr_in6));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) __entry->namelen = clp->cl_name.len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) memcpy(__get_dynamic_array(name), clp->cl_name.data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) clp->cl_name.len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) TP_printk("nfs4_clientid %.*s already in use by %pISpc, client %08x:%08x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) __entry->namelen, __get_str(name), __entry->addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) __entry->cl_boot, __entry->cl_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) TRACE_DEFINE_ENUM(NFSD_FILE_HASHED);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) TRACE_DEFINE_ENUM(NFSD_FILE_PENDING);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) TRACE_DEFINE_ENUM(NFSD_FILE_BREAK_READ);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) TRACE_DEFINE_ENUM(NFSD_FILE_BREAK_WRITE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) TRACE_DEFINE_ENUM(NFSD_FILE_REFERENCED);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) #define show_nf_flags(val) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) __print_flags(val, "|", \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) { 1 << NFSD_FILE_HASHED, "HASHED" }, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) { 1 << NFSD_FILE_PENDING, "PENDING" }, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) { 1 << NFSD_FILE_BREAK_READ, "BREAK_READ" }, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) { 1 << NFSD_FILE_BREAK_WRITE, "BREAK_WRITE" }, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) { 1 << NFSD_FILE_REFERENCED, "REFERENCED"})
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) /* FIXME: This should probably be fleshed out in the future. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) #define show_nf_may(val) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) __print_flags(val, "|", \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) { NFSD_MAY_READ, "READ" }, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) { NFSD_MAY_WRITE, "WRITE" }, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) { NFSD_MAY_NOT_BREAK_LEASE, "NOT_BREAK_LEASE" })
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) DECLARE_EVENT_CLASS(nfsd_file_class,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) TP_PROTO(struct nfsd_file *nf),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) TP_ARGS(nf),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) __field(unsigned int, nf_hashval)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) __field(void *, nf_inode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) __field(int, nf_ref)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) __field(unsigned long, nf_flags)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) __field(unsigned char, nf_may)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) __field(struct file *, nf_file)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) __entry->nf_hashval = nf->nf_hashval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) __entry->nf_inode = nf->nf_inode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) __entry->nf_ref = refcount_read(&nf->nf_ref);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) __entry->nf_flags = nf->nf_flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) __entry->nf_may = nf->nf_may;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) __entry->nf_file = nf->nf_file;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) TP_printk("hash=0x%x inode=0x%p ref=%d flags=%s may=%s file=%p",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) __entry->nf_hashval,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) __entry->nf_inode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) __entry->nf_ref,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) show_nf_flags(__entry->nf_flags),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) show_nf_may(__entry->nf_may),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) __entry->nf_file)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) #define DEFINE_NFSD_FILE_EVENT(name) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) DEFINE_EVENT(nfsd_file_class, name, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) TP_PROTO(struct nfsd_file *nf), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) TP_ARGS(nf))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) DEFINE_NFSD_FILE_EVENT(nfsd_file_alloc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) DEFINE_NFSD_FILE_EVENT(nfsd_file_put_final);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) DEFINE_NFSD_FILE_EVENT(nfsd_file_unhash);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) DEFINE_NFSD_FILE_EVENT(nfsd_file_put);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) DEFINE_NFSD_FILE_EVENT(nfsd_file_unhash_and_release_locked);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) TRACE_EVENT(nfsd_file_acquire,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) TP_PROTO(struct svc_rqst *rqstp, unsigned int hash,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) struct inode *inode, unsigned int may_flags,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) struct nfsd_file *nf, __be32 status),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) TP_ARGS(rqstp, hash, inode, may_flags, nf, status),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) __field(u32, xid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) __field(unsigned int, hash)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) __field(void *, inode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) __field(unsigned int, may_flags)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) __field(int, nf_ref)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) __field(unsigned long, nf_flags)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) __field(unsigned char, nf_may)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) __field(struct file *, nf_file)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) __field(u32, status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) __entry->xid = be32_to_cpu(rqstp->rq_xid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) __entry->hash = hash;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) __entry->inode = inode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) __entry->may_flags = may_flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) __entry->nf_ref = nf ? refcount_read(&nf->nf_ref) : 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) __entry->nf_flags = nf ? nf->nf_flags : 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) __entry->nf_may = nf ? nf->nf_may : 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) __entry->nf_file = nf ? nf->nf_file : NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) __entry->status = be32_to_cpu(status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) 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",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) __entry->xid, __entry->hash, __entry->inode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) show_nf_may(__entry->may_flags), __entry->nf_ref,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) show_nf_flags(__entry->nf_flags),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) show_nf_may(__entry->nf_may), __entry->nf_file,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491) __entry->status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) DECLARE_EVENT_CLASS(nfsd_file_search_class,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) TP_PROTO(struct inode *inode, unsigned int hash, int found),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) TP_ARGS(inode, hash, found),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498) __field(struct inode *, inode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) __field(unsigned int, hash)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500) __field(int, found)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) __entry->inode = inode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504) __entry->hash = hash;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505) __entry->found = found;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) TP_printk("hash=0x%x inode=0x%p found=%d", __entry->hash,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) __entry->inode, __entry->found)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) #define DEFINE_NFSD_FILE_SEARCH_EVENT(name) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) DEFINE_EVENT(nfsd_file_search_class, name, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513) TP_PROTO(struct inode *inode, unsigned int hash, int found), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514) TP_ARGS(inode, hash, found))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516) DEFINE_NFSD_FILE_SEARCH_EVENT(nfsd_file_close_inode_sync);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517) DEFINE_NFSD_FILE_SEARCH_EVENT(nfsd_file_close_inode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) DEFINE_NFSD_FILE_SEARCH_EVENT(nfsd_file_is_cached);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520) TRACE_EVENT(nfsd_file_fsnotify_handle_event,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521) TP_PROTO(struct inode *inode, u32 mask),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) TP_ARGS(inode, mask),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524) __field(struct inode *, inode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525) __field(unsigned int, nlink)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526) __field(umode_t, mode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527) __field(u32, mask)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530) __entry->inode = inode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531) __entry->nlink = inode->i_nlink;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532) __entry->mode = inode->i_mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533) __entry->mask = mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 534) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 535) TP_printk("inode=0x%p nlink=%u mode=0%ho mask=0x%x", __entry->inode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 536) __entry->nlink, __entry->mode, __entry->mask)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 537) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 538)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 539) #include "cache.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 540)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 541) TRACE_DEFINE_ENUM(RC_DROPIT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 542) TRACE_DEFINE_ENUM(RC_REPLY);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 543) TRACE_DEFINE_ENUM(RC_DOIT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 544)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 545) #define show_drc_retval(x) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 546) __print_symbolic(x, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 547) { RC_DROPIT, "DROPIT" }, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 548) { RC_REPLY, "REPLY" }, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 549) { RC_DOIT, "DOIT" })
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 550)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 551) TRACE_EVENT(nfsd_drc_found,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 552) TP_PROTO(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 553) const struct nfsd_net *nn,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 554) const struct svc_rqst *rqstp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 555) int result
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 556) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 557) TP_ARGS(nn, rqstp, result),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 558) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 559) __field(unsigned long long, boot_time)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 560) __field(unsigned long, result)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 561) __field(u32, xid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 562) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 563) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 564) __entry->boot_time = nn->boot_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 565) __entry->result = result;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 566) __entry->xid = be32_to_cpu(rqstp->rq_xid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 567) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 568) TP_printk("boot_time=%16llx xid=0x%08x result=%s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 569) __entry->boot_time, __entry->xid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 570) show_drc_retval(__entry->result))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 571)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 572) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 573)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 574) TRACE_EVENT(nfsd_drc_mismatch,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 575) TP_PROTO(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 576) const struct nfsd_net *nn,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 577) const struct svc_cacherep *key,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 578) const struct svc_cacherep *rp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 579) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 580) TP_ARGS(nn, key, rp),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 581) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 582) __field(unsigned long long, boot_time)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 583) __field(u32, xid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 584) __field(u32, cached)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 585) __field(u32, ingress)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 586) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 587) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 588) __entry->boot_time = nn->boot_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 589) __entry->xid = be32_to_cpu(key->c_key.k_xid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 590) __entry->cached = (__force u32)key->c_key.k_csum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 591) __entry->ingress = (__force u32)rp->c_key.k_csum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 592) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 593) TP_printk("boot_time=%16llx xid=0x%08x cached-csum=0x%08x ingress-csum=0x%08x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 594) __entry->boot_time, __entry->xid, __entry->cached,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 595) __entry->ingress)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 596) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 597)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 598) TRACE_EVENT(nfsd_cb_args,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 599) TP_PROTO(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 600) const struct nfs4_client *clp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 601) const struct nfs4_cb_conn *conn
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 602) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 603) TP_ARGS(clp, conn),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 604) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 605) __field(u32, cl_boot)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 606) __field(u32, cl_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 607) __field(u32, prog)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 608) __field(u32, ident)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 609) __array(unsigned char, addr, sizeof(struct sockaddr_in6))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 610) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 611) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 612) __entry->cl_boot = clp->cl_clientid.cl_boot;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 613) __entry->cl_id = clp->cl_clientid.cl_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 614) __entry->prog = conn->cb_prog;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 615) __entry->ident = conn->cb_ident;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 616) memcpy(__entry->addr, &conn->cb_addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 617) sizeof(struct sockaddr_in6));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 618) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 619) TP_printk("client %08x:%08x callback addr=%pISpc prog=%u ident=%u",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 620) __entry->cl_boot, __entry->cl_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 621) __entry->addr, __entry->prog, __entry->ident)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 622) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 623)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 624) TRACE_EVENT(nfsd_cb_nodelegs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 625) TP_PROTO(const struct nfs4_client *clp),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 626) TP_ARGS(clp),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 627) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 628) __field(u32, cl_boot)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 629) __field(u32, cl_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 630) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 631) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 632) __entry->cl_boot = clp->cl_clientid.cl_boot;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 633) __entry->cl_id = clp->cl_clientid.cl_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 634) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 635) TP_printk("client %08x:%08x", __entry->cl_boot, __entry->cl_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 636) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 637)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 638) TRACE_DEFINE_ENUM(NFSD4_CB_UP);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 639) TRACE_DEFINE_ENUM(NFSD4_CB_UNKNOWN);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 640) TRACE_DEFINE_ENUM(NFSD4_CB_DOWN);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 641) TRACE_DEFINE_ENUM(NFSD4_CB_FAULT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 642)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 643) #define show_cb_state(val) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 644) __print_symbolic(val, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 645) { NFSD4_CB_UP, "UP" }, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 646) { NFSD4_CB_UNKNOWN, "UNKNOWN" }, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 647) { NFSD4_CB_DOWN, "DOWN" }, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 648) { NFSD4_CB_FAULT, "FAULT"})
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 649)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 650) DECLARE_EVENT_CLASS(nfsd_cb_class,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 651) TP_PROTO(const struct nfs4_client *clp),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 652) TP_ARGS(clp),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 653) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 654) __field(unsigned long, state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 655) __field(u32, cl_boot)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 656) __field(u32, cl_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 657) __array(unsigned char, addr, sizeof(struct sockaddr_in6))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 658) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 659) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 660) __entry->state = clp->cl_cb_state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 661) __entry->cl_boot = clp->cl_clientid.cl_boot;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 662) __entry->cl_id = clp->cl_clientid.cl_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 663) memcpy(__entry->addr, &clp->cl_cb_conn.cb_addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 664) sizeof(struct sockaddr_in6));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 665) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 666) TP_printk("addr=%pISpc client %08x:%08x state=%s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 667) __entry->addr, __entry->cl_boot, __entry->cl_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 668) show_cb_state(__entry->state))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 669) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 670)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 671) #define DEFINE_NFSD_CB_EVENT(name) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 672) DEFINE_EVENT(nfsd_cb_class, nfsd_cb_##name, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 673) TP_PROTO(const struct nfs4_client *clp), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 674) TP_ARGS(clp))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 675)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 676) DEFINE_NFSD_CB_EVENT(setup);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 677) DEFINE_NFSD_CB_EVENT(state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 678) DEFINE_NFSD_CB_EVENT(shutdown);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 679)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 680) TRACE_EVENT(nfsd_cb_setup_err,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 681) TP_PROTO(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 682) const struct nfs4_client *clp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 683) long error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 684) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 685) TP_ARGS(clp, error),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 686) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 687) __field(long, error)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 688) __field(u32, cl_boot)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 689) __field(u32, cl_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 690) __array(unsigned char, addr, sizeof(struct sockaddr_in6))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 691) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 692) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 693) __entry->error = error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 694) __entry->cl_boot = clp->cl_clientid.cl_boot;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 695) __entry->cl_id = clp->cl_clientid.cl_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 696) memcpy(__entry->addr, &clp->cl_cb_conn.cb_addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 697) sizeof(struct sockaddr_in6));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 698) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 699) TP_printk("addr=%pISpc client %08x:%08x error=%ld",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 700) __entry->addr, __entry->cl_boot, __entry->cl_id, __entry->error)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 701) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 702)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 703) TRACE_EVENT(nfsd_cb_work,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 704) TP_PROTO(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 705) const struct nfs4_client *clp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 706) const char *procedure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 707) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 708) TP_ARGS(clp, procedure),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 709) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 710) __field(u32, cl_boot)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 711) __field(u32, cl_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 712) __string(procedure, procedure)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 713) __array(unsigned char, addr, sizeof(struct sockaddr_in6))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 714) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 715) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 716) __entry->cl_boot = clp->cl_clientid.cl_boot;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 717) __entry->cl_id = clp->cl_clientid.cl_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 718) __assign_str(procedure, procedure)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 719) memcpy(__entry->addr, &clp->cl_cb_conn.cb_addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 720) sizeof(struct sockaddr_in6));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 721) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 722) TP_printk("addr=%pISpc client %08x:%08x procedure=%s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 723) __entry->addr, __entry->cl_boot, __entry->cl_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 724) __get_str(procedure))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 725) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 726)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 727) TRACE_EVENT(nfsd_cb_done,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 728) TP_PROTO(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 729) const struct nfs4_client *clp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 730) int status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 731) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 732) TP_ARGS(clp, status),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 733) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 734) __field(u32, cl_boot)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 735) __field(u32, cl_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 736) __field(int, status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 737) __array(unsigned char, addr, sizeof(struct sockaddr_in6))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 738) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 739) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 740) __entry->cl_boot = clp->cl_clientid.cl_boot;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 741) __entry->cl_id = clp->cl_clientid.cl_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 742) __entry->status = status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 743) memcpy(__entry->addr, &clp->cl_cb_conn.cb_addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 744) sizeof(struct sockaddr_in6));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 745) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 746) TP_printk("addr=%pISpc client %08x:%08x status=%d",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 747) __entry->addr, __entry->cl_boot, __entry->cl_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 748) __entry->status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 749) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 750)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 751) #endif /* _NFSD_TRACE_H */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 752)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 753) #undef TRACE_INCLUDE_PATH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 754) #define TRACE_INCLUDE_PATH .
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 755) #define TRACE_INCLUDE_FILE trace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 756) #include <trace/define_trace.h>