SUNRPC: Tracepoints should display tk_pid and cl_clid as a fixed-size field
authorChuck Lever <chuck.lever@oracle.com>
Sat, 16 Oct 2021 22:02:24 +0000 (18:02 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 20 Oct 2021 22:09:54 +0000 (18:09 -0400)
commitb4776a341ec05e809d21e98db5ed49dbdc81d5d8
tree809d056ad285f8a316dd6b1dfa0c1ba76a888d50
parent7a3d524c4cf520aa4501b66eac4a7d2339b018e6
SUNRPC: Tracepoints should display tk_pid and cl_clid as a fixed-size field

For certain special cases, RPC-related tracepoints record a -1 as
the task ID or the client ID. It's ugly for a trace event to display
4 billion in these cases.

To help keep SUNRPC tracepoints consistent, create a macro that
defines the print format specifiers for tk_pid and cl_clid. At some
point in the future we might try tk_pid with a wider range of values
than 0..64K so this makes it easier to make that change.

RPC tracepoints now look like this:

<...>-1276  [009]   149.720358: rpc_clnt_new:         client=00000005 peer=[192.168.2.55]:20049 program=nfs server=klimt.ib

<...>-1342  [004]   149.921234: rpc_xdr_recvfrom:     task:0000001a@00000005 head=[0xff1242d9ab6dc01c,144] page=0 tail=[(nil),0] len=144
<...>-1342  [004]   149.921235: xprt_release_cong:    task:0000001a@00000005 snd_task:ffffffff cong=256 cwnd=16384
<...>-1342  [004]   149.921235: xprt_put_cong:        task:0000001a@00000005 snd_task:ffffffff cong=0 cwnd=16384

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/nfs4trace.h
fs/nfs/nfstrace.h
include/trace/events/rpcgss.h
include/trace/events/rpcrdma.h
include/trace/events/sunrpc.h
include/trace/events/sunrpc_base.h [new file with mode: 0644]