linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Linyu Yuan <quic_linyyuan@quicinc.com>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Chunfeng Yun <chunfeng.yun@mediatek.com>, Bin Liu <b-liu@ti.com>,
	Peter Chen <peter.chen@kernel.org>,
	Pawel Laszczak <pawell@cadence.com>,
	Roger Quadros <rogerq@kernel.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	<linux-usb@vger.kernel.org>, <linux-trace-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/8] usb: udc: trace: reduce buffer usage of trace event
Date: Thu, 14 Sep 2023 22:16:44 -0400	[thread overview]
Message-ID: <20230914221644.6f4517b3@rorschach.local.home> (raw)
In-Reply-To: <dc54b48f-f2ad-9948-f50f-a6f2c004c77c@quicinc.com>

On Fri, 15 Sep 2023 09:11:06 +0800
Linyu Yuan <quic_linyyuan@quicinc.com> wrote:

> >> +		snprintf(__s, 9, "ep%d%s", te.address, \
> >> +			(te.caps.dir_in && te.caps.dir_out) ? "" : \
> >> +			te.caps.dir_in ? "in" : "out");  
> > Note, there's a temp buffer trace_seq 'p' available for use as well. See
> > both include/trace/events/libata.h and include/trace/events/scsi.h:
> >
> >    const char *libata_trace_parse_status(struct trace_seq*, unsigned char);
> >    #define __parse_status(s) libata_trace_parse_status(p, s)
> >
> > I think that can be used instead of adding this TP_printk_init().  
> 
> 
> the reason add TP_printk_init() because when i first design some macro 
> which not
> 
> related to tracepoint,  it use too much stack.
> 

Not sure what you mean about 'uses too much stack'. This is called by
the reading code and not some arbitrary location, and the above macros
are done in the same location as your "init" call, so I'm not sure how
that makes a difference on the stack.

> 
> but i think  TP_printk_init()  is good as it following most common way 
> to print.
> 

I really do not want to add more versions of TRACE_EVENT() that I need
to maintain unless there is a really good reason to do so.

And I really don't want to encourage the use of a "TP_printk_init()"
because that just encourages more use cases that will make it hard for
user space to parse the TP_printk().

-- Steve

  reply	other threads:[~2023-09-15  2:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-14 10:02 [PATCH 0/8] usb: gadget: reduce usb gadget trace event buffer usage Linyu Yuan
2023-09-14 10:02 ` [PATCH 1/8] trace: add new DECLARE_EVENT_CLASS_PRINT_INIT class type Linyu Yuan
2023-09-14 14:29   ` kernel test robot
2023-09-14 10:02 ` [PATCH 2/8] usb: gadget: add anonymous definition in some struct for trace purpose Linyu Yuan
2023-09-14 14:54   ` Alan Stern
2023-09-15  1:02     ` Linyu Yuan
2023-09-15  1:51       ` Alan Stern
2023-09-15  1:56         ` Linyu Yuan
2023-09-14 10:02 ` [PATCH 3/8] usb: udc: trace: reduce buffer usage of trace event Linyu Yuan
2023-09-14 16:54   ` Steven Rostedt
2023-09-15  1:11     ` Linyu Yuan
2023-09-15  2:16       ` Steven Rostedt [this message]
2023-09-15  2:25         ` Linyu Yuan
2023-09-14 10:02 ` [PATCH 4/8] usb: cdns3: " Linyu Yuan
2023-09-14 10:02 ` [PATCH 5/8] usb: dwc3: " Linyu Yuan
2023-09-14 10:03 ` [PATCH 6/8] usb: cdns2: " Linyu Yuan
2023-09-14 10:03 ` [PATCH 7/8] usb: mtu3: " Linyu Yuan
2023-09-14 10:03 ` [PATCH 8/8] usb: musb: " Linyu Yuan
2023-09-14 16:42 ` [PATCH 0/8] usb: gadget: reduce usb gadget trace event buffer usage Steven Rostedt

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=20230914221644.6f4517b3@rorschach.local.home \
    --to=rostedt@goodmis.org \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=b-liu@ti.com \
    --cc=chunfeng.yun@mediatek.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=pawell@cadence.com \
    --cc=peter.chen@kernel.org \
    --cc=quic_linyyuan@quicinc.com \
    --cc=rogerq@kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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).