diff options
author | Tony Lu | 2021-11-01 15:39:16 +0800 |
---|---|---|
committer | David S. Miller | 2021-11-01 13:39:14 +0000 |
commit | a3a0e81b6fd55745e100735c7667cd99a0650811 (patch) | |
tree | b87dd34f6efbe873248fc0ec056267e2877be182 /net/smc/smc_tracepoint.h | |
parent | aff3083f10bff7a37eaa2b4e6bc5fb627ddd5f84 (diff) |
net/smc: Introduce tracepoint for smcr link down
SMC-R link down event is important to help us find links' issues, we
should track this event, especially in the single nic mode, which means
upper layer connection would be shut down. Then find out the direct
link-down reason in time, not only increased the counter, also the
location of the code who triggered this event.
Signed-off-by: Tony Lu <tonylu@linux.alibaba.com>
Reviewed-by: Wen Gu <guwen@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc/smc_tracepoint.h')
-rw-r--r-- | net/smc/smc_tracepoint.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/net/smc/smc_tracepoint.h b/net/smc/smc_tracepoint.h index eced1546afae..b4c36795a928 100644 --- a/net/smc/smc_tracepoint.h +++ b/net/smc/smc_tracepoint.h @@ -75,6 +75,36 @@ DEFINE_EVENT(smc_msg_event, smc_rx_recvmsg, TP_ARGS(smc, len) ); +TRACE_EVENT(smcr_link_down, + + TP_PROTO(const struct smc_link *lnk, void *location), + + TP_ARGS(lnk, location), + + TP_STRUCT__entry( + __field(const void *, lnk) + __field(const void *, lgr) + __field(int, state) + __string(name, lnk->ibname) + __field(void *, location) + ), + + TP_fast_assign( + const struct smc_link_group *lgr = lnk->lgr; + + __entry->lnk = lnk; + __entry->lgr = lgr; + __entry->state = lnk->state; + __assign_str(name, lnk->ibname); + __entry->location = location; + ), + + TP_printk("lnk=%p lgr=%p state=%d dev=%s location=%p", + __entry->lnk, __entry->lgr, + __entry->state, __get_str(name), + __entry->location) +); + #endif /* _TRACE_SMC_H */ #undef TRACE_INCLUDE_PATH |