From: Linyu Yuan <quic_linyyuan@quicinc.com>
To: Felipe Balbi <balbi@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: <linux-usb@vger.kernel.org>, Linyu Yuan <quic_linyyuan@quicinc.com>
Subject: [PATCH V4 3/3] usb: gadget: configfs: add function unlink trace entry
Date: Tue, 24 Aug 2021 11:54:41 +0800 [thread overview]
Message-ID: <1629777281-30188-4-git-send-email-quic_linyyuan@quicinc.com> (raw)
In-Reply-To: <1629777281-30188-1-git-send-email-quic_linyyuan@quicinc.com>
add trace in function config_usb_cfg_unlink()
whill show which function was removed from gadget configuraion.
Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
---
drivers/usb/gadget/configfs.c | 4 ++++
drivers/usb/gadget/configfs_trace.h | 17 +++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
index 8c64640..4024f9b 100644
--- a/drivers/usb/gadget/configfs.c
+++ b/drivers/usb/gadget/configfs.c
@@ -479,6 +479,10 @@ static void config_usb_cfg_unlink(
struct usb_function_instance, group);
struct usb_function *f;
+ trace_config_usb_cfg_unlink(config_item_name(&gi->group.cg_item),
+ config_item_name(usb_cfg_ci),
+ config_item_name(usb_func_ci));
+
/*
* ideally I would like to forbid to unlink functions while a gadget is
* bound to an UDC. Since this isn't possible at the moment, we simply
diff --git a/drivers/usb/gadget/configfs_trace.h b/drivers/usb/gadget/configfs_trace.h
index 5c666f1..82e0121 100644
--- a/drivers/usb/gadget/configfs_trace.h
+++ b/drivers/usb/gadget/configfs_trace.h
@@ -43,6 +43,23 @@ TRACE_EVENT(config_usb_cfg_link,
__get_str(cfg_name), __get_str(func_name))
);
+TRACE_EVENT(config_usb_cfg_unlink,
+ TP_PROTO(char *name, char *cfg, char *func),
+ TP_ARGS(name, cfg, func),
+ TP_STRUCT__entry(
+ __string(group_name, name)
+ __string(cfg_name, cfg)
+ __string(func_name, func)
+ ),
+ TP_fast_assign(
+ __assign_str(group_name, name);
+ __assign_str(cfg_name, cfg);
+ __assign_str(func_name, func)
+ ),
+ TP_printk("gadget:%s cfg:%s unlink func:%s", __get_str(group_name),
+ __get_str(cfg_name), __get_str(func_name))
+);
+
#endif /* __GADGET_TRACE_H */
/* this part has to be here */
--
2.7.4
prev parent reply other threads:[~2021-08-24 3:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-24 3:54 [PATCH V4 0/3] usb: gadget: configfs: add three trace entries Linyu Yuan
2021-08-24 3:54 ` [PATCH V4 1/3] usb: gadget: configfs: add UDC trace entry Linyu Yuan
2021-08-24 8:15 ` Felipe Balbi
2021-08-24 8:29 ` Felipe Balbi
2021-08-24 10:07 ` Linyu Yuan (QUIC)
2021-08-24 10:41 ` Felipe Balbi
2021-08-25 9:37 ` Linyu Yuan (QUIC)
2021-08-25 10:50 ` Felipe Balbi
2021-08-24 3:54 ` [PATCH V4 2/3] usb: gadget: configfs: add function link " Linyu Yuan
2021-08-24 3:54 ` 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=1629777281-30188-4-git-send-email-quic_linyyuan@quicinc.com \
--to=quic_linyyuan@quicinc.com \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.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).