* [PATCH] thermal: trace: migrating thermal traces to use TRACE_DEFINE_ENUM() macros
@ 2016-03-01 17:38 Michele Di Giorgio
2016-03-01 18:20 ` Steven Rostedt
0 siblings, 1 reply; 6+ messages in thread
From: Michele Di Giorgio @ 2016-03-01 17:38 UTC (permalink / raw)
To: linux-pm
Cc: Ingo Molnar, Javi Merino, linux-kernel, Punit Agrawal,
Michele Di Giorgio, Steven Rostedt, Eduardo Valentin
Userspace tools are not aware of how to convert the enums provided by
the tracepoints to their corresponding strings.
Adding TRACE_DEFINE_ENUM() macros allows to make the enums available
to userspace to let the tools know what those enum values represent.
In particular, for thermal zone trip types what we obtained before was
something like:
kworker/1:1-460 [001] 320.372732: thermal_zone_trip: thermal_zone=soc
id=0 trip=1 trip_type=1
Unfortunately, userspace tools do not know how to convert enum values to
strings and as a consequence they can only forward the enum value to the
output. By using TRACE_DEFINE_ENUM() macros for thermal traces we get the
following trace line:
kworker/1:1-460 [001] 320.372732: thermal_zone_trip: thermal_zone=soc
id=0 trip=1 trip_type=PASSIVE
Userspace tools are now able to better understand the meaning of the trip_type
and provide the user with more readable information.
CC: Steven Rostedt <rostedt@goodmis.org>
CC: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Michele Di Giorgio <michele.digiorgio@arm.com>
---
include/trace/events/thermal.h | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/include/trace/events/thermal.h b/include/trace/events/thermal.h
index 5738bb3..2b4a8ff 100644
--- a/include/trace/events/thermal.h
+++ b/include/trace/events/thermal.h
@@ -8,6 +8,18 @@
#include <linux/thermal.h>
#include <linux/tracepoint.h>
+TRACE_DEFINE_ENUM(THERMAL_TRIP_CRITICAL);
+TRACE_DEFINE_ENUM(THERMAL_TRIP_HOT);
+TRACE_DEFINE_ENUM(THERMAL_TRIP_PASSIVE);
+TRACE_DEFINE_ENUM(THERMAL_TRIP_ACTIVE);
+
+#define show_tzt_type(type) \
+ __print_symbolic(type, \
+ { THERMAL_TRIP_CRITICAL, "CRITICAL"}, \
+ { THERMAL_TRIP_HOT, "HOT"}, \
+ { THERMAL_TRIP_PASSIVE, "PASSIVE"}, \
+ { THERMAL_TRIP_ACTIVE, "ACTIVE"})
+
TRACE_EVENT(thermal_temperature,
TP_PROTO(struct thermal_zone_device *tz),
@@ -73,9 +85,9 @@ TRACE_EVENT(thermal_zone_trip,
__entry->trip_type = trip_type;
),
- TP_printk("thermal_zone=%s id=%d trip=%d trip_type=%d",
+ TP_printk("thermal_zone=%s id=%d trip=%d trip_type=%s",
__get_str(thermal_zone), __entry->id, __entry->trip,
- __entry->trip_type)
+ show_tzt_type(__entry->trip_type))
);
TRACE_EVENT(thermal_power_cpu_get_power,
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] thermal: trace: migrating thermal traces to use TRACE_DEFINE_ENUM() macros
2016-03-01 17:38 [PATCH] thermal: trace: migrating thermal traces to use TRACE_DEFINE_ENUM() macros Michele Di Giorgio
@ 2016-03-01 18:20 ` Steven Rostedt
2016-03-03 17:10 ` Michele DiGiorgio
0 siblings, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2016-03-01 18:20 UTC (permalink / raw)
To: Michele Di Giorgio
Cc: linux-pm, Ingo Molnar, Javi Merino, linux-kernel, Punit Agrawal,
Eduardo Valentin
On Tue, 1 Mar 2016 17:38:54 +0000
Michele Di Giorgio <michele.digiorgio@arm.com> wrote:
> Userspace tools are not aware of how to convert the enums provided by
> the tracepoints to their corresponding strings.
>
> Adding TRACE_DEFINE_ENUM() macros allows to make the enums available
> to userspace to let the tools know what those enum values represent.
>
> In particular, for thermal zone trip types what we obtained before was
> something like:
>
> kworker/1:1-460 [001] 320.372732: thermal_zone_trip: thermal_zone=soc
> id=0 trip=1 trip_type=1
>
> Unfortunately, userspace tools do not know how to convert enum values to
> strings and as a consequence they can only forward the enum value to the
> output. By using TRACE_DEFINE_ENUM() macros for thermal traces we get the
> following trace line:
>
> kworker/1:1-460 [001] 320.372732: thermal_zone_trip: thermal_zone=soc
> id=0 trip=1 trip_type=PASSIVE
>
> Userspace tools are now able to better understand the meaning of the trip_type
> and provide the user with more readable information.
>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
-- Steve
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] thermal: trace: migrating thermal traces to use TRACE_DEFINE_ENUM() macros
2016-03-01 18:20 ` Steven Rostedt
@ 2016-03-03 17:10 ` Michele DiGiorgio
2016-03-03 17:28 ` Steven Rostedt
2016-03-08 9:48 ` Zhang, Rui
0 siblings, 2 replies; 6+ messages in thread
From: Michele DiGiorgio @ 2016-03-03 17:10 UTC (permalink / raw)
To: Steven Rostedt
Cc: linux-pm, Ingo Molnar, Javi Merino, linux-kernel, Punit Agrawal,
Eduardo Valentin
Hello Steven,
Thanks for acknowledging the patch.
Will you be merging it or should I refer to somebody else?
Kind regards,
Michele
On 01/03/16 18:20, Steven Rostedt wrote:
> On Tue, 1 Mar 2016 17:38:54 +0000
> Michele Di Giorgio <michele.digiorgio@arm.com> wrote:
>
> > Userspace tools are not aware of how to convert the enums provided by
> > the tracepoints to their corresponding strings.
> >
> > Adding TRACE_DEFINE_ENUM() macros allows to make the enums available
> > to userspace to let the tools know what those enum values represent.
> >
> > In particular, for thermal zone trip types what we obtained before was
> > something like:
> >
> > kworker/1:1-460 [001] 320.372732: thermal_zone_trip: thermal_zone=soc
> > id=0 trip=1 trip_type=1
> >
> > Unfortunately, userspace tools do not know how to convert enum values to
> > strings and as a consequence they can only forward the enum value to the
> > output. By using TRACE_DEFINE_ENUM() macros for thermal traces we get the
> > following trace line:
> >
> > kworker/1:1-460 [001] 320.372732: thermal_zone_trip: thermal_zone=soc
> > id=0 trip=1 trip_type=PASSIVE
> >
> > Userspace tools are now able to better understand the meaning of the trip_type
> > and provide the user with more readable information.
> >
>
> Acked-by: Steven Rostedt <rostedt@goodmis.org>
>
> -- Steve
>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] thermal: trace: migrating thermal traces to use TRACE_DEFINE_ENUM() macros
2016-03-03 17:10 ` Michele DiGiorgio
@ 2016-03-03 17:28 ` Steven Rostedt
2016-03-08 9:48 ` Zhang, Rui
1 sibling, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2016-03-03 17:28 UTC (permalink / raw)
To: Michele DiGiorgio
Cc: linux-pm, Ingo Molnar, Javi Merino, linux-kernel, Punit Agrawal,
Eduardo Valentin
On Thu, 3 Mar 2016 17:10:46 +0000
Michele DiGiorgio <michele.digiorgio@arm.com> wrote:
> Hello Steven,
>
> Thanks for acknowledging the patch.
>
> Will you be merging it or should I refer to somebody else?
>
It should go through the Thermal maintainer's tree.
-- Steve
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] thermal: trace: migrating thermal traces to use TRACE_DEFINE_ENUM() macros
2016-03-03 17:10 ` Michele DiGiorgio
2016-03-03 17:28 ` Steven Rostedt
@ 2016-03-08 9:48 ` Zhang, Rui
2016-03-08 9:58 ` Javi Merino
1 sibling, 1 reply; 6+ messages in thread
From: Zhang, Rui @ 2016-03-08 9:48 UTC (permalink / raw)
To: Michele DiGiorgio, Steven Rostedt
Cc: linux-pm@vger.kernel.org, Ingo Molnar, Javi Merino,
linux-kernel@vger.kernel.org, Punit Agrawal, Eduardo Valentin
Punit and Javi,
What do you think of this? I'd like to get your ACK before taking it.
Thanks,
rui
> -----Original Message-----
> From: linux-pm-owner@vger.kernel.org [mailto:linux-pm-
> owner@vger.kernel.org] On Behalf Of Michele DiGiorgio
> Sent: Friday, March 04, 2016 1:11 AM
> To: Steven Rostedt <rostedt@goodmis.org>
> Cc: linux-pm@vger.kernel.org; Ingo Molnar <mingo@redhat.com>; Javi
> Merino <javi.merino@arm.com>; linux-kernel@vger.kernel.org; Punit
> Agrawal <punit.agrawal@arm.com>; Eduardo Valentin <edubezval@gmail.com>
> Subject: Re: [PATCH] thermal: trace: migrating thermal traces to use
> TRACE_DEFINE_ENUM() macros
>
> Hello Steven,
>
> Thanks for acknowledging the patch.
>
> Will you be merging it or should I refer to somebody else?
>
> Kind regards,
> Michele
>
> On 01/03/16 18:20, Steven Rostedt wrote:
> > On Tue, 1 Mar 2016 17:38:54 +0000
> > Michele Di Giorgio <michele.digiorgio@arm.com> wrote:
> >
> > > Userspace tools are not aware of how to convert the enums provided
> > > by the tracepoints to their corresponding strings.
> > >
> > > Adding TRACE_DEFINE_ENUM() macros allows to make the enums available
> > > to userspace to let the tools know what those enum values represent.
> > >
> > > In particular, for thermal zone trip types what we obtained before
> > > was something like:
> > >
> > > kworker/1:1-460 [001] 320.372732: thermal_zone_trip:
> thermal_zone=soc
> > > id=0 trip=1 trip_type=1
> > >
> > > Unfortunately, userspace tools do not know how to convert enum
> > > values to strings and as a consequence they can only forward the
> > > enum value to the output. By using TRACE_DEFINE_ENUM() macros for
> > > thermal traces we get the following trace line:
> > >
> > > kworker/1:1-460 [001] 320.372732: thermal_zone_trip:
> thermal_zone=soc
> > > id=0 trip=1 trip_type=PASSIVE
> > >
> > > Userspace tools are now able to better understand the meaning of the
> > > trip_type and provide the user with more readable information.
> > >
> >
> > Acked-by: Steven Rostedt <rostedt@goodmis.org>
> >
> > -- Steve
> >
>
> IMPORTANT NOTICE: The contents of this email and any attachments are
> confidential and may also be privileged. If you are not the intended recipient,
> please notify the sender immediately and do not disclose the contents to any
> other person, use it for any purpose, or store or copy the information in any
> medium. Thank you.
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body
> of a message to majordomo@vger.kernel.org More majordomo info at
> http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] thermal: trace: migrating thermal traces to use TRACE_DEFINE_ENUM() macros
2016-03-08 9:48 ` Zhang, Rui
@ 2016-03-08 9:58 ` Javi Merino
0 siblings, 0 replies; 6+ messages in thread
From: Javi Merino @ 2016-03-08 9:58 UTC (permalink / raw)
To: Zhang, Rui
Cc: Michele DiGiorgio, Steven Rostedt, linux-pm@vger.kernel.org,
Ingo Molnar, linux-kernel@vger.kernel.org, Punit Agrawal,
Eduardo Valentin
On Tue, Mar 08, 2016 at 09:48:42AM +0000, Zhang, Rui wrote:
> Punit and Javi,
>
> What do you think of this? I'd like to get your ACK before taking it.
Sorry, I didn't realize you were waiting for us. I'm quite happy for
this to go in:
Acked-by: Javi Merino <javi.merino@arm.com>
> > -----Original Message-----
> > From: linux-pm-owner@vger.kernel.org [mailto:linux-pm-
> > owner@vger.kernel.org] On Behalf Of Michele DiGiorgio
> > Sent: Friday, March 04, 2016 1:11 AM
> > To: Steven Rostedt <rostedt@goodmis.org>
> > Cc: linux-pm@vger.kernel.org; Ingo Molnar <mingo@redhat.com>; Javi
> > Merino <javi.merino@arm.com>; linux-kernel@vger.kernel.org; Punit
> > Agrawal <punit.agrawal@arm.com>; Eduardo Valentin <edubezval@gmail.com>
> > Subject: Re: [PATCH] thermal: trace: migrating thermal traces to use
> > TRACE_DEFINE_ENUM() macros
> >
> > Hello Steven,
> >
> > Thanks for acknowledging the patch.
> >
> > Will you be merging it or should I refer to somebody else?
> >
> > Kind regards,
> > Michele
> >
> > On 01/03/16 18:20, Steven Rostedt wrote:
> > > On Tue, 1 Mar 2016 17:38:54 +0000
> > > Michele Di Giorgio <michele.digiorgio@arm.com> wrote:
> > >
> > > > Userspace tools are not aware of how to convert the enums provided
> > > > by the tracepoints to their corresponding strings.
> > > >
> > > > Adding TRACE_DEFINE_ENUM() macros allows to make the enums available
> > > > to userspace to let the tools know what those enum values represent.
> > > >
> > > > In particular, for thermal zone trip types what we obtained before
> > > > was something like:
> > > >
> > > > kworker/1:1-460 [001] 320.372732: thermal_zone_trip:
> > thermal_zone=soc
> > > > id=0 trip=1 trip_type=1
> > > >
> > > > Unfortunately, userspace tools do not know how to convert enum
> > > > values to strings and as a consequence they can only forward the
> > > > enum value to the output. By using TRACE_DEFINE_ENUM() macros for
> > > > thermal traces we get the following trace line:
> > > >
> > > > kworker/1:1-460 [001] 320.372732: thermal_zone_trip:
> > thermal_zone=soc
> > > > id=0 trip=1 trip_type=PASSIVE
> > > >
> > > > Userspace tools are now able to better understand the meaning of the
> > > > trip_type and provide the user with more readable information.
> > > >
> > >
> > > Acked-by: Steven Rostedt <rostedt@goodmis.org>
> > >
> > > -- Steve
> > >
> >
> > IMPORTANT NOTICE: The contents of this email and any attachments are
> > confidential and may also be privileged. If you are not the intended recipient,
> > please notify the sender immediately and do not disclose the contents to any
> > other person, use it for any purpose, or store or copy the information in any
> > medium. Thank you.
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body
> > of a message to majordomo@vger.kernel.org More majordomo info at
> > http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-03-08 9:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-01 17:38 [PATCH] thermal: trace: migrating thermal traces to use TRACE_DEFINE_ENUM() macros Michele Di Giorgio
2016-03-01 18:20 ` Steven Rostedt
2016-03-03 17:10 ` Michele DiGiorgio
2016-03-03 17:28 ` Steven Rostedt
2016-03-08 9:48 ` Zhang, Rui
2016-03-08 9:58 ` Javi Merino
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).