Skip to content

Commit dc0112e

Browse files
chuckleveramschuma-ntap
authored andcommitted
rpcrdma: Trace connection registration and unregistration
These new trace points record xarray indices and the time of endpoint registration and unregistration, to co-ordinate with device removal events. Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 6b3b023 commit dc0112e

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

include/trace/events/rpcrdma.h

+36
Original file line numberDiff line numberDiff line change
@@ -2277,6 +2277,42 @@ DEFINE_CLIENT_DEVICE_EVENT(rpcrdma_client_remove_one);
22772277
DEFINE_CLIENT_DEVICE_EVENT(rpcrdma_client_wait_on);
22782278
DEFINE_CLIENT_DEVICE_EVENT(rpcrdma_client_remove_one_done);
22792279

2280+
DECLARE_EVENT_CLASS(rpcrdma_client_register_class,
2281+
TP_PROTO(
2282+
const struct ib_device *device,
2283+
const struct rpcrdma_notification *rn
2284+
),
2285+
2286+
TP_ARGS(device, rn),
2287+
2288+
TP_STRUCT__entry(
2289+
__string(name, device->name)
2290+
__field(void *, callback)
2291+
__field(u32, index)
2292+
),
2293+
2294+
TP_fast_assign(
2295+
__assign_str(name);
2296+
__entry->callback = rn->rn_done;
2297+
__entry->index = rn->rn_index;
2298+
),
2299+
2300+
TP_printk("device=%s index=%u done callback=%pS\n",
2301+
__get_str(name), __entry->index, __entry->callback
2302+
)
2303+
);
2304+
2305+
#define DEFINE_CLIENT_REGISTER_EVENT(name) \
2306+
DEFINE_EVENT(rpcrdma_client_register_class, name, \
2307+
TP_PROTO( \
2308+
const struct ib_device *device, \
2309+
const struct rpcrdma_notification *rn \
2310+
), \
2311+
TP_ARGS(device, rn))
2312+
2313+
DEFINE_CLIENT_REGISTER_EVENT(rpcrdma_client_register);
2314+
DEFINE_CLIENT_REGISTER_EVENT(rpcrdma_client_unregister);
2315+
22802316
#endif /* _TRACE_RPCRDMA_H */
22812317

22822318
#include <trace/define_trace.h>

net/sunrpc/xprtrdma/ib_client.c

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ int rpcrdma_rn_register(struct ib_device *device,
6666
return -ENOMEM;
6767
kref_get(&rd->rd_kref);
6868
rn->rn_done = done;
69+
trace_rpcrdma_client_register(device, rn);
6970
return 0;
7071
}
7172

@@ -91,6 +92,7 @@ void rpcrdma_rn_unregister(struct ib_device *device,
9192
if (!rd)
9293
return;
9394

95+
trace_rpcrdma_client_unregister(device, rn);
9496
xa_erase(&rd->rd_xa, rn->rn_index);
9597
kref_put(&rd->rd_kref, rpcrdma_rn_release);
9698
}

0 commit comments

Comments
 (0)