Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/smc: Introduce tracepoints for tx and rx msg

This introduce two tracepoints for smc tx and rx msg to help us
diagnosis issues of data path. These two tracepoitns don't cover the
path of CORK or MSG_MORE in tx, just the top half of data path.

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>

authored by

Tony Lu and committed by
David S. Miller
aff3083f 48262608

+45
+3
net/smc/smc_rx.c
··· 22 22 #include "smc_tx.h" /* smc_tx_consumer_update() */ 23 23 #include "smc_rx.h" 24 24 #include "smc_stats.h" 25 + #include "smc_tracepoint.h" 25 26 26 27 /* callback implementation to wakeup consumers blocked with smc_rx_wait(). 27 28 * indirectly called by smc_cdc_msg_recv_action(). ··· 439 438 if (msg && smc_rx_update_consumer(smc, cons, copylen)) 440 439 goto out; 441 440 } 441 + 442 + trace_smc_rx_recvmsg(smc, copylen); 442 443 } while (read_remaining); 443 444 out: 444 445 return read_done;
+2
net/smc/smc_tracepoint.c
··· 4 4 #include "smc_tracepoint.h" 5 5 6 6 EXPORT_TRACEPOINT_SYMBOL(smc_switch_to_fallback); 7 + EXPORT_TRACEPOINT_SYMBOL(smc_tx_sendmsg); 8 + EXPORT_TRACEPOINT_SYMBOL(smc_rx_recvmsg);
+37
net/smc/smc_tracepoint.h
··· 38 38 __entry->sk, __entry->clcsk, __entry->fallback_rsn) 39 39 ); 40 40 41 + DECLARE_EVENT_CLASS(smc_msg_event, 42 + 43 + TP_PROTO(const struct smc_sock *smc, size_t len), 44 + 45 + TP_ARGS(smc, len), 46 + 47 + TP_STRUCT__entry( 48 + __field(const void *, smc) 49 + __field(size_t, len) 50 + __string(name, smc->conn.lnk->ibname) 51 + ), 52 + 53 + TP_fast_assign( 54 + __entry->smc = smc; 55 + __entry->len = len; 56 + __assign_str(name, smc->conn.lnk->ibname); 57 + ), 58 + 59 + TP_printk("smc=%p len=%zu dev=%s", 60 + __entry->smc, __entry->len, 61 + __get_str(name)) 62 + ); 63 + 64 + DEFINE_EVENT(smc_msg_event, smc_tx_sendmsg, 65 + 66 + TP_PROTO(const struct smc_sock *smc, size_t len), 67 + 68 + TP_ARGS(smc, len) 69 + ); 70 + 71 + DEFINE_EVENT(smc_msg_event, smc_rx_recvmsg, 72 + 73 + TP_PROTO(const struct smc_sock *smc, size_t len), 74 + 75 + TP_ARGS(smc, len) 76 + ); 77 + 41 78 #endif /* _TRACE_SMC_H */ 42 79 43 80 #undef TRACE_INCLUDE_PATH
+3
net/smc/smc_tx.c
··· 28 28 #include "smc_ism.h" 29 29 #include "smc_tx.h" 30 30 #include "smc_stats.h" 31 + #include "smc_tracepoint.h" 31 32 32 33 #define SMC_TX_WORK_DELAY 0 33 34 #define SMC_TX_CORK_DELAY (HZ >> 2) /* 250 ms */ ··· 246 245 SMC_TX_CORK_DELAY); 247 246 else 248 247 smc_tx_sndbuf_nonempty(conn); 248 + 249 + trace_smc_tx_sendmsg(smc, copylen); 249 250 } /* while (msg_data_left(msg)) */ 250 251 251 252 return send_done;