Hi Paolo,
Paolo Abeni <pabeni(a)redhat.com> 于2021年3月23日周二 下午5:47写道:
Hello,
On Mon, 2021-02-22 at 15:30 +0800, Geliang Tang wrote:
> This patch added the tracepoint for the mapping status function
> get_mapping_status.
>
> Signed-off-by: Geliang Tang <geliangtang(a)gmail.com>
> ---
> include/trace/events/mptcp.h | 51 ++++++++++++++++++++++++++++++++++++
> net/mptcp/subflow.c | 13 +++------
> 2 files changed, 54 insertions(+), 10 deletions(-)
>
> diff --git a/include/trace/events/mptcp.h b/include/trace/events/mptcp.h
> index b36b308f48e2..f06a7d33b237 100644
> --- a/include/trace/events/mptcp.h
> +++ b/include/trace/events/mptcp.h
> @@ -39,6 +39,57 @@ TRACE_EVENT(mptcp_subflow_get_send,
> __entry->ssk_1, __entry->ratio_1)
> );
>
> +TRACE_EVENT(get_mapping_status,
> +
> + TP_PROTO(struct mptcp_ext *mpext),
> +
> + TP_ARGS(mpext),
> +
> + TP_STRUCT__entry(
> + __array(char, str, 128)
> + ),
> +
> + TP_fast_assign(
> + memset(__entry->str, 0, 128);
> +
> + if (!mpext) {
> + sprintf(__entry->str, "mpext is NULL");
> + } else {
> + if (!mpext->data_len) {
> + sprintf(__entry->str, "Infinite mapping not
handled");
> + } else {
> + if (mpext->data_fin == 1) {
> + if (mpext->data_len == 1) {
> + sprintf(__entry->str,
> + "data_fin: with no
payload seq=%llu",
> + mpext->data_seq);
> + } else {
> + sprintf(__entry->str,
> + "data_fin: with mapping
seq=%llu dsn64=%d",
> + mpext->data_seq +
mpext->data_len - 1,
> + mpext->dsn64);
> + }
> + }
> +
> + if (mpext->use_map) {
> + sprintf(__entry->str +
strlen(__entry->str),
> + "use_map: dsn64=%d data_seq=%llu
subflow_seq=%u data_len=%u",
> + mpext->dsn64, mpext->data_seq,
> + mpext->subflow_seq,
mpext->data_len);
> + }
> +
> + if (mpext->use_ack) {
> + sprintf(__entry->str +
strlen(__entry->str),
> + "use_ack: ack64=%d
data_ack=%llu",
> + mpext->ack64, mpext->data_ack);
> + }
> + }
> + }
> + ),
I'm sorry for the very late feedback. I think the tracepoint location
is good, but the tracepoint hooks contains a bit too-much mptcp-related
logic. What dumping every mpext field?
Side note: we possibly would need another trace point
in ack_update_msk() to track the incoming data_ack and window/snd_una
updates
Thanks for your suggestions, I'll update them in v2.
-Geliang
>
> Thanks!
>
> Paolo
>