Re: [External] Re: [PATCH v3] sock: add tracepoint for send recv length

From: 运辉崔
Date: Sat Jan 07 2023 - 20:35:12 EST


On Sun, Jan 8, 2023 at 4:03 AM Cong Wang <xiyou.wangcong@xxxxxxxxx> wrote:

>
> Thanks for the numbers, they help a lot.
>
> Acked-by: Cong Wang <cong.wang@xxxxxxxxxxxxx>
>
> A few minor issues below.

Ok, Thanks for your suggestion, I'll update these on v4.

> > +
> > + TP_printk("sk address = %p, family = %s protocol = %s, length = %d, error = %d, flags = 0x%x",
> > + __entry->sk,
> > + show_family_name(__entry->family),
> > + show_inet_protocol_name(__entry->protocol),
> > + __entry->length,
> > + __entry->error, __entry->flags)
>
> Please align and pack those parameters properly.

OK, thanks.

> > +
> > +DEFINE_EVENT(sock_msg_length, sock_recvmsg_length,
> > + TP_PROTO(struct sock *sk, __u16 family, __u16 protocol, int ret,
> > + int flags),
> > +
> > + TP_ARGS(sk, family, protocol, ret, flags)
> > +);
>
> It might be a better idea to remove "msg" from the tracepoint names, in
> case of any confusion with "sendpage". So
> s/sock_sendmsg_length/sock_send_length/ ?

OK, I'll rename both to sock_send_length/sock_recv_length.


> > - return INDIRECT_CALL_INET(sock->ops->recvmsg, inet6_recvmsg,
> > + int ret = INDIRECT_CALL_INET(sock->ops->recvmsg, inet6_recvmsg,
> > inet_recvmsg, sock, msg, msg_data_left(msg),
> > flags);
>
> Please adjust the indentations properly.

Roger that!

Thanks,
Yunhui