lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJNZHTRmxm-s=4ytRinS4pBxNsSkBqLMyXjRnwWfAm0HzRw43Q@mail.gmail.com>
Date: Wed, 21 Feb 2024 10:40:58 -0800
From: Vilas Bhat <vilasbhat@...gle.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>, Pavel Machek <pavel@....cz>, Len Brown <len.brown@...el.com>, 
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Masami Hiramatsu <mhiramat@...nel.org>, 
	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>, Saravana Kannan <saravanak@...gle.com>, 
	kernel-team@...roid.com, linux-pm@...r.kernel.org, 
	linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org
Subject: Re: [PATCH v1] PM: runtime: add tracepoint for runtime_status changes

On Wed, Feb 21, 2024 at 10:33 AM Steven Rostedt <rostedt@...dmis.org> wrote:
>
> On Wed, 21 Feb 2024 09:57:03 -0800
> Vilas Bhat <vilasbhat@...gle.com> wrote:
>
> > > You could do what everyone else does:
> > >
> > > #define RPM_STATUS_STRINGS                      \
> > >         EM( RPM_INVALID, "RPM_INVALID" )        \
> > >         EM( RPM_ACTIVE, "RPM_ACTIVE" )          \
> > >         EM( RPM_RESUMING, "RPM_RESUMING" )      \
> > >         EM( RPM_SUSPENDED, "RPM_SUSPENDED" )    \
> > >         EMe( RPM_SUSPENDING, "RPM_SUSPENDING" )
> > >
> > > #undef EM
> > > #undef EMe
> > > #define EM(a, b)        TRACE_DEFINE_ENUM(a);
> > > #define EMe(a, b)       TRACE_DEFINE_ENUM(a);
> > >
> > > RPM_STATUS_STRINGS
> > >
> > > #undef EM
> > > #undef EMe
> > > #define EM(a, b)        { a, b },
> > > #define EMe(a, b)       { a, b }
> > >
> >
> > Thanks for the comment, Steven. I did notice both methods of defining
> > enum values for tracepoints and chose this method because it felt
> > clearer. Could you clarify on why the method you suggested is
> > preferred?
> >
>
> Sure. One big reason: It removes duplication.
>
> If you add another enum to the list, you only need to update it in one
> place. And it prevents the two from getting out of sync.
>
> -- Steve

That makes sense! Thanks. I will revise the patch and send a new version soon.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ