linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Kuen-Han Tsai <khtsai@google.com>,
	Mathias Nyman <mathias.nyman@linux.intel.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] usb: core: Add tracepoints for device allocation and state changes
Date: Tue, 14 Oct 2025 07:17:53 +0200	[thread overview]
Message-ID: <2025101423-caravan-dominoes-0037@gregkh> (raw)
In-Reply-To: <3d4f625f-eecb-4265-ac86-1420d646aa14@rowland.harvard.edu>

On Mon, Oct 13, 2025 at 11:24:47PM -0400, Alan Stern wrote:
> On Tue, Oct 14, 2025 at 08:05:25AM +0800, Kuen-Han Tsai wrote:
> > Hi Alan,
> > 
> > On Mon, Oct 13, 2025 at 9:20 PM Alan Stern <stern@rowland.harvard.edu> wrote:
> > >
> > > Suggestion: Rather than printing the meaningless numerical value of
> > > __entry->state, print the string value returned by
> > > usb_state_string(__entry->state).
> > 
> > I kept it consistent with the udc_log_gadget tracepoint, which also
> > uses the numerical value for the USB state.
> > 
> > If we change the state to a string, should we convert the speed field
> > to a string using usb_speed_string()?
> > 
> > I lean toward keeping both as numerical values, but I am happy to
> > switch both to strings if you prefer. Please let me know what you
> > think is best.
> 
> I agree that if one of them uses strings then so should the other.
> 
> As for whether you should change them...  I don't care very much, since 
> I haven't used tracepoints in my gadget debugging.  I was just thinking 
> of what other people might like.
> 
> Greg, do you have a recommendation?

Strings are always easier for people to understand, otherwise we have to
go look the value up somewhere.  So both should use them.

thanks,

greg k-h

  reply	other threads:[~2025-10-14  5:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-13  2:01 [PATCH 0/2] usb: core: Improve device lifecycle debuggability Kuen-Han Tsai
2025-10-13  2:01 ` [PATCH 1/2] usb: core: Centralize device state update logic Kuen-Han Tsai
2025-10-13 13:16   ` Alan Stern
2025-10-14  0:06     ` Kuen-Han Tsai
2025-10-13  2:01 ` [PATCH 2/2] usb: core: Add tracepoints for device allocation and state changes Kuen-Han Tsai
2025-10-13 13:20   ` Alan Stern
2025-10-14  0:05     ` Kuen-Han Tsai
2025-10-14  3:24       ` Alan Stern
2025-10-14  5:17         ` Greg Kroah-Hartman [this message]
2025-10-14  7:57   ` Greg Kroah-Hartman
2025-10-14 19:37     ` Kuen-Han Tsai

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=2025101423-caravan-dominoes-0037@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=khtsai@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.com \
    --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).