From: Linyu Yuan <quic_linyyuan@quicinc.com>
To: 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>,
Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Cc: <linux-usb@vger.kernel.org>, <linux-trace-kernel@vger.kernel.org>,
"Linyu Yuan" <quic_linyyuan@quicinc.com>
Subject: [PATCH 8/8] usb: musb: trace: reduce buffer usage of trace event
Date: Thu, 14 Sep 2023 18:03:02 +0800 [thread overview]
Message-ID: <20230914100302.30274-9-quic_linyyuan@quicinc.com> (raw)
In-Reply-To: <20230914100302.30274-1-quic_linyyuan@quicinc.com>
Save u32 member into trace event ring buffer and parse it for possible
bit information.
Use DECLARE_EVENT_CLASS_PRINT_INIT() related macro for output stage.
Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
---
drivers/usb/musb/musb_trace.h | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/usb/musb/musb_trace.h b/drivers/usb/musb/musb_trace.h
index f246b14394c4..8add5e81ed8d 100644
--- a/drivers/usb/musb/musb_trace.h
+++ b/drivers/usb/musb/musb_trace.h
@@ -233,7 +233,7 @@ DEFINE_EVENT(musb_urb, musb_urb_deq,
TP_ARGS(musb, urb)
);
-DECLARE_EVENT_CLASS(musb_req,
+DECLARE_EVENT_CLASS_PRINT_INIT(musb_req,
TP_PROTO(struct musb_request *req),
TP_ARGS(req),
TP_STRUCT__entry(
@@ -243,9 +243,7 @@ DECLARE_EVENT_CLASS(musb_req,
__field(int, status)
__field(unsigned int, buf_len)
__field(unsigned int, actual_len)
- __field(unsigned int, zero)
- __field(unsigned int, short_not_ok)
- __field(unsigned int, no_interrupt)
+ __field(u32, rdw1)
),
TP_fast_assign(
__entry->req = &req->request;
@@ -254,18 +252,20 @@ DECLARE_EVENT_CLASS(musb_req,
__entry->status = req->request.status;
__entry->buf_len = req->request.length;
__entry->actual_len = req->request.actual;
- __entry->zero = req->request.zero;
- __entry->short_not_ok = req->request.short_not_ok;
- __entry->no_interrupt = req->request.no_interrupt;
+ __entry->rdw1 = req->request.dw1;
),
TP_printk("%p, ep%d %s, %s%s%s, len %d/%d, status %d",
__entry->req, __entry->epnum,
__entry->is_tx ? "tx/IN" : "rx/OUT",
- __entry->zero ? "Z" : "z",
- __entry->short_not_ok ? "S" : "s",
- __entry->no_interrupt ? "I" : "i",
+ tr.zero ? "Z" : "z",
+ tr.short_not_ok ? "S" : "s",
+ tr.no_interrupt ? "I" : "i",
__entry->actual_len, __entry->buf_len,
__entry->status
+ ),
+ TP_printk_init(
+ struct usb_request tr;
+ tr.dw1 = __entry->rdw1;
)
);
--
2.17.1
next prev parent reply other threads:[~2023-09-14 10:04 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
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 ` Linyu Yuan [this message]
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=20230914100302.30274-9-quic_linyyuan@quicinc.com \
--to=quic_linyyuan@quicinc.com \
--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=rogerq@kernel.org \
--cc=rostedt@goodmis.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