From: 运辉崔 <cuiyunhui@bytedance.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: mhiramat@kernel.org, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, duanxiongchun@bytedance.com,
kuniyu@amazon.com, linux-kernel@vger.kernel.org,
linux-trace-kernel@vger.kernel.org
Subject: Re: [External] Re: [PATCH v2] sock: add tracepoint for send recv length
Date: Fri, 6 Jan 2023 12:23:41 +0800 [thread overview]
Message-ID: <CAEEQ3wmhAiguPm6K2=q26QRUurcoG+voJrDaDX8rd1KRf_SAgA@mail.gmail.com> (raw)
In-Reply-To: <20230105230737.426abfdd@gandalf.local.home>
On Fri, Jan 6, 2023 at 12:07 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Fri, 6 Jan 2023 11:24:18 +0800
> 运辉崔 <cuiyunhui@bytedance.com> wrote:
>
> > Regardless of whether the MSG_PEEK flag is set or not, it is possible
> > to return -errno,
> > but based on your suggestion, I plan to modify it like this:
> >
> > trace_sock_recvmsg_length(sock->sk, sock->sk->sk_family,
> > sock->sk->sk_protocol,
> > !(flags & MSG_PEEK) ? ret : (ret < 0 ? ret : 0),
> >
> > what do you think?
>
> Sure.
Ok, Thank you.
>
> But note, from your original patch:
>
> > + trace_sock_recvmsg_length(sock->sk, sock->sk->sk_family,
> > + sock->sk->sk_protocol,
> > + (ret > 0 && !(flags & MSG_PEEK)) ?
> > + ret : 0,
> > + (ret > 0 && !(flags & MSG_PEEK)) ? 0 : ret,
> > + flags);
>
> If flags MSG_PEEK is set, you return ret in error regardless, so error
> would be ret even if it was positive.
>
> So I'm guessing that this change actually fixed a bug. ;-)
>
> -- Steve
Ha-ha, seems like it,I will modify these and post v3.
Thanks,
Yunhui
prev parent reply other threads:[~2023-01-06 4:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-05 10:00 [PATCH v2] sock: add tracepoint for send recv length Yunhui Cui
2023-01-05 12:02 ` Paolo Abeni
2023-01-06 2:57 ` [External] " 运辉崔
2023-01-05 14:08 ` Steven Rostedt
2023-01-06 3:24 ` [External] " 运辉崔
2023-01-06 4:07 ` Steven Rostedt
2023-01-06 4:23 ` 运辉崔 [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAEEQ3wmhAiguPm6K2=q26QRUurcoG+voJrDaDX8rd1KRf_SAgA@mail.gmail.com' \
--to=cuiyunhui@bytedance.com \
--cc=davem@davemloft.net \
--cc=duanxiongchun@bytedance.com \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=kuniyu@amazon.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=pabeni@redhat.com \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).