Skip to content

Commit 2ed4f6f

Browse files
committed
NFSD: Fix trace_nfsd_slot_seqid_sequence
While running down the problem triggered by disconnect injection, I noticed the "in use" string was actually never hooked up in this trace point, so it always showed the traced slot as not in use. But what might be more useful is showing all the slot status flags. Also, this trace point can record and report the slot's index number, which among other things is useful for troubleshooting slot table expansion and contraction. Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 4e59e69 commit 2ed4f6f

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

fs/nfsd/trace.h

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,14 @@ DEFINE_EVENT(nfsd_cs_slot_class, nfsd_##name, \
803803
DEFINE_CS_SLOT_EVENT(slot_seqid_conf);
804804
DEFINE_CS_SLOT_EVENT(slot_seqid_unconf);
805805

806+
#define show_nfs_slot_flags(val) \
807+
__print_flags(val, "|", \
808+
{ NFSD4_SLOT_INUSE, "INUSE" }, \
809+
{ NFSD4_SLOT_CACHETHIS, "CACHETHIS" }, \
810+
{ NFSD4_SLOT_INITIALIZED, "INITIALIZED" }, \
811+
{ NFSD4_SLOT_CACHED, "CACHED" }, \
812+
{ NFSD4_SLOT_REUSED, "REUSED" })
813+
806814
TRACE_EVENT(nfsd_slot_seqid_sequence,
807815
TP_PROTO(
808816
const struct nfs4_client *clp,
@@ -813,10 +821,11 @@ TRACE_EVENT(nfsd_slot_seqid_sequence,
813821
TP_STRUCT__entry(
814822
__field(u32, seqid)
815823
__field(u32, slot_seqid)
824+
__field(u32, slot_index)
825+
__field(unsigned long, slot_flags)
816826
__field(u32, cl_boot)
817827
__field(u32, cl_id)
818828
__sockaddr(addr, clp->cl_cb_conn.cb_addrlen)
819-
__field(bool, in_use)
820829
),
821830
TP_fast_assign(
822831
__entry->cl_boot = clp->cl_clientid.cl_boot;
@@ -825,11 +834,13 @@ TRACE_EVENT(nfsd_slot_seqid_sequence,
825834
clp->cl_cb_conn.cb_addrlen);
826835
__entry->seqid = seq->seqid;
827836
__entry->slot_seqid = slot->sl_seqid;
837+
__entry->slot_index = seq->slotid;
838+
__entry->slot_flags = slot->sl_flags;
828839
),
829-
TP_printk("addr=%pISpc client %08x:%08x seqid=%u slot_seqid=%u (%sin use)",
840+
TP_printk("addr=%pISpc client %08x:%08x idx=%u seqid=%u slot_seqid=%u flags=%s",
830841
__get_sockaddr(addr), __entry->cl_boot, __entry->cl_id,
831-
__entry->seqid, __entry->slot_seqid,
832-
__entry->in_use ? "" : "not "
842+
__entry->slot_index, __entry->seqid, __entry->slot_seqid,
843+
show_nfs_slot_flags(__entry->slot_flags)
833844
)
834845
);
835846

0 commit comments

Comments
 (0)