linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: 运辉崔 <cuiyunhui@bytedance.com>
Cc: Eric Dumazet <edumazet@google.com>,
	mhiramat@kernel.org, davem@davemloft.net, kuba@kernel.org,
	pabeni@redhat.com, kuniyu@amazon.com, xiyou.wangcong@gmail.com,
	duanxiongchun@bytedance.com, linux-kernel@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org, netdev@vger.kernel.org,
	dust.li@linux.alibaba.com
Subject: Re: [External] Re: [PATCH v5] sock: add tracepoint for send recv length
Date: Tue, 10 Jan 2023 23:12:01 -0500	[thread overview]
Message-ID: <20230110231201.5eddb889@gandalf.local.home> (raw)
In-Reply-To: <CAEEQ3w=aU3siD-ubhPB3+Wv10ARfUeR=cUHmvdEp2q+y105vAw@mail.gmail.com>

On Wed, 11 Jan 2023 11:53:24 +0800
运辉崔 <cuiyunhui@bytedance.com> wrote:

> Hi Steve, Based on your suggestion, can we use the following code
> instead of using DEFINE_EVENT_PRINT ?

I only suggested it because you didn't have that logic for the
sock_send_length trace event. But if you don't care about that one, then
sure, use it for both.

-- Steve


> 
> DECLARE_EVENT_CLASS(sock_msg_length,
> 
>         TP_PROTO(struct sock *sk, int ret, int flags),
> 
>         TP_ARGS(sk, ret, flags),
> 
>         TP_STRUCT__entry(
>                 __field(void *, sk)
>                 __field(__u16, family)
>                 __field(__u16, protocol)
>                 __field(int, ret)
>                 __field(int, flags)
>         ),
> 
>         TP_fast_assign(
>                 __entry->sk = sk;
>                 __entry->family = sk->sk_family;
>                 __entry->protocol = sk->sk_protocol;
>                 __entry->ret = ret;
>                 __entry->flags = flags;
>         ),
> 
>         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->flags & MSG_PEEK) ?
>                   (__entry->ret > 0 ? __entry->ret : 0) : 0,
>                   __entry->ret < 0 ? __entry->ret : 0,
>                   __entry->flags)
> );


  reply	other threads:[~2023-01-11  4:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-10  9:13 [PATCH v5] sock: add tracepoint for send recv length Yunhui Cui
2023-01-10 11:49 ` Eric Dumazet
2023-01-10 15:44   ` Steven Rostedt
2023-01-11  3:53     ` [External] " 运辉崔
2023-01-11  4:12       ` Steven Rostedt [this message]
2023-01-11  6:17         ` 运辉崔

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=20230110231201.5eddb889@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=cuiyunhui@bytedance.com \
    --cc=davem@davemloft.net \
    --cc=duanxiongchun@bytedance.com \
    --cc=dust.li@linux.alibaba.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=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=xiyou.wangcong@gmail.com \
    /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).