From: Linyu Yuan <quic_linyyuan@quicinc.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
Peter Chen <peter.chen@kernel.org>,
Pawel Laszczak <pawell@cadence.com>,
Roger Quadros <rogerq@kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
Chunfeng Yun <chunfeng.yun@mediatek.com>,
Neal Liu <neal_liu@aspeedtech.com>,
Cristian Birsan <cristian.birsan@microchip.com>,
Bin Liu <b-liu@ti.com>, Kevin Cernekee <cernekee@gmail.com>,
Justin Chen <justin.chen@broadcom.com>,
Al Cooper <alcooperx@gmail.com>, Li Yang <leoyang.li@nxp.com>,
Vladimir Zapolskiy <vz@mleia.com>,
Daniel Mack <daniel@zonque.org>,
Haojian Zhuang <haojian.zhuang@gmail.com>,
Robert Jarzmik <robert.jarzmik@free.fr>,
Philipp Zabel <p.zabel@pengutronix.de>,
Herve Codina <herve.codina@bootlin.com>,
hierry Reding <thierry.reding@gmail.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
Michal Simek <michal.simek@amd.com>,
Rui Miguel Silva <rui.silva@linaro.org>,
Valentina Manea <valentina.manea.m@gmail.com>,
Shuah Khan <shuah@kernel.org>, Hongren Zheng <i@zenithal.me>,
<linux-usb@vger.kernel.org>
Subject: Re: [PATCH v2 00/11] usb: gadget: reduce usb gadget trace event buffer usage
Date: Mon, 11 Sep 2023 21:56:08 +0800 [thread overview]
Message-ID: <0661ca9a-20d5-7fab-7cef-cd037e660cf2@quicinc.com> (raw)
In-Reply-To: <2023091135-gave-phoniness-bf17@gregkh>
On 9/11/2023 9:48 PM, Greg Kroah-Hartman wrote:
> On Mon, Sep 11, 2023 at 09:44:21PM +0800, Linyu Yuan wrote:
>> On 9/11/2023 9:32 PM, Greg Kroah-Hartman wrote:
>>> On Mon, Sep 11, 2023 at 07:24:35PM +0800, Linyu Yuan wrote:
>>>> some trace event use an interger to to save a bit field info of gadget,
>>>> also some trace save endpoint name in string forat, it all can be
>>>> chagned to other way at trace event store phase.
>>>>
>>>> bit field can be replace with a union interger member which include
>>>> multiple bit fields.
>>>>
>>>> ep name stringe can be replace to a interger which contaion number
>>>> and dir info.
>>> Ok, but how much memory did you actually save here? Is the memory saved
>>> only if tracing is enbaled, or it is always? Is there a speed penality
>>> for these changes or is it the same?
>> yes, it is save trace ring buffer only when tracing enabled, as save less
>> data, speed is higher.
> Are you sure? You now have to parse the data, so how is it faster?
i mean when enable tracing and save less entry data to ring buffer, it
will faster.
i didn't pay attention to runtime parse data, as i think ring buffer is
important,
in most case, after issue happen, we can write tool to parse it from dump,
there is no runtime parse.
>
>> it is help when enable trace for a long period.
> Help exactly how? What is saved exactly, and what about cpu usage?
consider trace ring buffer is a default size, if every trace entry
smaller, it will save
more entries.
>
>> for a single trace entry, take struct usb_gadget as example, at worst case,
>> it save (19 dword - 1 dword) / 19dword = 94% buffer.
>>
>> for ep name, it only need 4 bytes/ (4bytes + 9bytes ) = 30%.
> And this buffer size reduction shows up where? Are you trading space
> for CPU time? Somehow you are ending up with the same information in
> userspace, so where are the tradeoffs?
>
> thanks,
>
> greg k-h
prev parent reply other threads:[~2023-09-11 21:41 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-11 11:24 [PATCH v2 00/11] usb: gadget: reduce usb gadget trace event buffer usage Linyu Yuan
2023-09-11 11:24 ` [PATCH v2 01/11] usb: gadget: add anonymous definition in struct usb_gadget Linyu Yuan
2023-09-11 11:37 ` Greg Kroah-Hartman
2023-09-11 13:20 ` Linyu Yuan
2023-09-11 11:24 ` [PATCH v2 02/11] usb: gadget: add anonymous definition in struct usb_request Linyu Yuan
2023-09-11 11:24 ` [PATCH v2 03/11] usb: gadget: add anonymous definition in struct usb_ep Linyu Yuan
2023-09-11 11:24 ` [PATCH v2 04/11] usb: udc: assign epnum for each usb endpoint Linyu Yuan
2023-09-11 11:24 ` [PATCH v2 05/11] usb: udc: trace: reduce buffer usage of trace event Linyu Yuan
2023-09-11 11:24 ` [PATCH v2 06/11] usb: cdns3: cdnsp: " Linyu Yuan
2023-09-11 11:24 ` [PATCH v2 07/11] usb: cdns3: trace: " Linyu Yuan
2023-09-11 11:24 ` [PATCH v2 08/11] usb: dwc3: " Linyu Yuan
2023-09-11 11:24 ` [PATCH v2 09/11] usb: cdns2: " Linyu Yuan
2023-09-11 11:24 ` [PATCH v2 10/11] usb: mtu3: " Linyu Yuan
2023-09-11 13:33 ` Greg Kroah-Hartman
2023-09-11 11:24 ` [PATCH v2 11/11] usb: musb: " Linyu Yuan
2023-09-11 13:32 ` [PATCH v2 00/11] usb: gadget: reduce usb gadget trace event buffer usage Greg Kroah-Hartman
2023-09-11 13:44 ` Linyu Yuan
2023-09-11 13:48 ` Greg Kroah-Hartman
2023-09-11 13:56 ` Linyu Yuan [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=0661ca9a-20d5-7fab-7cef-cd037e660cf2@quicinc.com \
--to=quic_linyyuan@quicinc.com \
--cc=Thinh.Nguyen@synopsys.com \
--cc=alcooperx@gmail.com \
--cc=b-liu@ti.com \
--cc=cernekee@gmail.com \
--cc=chunfeng.yun@mediatek.com \
--cc=cristian.birsan@microchip.com \
--cc=daniel@zonque.org \
--cc=gregkh@linuxfoundation.org \
--cc=haojian.zhuang@gmail.com \
--cc=herve.codina@bootlin.com \
--cc=i@zenithal.me \
--cc=jonathanh@nvidia.com \
--cc=justin.chen@broadcom.com \
--cc=leoyang.li@nxp.com \
--cc=linus.walleij@linaro.org \
--cc=linux-usb@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=neal_liu@aspeedtech.com \
--cc=p.zabel@pengutronix.de \
--cc=pawell@cadence.com \
--cc=peter.chen@kernel.org \
--cc=robert.jarzmik@free.fr \
--cc=rogerq@kernel.org \
--cc=rui.silva@linaro.org \
--cc=shuah@kernel.org \
--cc=thierry.reding@gmail.com \
--cc=valentina.manea.m@gmail.com \
--cc=vz@mleia.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