All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Thierry Reding <thierry.reding@gmail.com>,
	Conor Dooley <conor.dooley@microchip.com>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	linux-pwm@vger.kernel.org
Subject: Re: [PATCH v2 02/11] pwm/tracing: Also record trace events for failed API calls
Date: Thu, 1 Dec 2022 08:09:38 +0100	[thread overview]
Message-ID: <20221201070938.nk2ifi52dwtuenq7@pengutronix.de> (raw)
In-Reply-To: <20221130151511.7f0d4fa3@gandalf.local.home>

[-- Attachment #1: Type: text/plain, Size: 3010 bytes --]

Hello Steven,

On Wed, Nov 30, 2022 at 03:15:11PM -0500, Steven Rostedt wrote:
> On Wed, 30 Nov 2022 16:21:39 +0100
> Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:
> 
> > diff --git a/include/trace/events/pwm.h b/include/trace/events/pwm.h
> > index cf243de41cc8..12b35e4ff917 100644
> > --- a/include/trace/events/pwm.h
> > +++ b/include/trace/events/pwm.h
> > @@ -10,9 +10,9 @@
> >  
> >  DECLARE_EVENT_CLASS(pwm,
> >  
> > -	TP_PROTO(struct pwm_device *pwm, const struct pwm_state *state),
> > +	TP_PROTO(struct pwm_device *pwm, const struct pwm_state *state, int err),
> >  
> > -	TP_ARGS(pwm, state),
> > +	TP_ARGS(pwm, state, err),
> >  
> >  	TP_STRUCT__entry(
> >  		__field(struct pwm_device *, pwm)
> > @@ -20,6 +20,7 @@ DECLARE_EVENT_CLASS(pwm,
> >  		__field(u64, duty_cycle)
> >  		__field(enum pwm_polarity, polarity)
> >  		__field(bool, enabled)
> > +		__field(int, err)
> >  	),
> 
> If you are changing this, perhaps order it a bit like:
> 
>         TP_STRUCT__entry(
>                 __field(u64, period)
>                 __field(u64, duty_cycle)
>                 __field(struct pwm_device *, pwm)
>                 __field(enum pwm_polarity, polarity)
>                 __field(bool, enabled)
>                 __field(int, err)
>         ),
> 
> And that way the struct pwm_device pointer will not cause a 4 byte hole on
> 32bit architectures.

I'd do that in a separate patch, thanks for the feedback.

> >  	TP_fast_assign(
> > @@ -28,28 +29,27 @@ DECLARE_EVENT_CLASS(pwm,
> >  		__entry->duty_cycle = state->duty_cycle;
> >  		__entry->polarity = state->polarity;
> >  		__entry->enabled = state->enabled;
> > +		__entry->err = err;
> >  	),
> >  
> > -	TP_printk("%p: period=%llu duty_cycle=%llu polarity=%d enabled=%d",
> > +	TP_printk("%p: period=%llu duty_cycle=%llu polarity=%d enabled=%d err=%d",
> >  		  __entry->pwm, __entry->period, __entry->duty_cycle,
> > -		  __entry->polarity, __entry->enabled)
> > +		  __entry->polarity, __entry->enabled, __entry->err)
> 
> Hmm, and why not show the values here:
> 
> TRACE_DEFINE_ENUM(PWM_POLARITY_NORMAL);
> TRACE_DEFINE_ENUM(PWM_POLARITY_INVERSED);
> 
> 	TP_printk("%p: period=%llu duty_cycle=%llu polarity=%s enabled=%d err=%d",
>  		  __entry->pwm, __entry->period, __entry->duty_cycle,
> 		  __print_symbolic(__entry->polarity,
> 			{PWM_POLARITY_NORMAL, "normal"},
> 			{PWM_POLARITY_INVERSED, "inversed"}),
> 			__entry->enabled, __entry->err)

Ditto.

@Thierry: While the suggestions by Steven are cleanups that usually come
first in a series and only then new stuff is added, I suggest to be not
religious about that and implement these in patches based on this
series.

Independent of that, I'll wait some time to give others a change for
feedback.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2022-12-01  7:09 UTC|newest]

Thread overview: 153+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-30 15:21 [PATCH v2 00/11] pwm: Allow .get_state to fail Uwe Kleine-König
2022-11-30 15:21 ` Uwe Kleine-König
2022-11-30 15:21 ` Uwe Kleine-König
2022-11-30 15:21 ` Uwe Kleine-König
2022-11-30 15:21 ` Uwe Kleine-König
2022-11-30 15:21 ` [PATCH v2 01/11] pwm: Make .get_state() callback return an error code Uwe Kleine-König
2022-11-30 15:21   ` Uwe Kleine-König
2022-11-30 15:21   ` Uwe Kleine-König
2022-11-30 15:21   ` Uwe Kleine-König
2022-11-30 15:21   ` Uwe Kleine-König
2022-11-30 18:36   ` Heiko Stübner
2022-11-30 18:36     ` Heiko Stübner
2022-11-30 18:36     ` Heiko Stübner
2022-11-30 18:36     ` Heiko Stübner
2022-11-30 18:36     ` Heiko Stübner
2022-12-01  1:17   ` Baolin Wang
2022-12-01  1:17     ` Baolin Wang
2022-12-01  1:17     ` Baolin Wang
2022-12-01  1:17     ` Baolin Wang
2022-12-01  1:17     ` Baolin Wang
2022-12-01  2:41   ` Tzung-Bi Shih
2022-12-01  2:41     ` Tzung-Bi Shih
2022-12-01  2:41     ` Tzung-Bi Shih
2022-12-01  2:41     ` Tzung-Bi Shih
2022-12-01  2:41     ` Tzung-Bi Shih
2022-12-01  8:03   ` Neil Armstrong
2022-12-01  8:03     ` Neil Armstrong
2022-12-01  8:03     ` Neil Armstrong
2022-12-01  8:03     ` Neil Armstrong
2022-12-01  8:03     ` Neil Armstrong
2022-12-01  9:30   ` nobuhiro1.iwamatsu
2022-12-01  9:30     ` nobuhiro1.iwamatsu
2022-12-01  9:30     ` nobuhiro1.iwamatsu
2022-12-01  9:30     ` nobuhiro1.iwamatsu
2022-12-01  9:30     ` nobuhiro1.iwamatsu
2022-12-01 10:22   ` Andre Przywara
2022-12-01 10:22     ` Andre Przywara
2022-12-01 10:22     ` Andre Przywara
2022-12-01 10:22     ` Andre Przywara
2022-12-01 10:22     ` Andre Przywara
2022-12-01 13:16     ` Uwe Kleine-König
2022-12-01 13:16       ` Uwe Kleine-König
2022-12-01 13:16       ` Uwe Kleine-König
2022-12-01 13:16       ` Uwe Kleine-König
2022-12-01 13:16       ` Uwe Kleine-König
2022-12-01 14:17       ` Andre Przywara
2022-12-01 14:17         ` Andre Przywara
2022-12-01 14:17         ` Andre Przywara
2022-12-01 14:17         ` Andre Przywara
2022-12-01 14:17         ` Andre Przywara
2022-12-01 10:43   ` Dave Stevenson
2022-12-01 10:43     ` Dave Stevenson
2022-12-01 10:43     ` Dave Stevenson
2022-12-01 10:43     ` Dave Stevenson
2022-12-01 10:43     ` Dave Stevenson
2022-12-01 15:37   ` Doug Anderson
2022-12-01 15:37     ` Doug Anderson
2022-12-01 15:37     ` Doug Anderson
2022-12-01 15:37     ` Doug Anderson
2022-12-01 15:37     ` Doug Anderson
2022-12-05 20:50   ` Jernej Škrabec
2022-12-05 20:50     ` Jernej Škrabec
2022-12-05 20:50     ` Jernej Škrabec
2022-12-05 20:50     ` Jernej Škrabec
2022-12-05 20:50     ` Jernej Škrabec
2022-12-05 22:30   ` Pavel Machek
2022-12-05 22:30     ` Pavel Machek
2022-12-05 22:30     ` Pavel Machek
2022-12-05 22:30     ` Pavel Machek
2022-12-05 22:30     ` Pavel Machek
2022-11-30 15:21 ` [PATCH v2 02/11] pwm/tracing: Also record trace events for failed API calls Uwe Kleine-König
2022-11-30 20:15   ` Steven Rostedt
2022-12-01  7:09     ` Uwe Kleine-König [this message]
2022-11-30 15:21 ` [PATCH v2 03/11] drm/bridge: ti-sn65dsi86: Propagate errors in .get_state() to the caller Uwe Kleine-König
2022-11-30 15:21   ` Uwe Kleine-König
2022-12-01 15:37   ` Doug Anderson
2022-12-01 15:37     ` Doug Anderson
2022-12-04 21:09   ` Uwe Kleine-König
2022-12-04 21:09     ` Uwe Kleine-König
2022-12-04 21:31     ` Laurent Pinchart
2022-12-04 21:31       ` Laurent Pinchart
2022-12-05 15:25     ` Doug Anderson
2022-12-05 15:25       ` Doug Anderson
2022-11-30 15:21 ` [PATCH v2 04/11] leds: qcom-lpg: " Uwe Kleine-König
2022-12-04 21:04   ` Uwe Kleine-König
2022-12-04 22:28     ` Pavel Machek
2022-12-05 22:31   ` Pavel Machek
2023-01-04 16:56     ` Lee Jones
2023-01-05 13:54       ` Uwe Kleine-König
2023-01-05 16:29         ` Lee Jones
2022-11-30 15:21 ` [PATCH v2 05/11] pwm: crc: " Uwe Kleine-König
2022-11-30 15:21 ` [PATCH v2 06/11] pwm: cros-ec: " Uwe Kleine-König
2022-12-01  2:41   ` Tzung-Bi Shih
2022-11-30 15:21 ` [PATCH v2 07/11] pwm: imx27: " Uwe Kleine-König
2022-11-30 15:21   ` Uwe Kleine-König
2022-11-30 15:21 ` [PATCH v2 08/11] pwm: mtk-disp: " Uwe Kleine-König
2022-11-30 15:21   ` Uwe Kleine-König
2022-12-01 13:11   ` AngeloGioacchino Del Regno
2022-12-01 13:11     ` AngeloGioacchino Del Regno
2022-11-30 15:21 ` [PATCH v2 09/11] pwm: rockchip: " Uwe Kleine-König
2022-11-30 15:21   ` Uwe Kleine-König
2022-11-30 15:21   ` Uwe Kleine-König
2022-11-30 18:37   ` Heiko Stübner
2022-11-30 18:37     ` Heiko Stübner
2022-11-30 18:37     ` Heiko Stübner
2022-11-30 15:21 ` [PATCH v2 10/11] pwm: sprd: " Uwe Kleine-König
2022-12-01  1:18   ` Baolin Wang
2022-11-30 15:21 ` [PATCH v2 11/11] pwm: Handle .get_state() failures Uwe Kleine-König
2022-12-01 11:11 ` [PATCH v2 00/11] pwm: Allow .get_state to fail Conor Dooley
2022-12-01 11:11   ` Conor Dooley
2022-12-01 11:11   ` Conor Dooley
2022-12-01 11:11   ` Conor Dooley
2022-12-01 11:11   ` Conor Dooley
2022-12-01 13:19   ` Uwe Kleine-König
2022-12-01 13:19     ` Uwe Kleine-König
2022-12-01 13:19     ` Uwe Kleine-König
2022-12-01 13:19     ` Uwe Kleine-König
2022-12-01 13:19     ` Uwe Kleine-König
2022-12-01 13:28     ` Conor Dooley
2022-12-01 13:28       ` Conor Dooley
2022-12-01 13:28       ` Conor Dooley
2022-12-01 13:28       ` Conor Dooley
2022-12-01 13:28       ` Conor Dooley
2022-12-09 21:47 ` Andy Shevchenko
2022-12-09 21:47   ` Andy Shevchenko
2022-12-09 21:47   ` Andy Shevchenko
2022-12-09 21:47   ` Andy Shevchenko
2022-12-09 21:47   ` Andy Shevchenko
2022-12-09 21:47   ` Andy Shevchenko
2022-12-10  9:18   ` Uwe Kleine-König
2022-12-10  9:18     ` Uwe Kleine-König
2022-12-10  9:18     ` Uwe Kleine-König
2022-12-10  9:18     ` Uwe Kleine-König
2022-12-10  9:18     ` Uwe Kleine-König
2022-12-10  9:18     ` Uwe Kleine-König
2022-12-10 20:57     ` Andy Shevchenko
2022-12-10 20:57       ` Andy Shevchenko
2022-12-10 20:57       ` Andy Shevchenko
2022-12-10 20:57       ` Andy Shevchenko
2022-12-10 20:57       ` Andy Shevchenko
2022-12-10 20:57       ` Andy Shevchenko
2022-12-10 22:41       ` Uwe Kleine-König
2022-12-10 22:41         ` Uwe Kleine-König
2022-12-10 22:41         ` Uwe Kleine-König
2022-12-10 22:41         ` Uwe Kleine-König
2022-12-10 22:41         ` Uwe Kleine-König
2022-12-10 22:41         ` Uwe Kleine-König
2022-12-11 13:31         ` Andy Shevchenko
2022-12-11 13:31           ` Andy Shevchenko
2022-12-11 13:31           ` Andy Shevchenko
2022-12-11 13:31           ` Andy Shevchenko
2022-12-11 13:31           ` Andy Shevchenko
2022-12-11 13:31           ` Andy Shevchenko

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=20221201070938.nk2ifi52dwtuenq7@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=conor.dooley@microchip.com \
    --cc=linux-pwm@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=thierry.reding@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.