Skip to contentSkip to conversation

tracing/power: Polish the tracepoints cpu_idle and cpu_frequency

PATCH Steven Rostedt 3 participants 4 messages Feb 14, 2018 – Feb 28, 2018 4 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Steven Rostedt

author Acked-by
#1 lore raw

[ Resending due to typo in LKML address ]

Quoted 12 lines · On Wed, 14 Feb 2018 10:40:38 +0800 [email protected] wrote:

From: Changbin Du <[email protected]>

The type of state is signed int, convert it to unsigned int looks weird. (-1 become 4294967295)
932.123 power:cpu_idle:state=1 cpu_id=0)
932.125 power:cpu_idle:state=4294967295 cpu_id=0)
932.132 power:cpu_idle:state=1 cpu_id=0)
932.133 power:cpu_idle:state=4294967295 cpu_id=0)

Similarly for cpu_frequency as "state=%lu cpu_id=%lu". User need to read the code to understand what 'state' means.

Quoted 6 lines

No functional change in this patch.

Cc Steven Rostedt (VMware) <[email protected]>

From the tracing perspective:

-- Steve

Quoted 79 lines

---
v2:
o rename title.
o define tracepoint with DEFINE_EVENT_PRINT().

---
 Documentation/trace/events-power.txt |  4 ++--
 include/trace/events/power.h         | 17 ++++++++++-------
 2 files changed, 12 insertions(+), 9 deletions(-)
Documentation/trace/events-power.txt +2 -2
index 21d514c..9485039 100644
@@ -23,8 +23,8 @@ Cf. include/trace/events/power.h for the events definitions.
 A 'cpu' event class gathers the CPU-related events: cpuidle and
 cpufreq.
 
-cpu_idle		"state=%lu cpu_id=%lu"
-cpu_frequency		"state=%lu cpu_id=%lu"
+cpu_idle		"state=%ld cpu_id=%lu"
+cpu_frequency		"frequency=%lu cpu_id=%lu"
 
 A suspend event is used to indicate the system going in and out of the
 suspend mode:
include/trace/events/power.h +10 -7
index 908977d..f1b82de 100644
@@ -14,12 +14,12 @@
 
 DECLARE_EVENT_CLASS(cpu,
 
-	TP_PROTO(unsigned int state, unsigned int cpu_id),
+	TP_PROTO(int state, unsigned int cpu_id),
 
 	TP_ARGS(state, cpu_id),
 
 	TP_STRUCT__entry(
-		__field(	u32,		state		)
+		__field(	s32,		state		)
 		__field(	u32,		cpu_id		)
 	),
 
@@ -28,13 +28,13 @@ DECLARE_EVENT_CLASS(cpu,
 		__entry->cpu_id = cpu_id;
 	),
 
-	TP_printk("state=%lu cpu_id=%lu", (unsigned long)__entry->state,
+	TP_printk("state=%ld cpu_id=%lu", (long)__entry->state,
 		  (unsigned long)__entry->cpu_id)
 );
 
 DEFINE_EVENT(cpu, cpu_idle,
 
-	TP_PROTO(unsigned int state, unsigned int cpu_id),
+	TP_PROTO(int state, unsigned int cpu_id),
 
 	TP_ARGS(state, cpu_id)
 );
@@ -141,11 +141,14 @@ TRACE_EVENT(pstate_sample,
 		{ PM_EVENT_RESTORE, "restore" }, \
 		{ PM_EVENT_RECOVER, "recover" })
 
-DEFINE_EVENT(cpu, cpu_frequency,
+DEFINE_EVENT_PRINT(cpu, cpu_frequency,
 
-	TP_PROTO(unsigned int frequency, unsigned int cpu_id),
+	TP_PROTO(int state, unsigned int cpu_id),
 
-	TP_ARGS(frequency, cpu_id)
+	TP_ARGS(state, cpu_id),
+
+	TP_printk("frequency=%lu cpu_id=%lu",  (unsigned long)__entry->state,
+		  (unsigned long)__entry->cpu_id)
 );
 
 TRACE_EVENT(device_pm_callback_start,

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw
Quoted 11 lines · Steven Rostedt
Quoted 7 lines · Changbin
Quoted 6 lines

From the tracing perspective:

-- Steve

Hi Steve, will you pick this or someoneelse?

Quoted 9 lines

I maintain the tracing infrastructure, but the tracing use cases are maintained by the maintainers of the users of the trace events. That is, who added these trace events? They are the ones most affected by these changes.

For example, it looks like Rafael J. Wysocki, is the one that added trace_cpu_frequency(). He's the one that is affected by this change, and is the one that you need to have take it.

Got it, thanks!

Hi Wysocki, could you take a look?

Quoted 2 lines

-- Steve

Signature · 2 lines
Thanks,
Changbin Du
#6 lore raw
Quoted 16 lines · Changbin
Quoted 15 lines · Steven Rostedt
Quoted 7 lines · Changbin
Quoted 6 lines

From the tracing perspective:

-- Steve

Hi Steve, will you pick this or someoneelse?

I maintain the tracing infrastructure, but the tracing use cases are maintained by the maintainers of the users of the trace events. That is, who added these trace events? They are the ones most affected by these changes.

Quoted 7 lines
Quoted 4 lines

For example, it looks like Rafael J. Wysocki, is the one that added trace_cpu_frequency(). He's the one that is affected by this change, and is the one that you need to have take it.

Got it, thanks!

Hi Wysocki, could you take a look?

Please send the patch(es) to [email protected] with a CC to me and I will take care of them.

Thanks,
Rafael

#7 lore raw
Quoted 20 lines · Rafael J. Wysocki
Quoted 19 lines · Changbin
Quoted 18 lines · Steven Rostedt
Quoted 6 lines · Changbin
Quoted 5 lines

From the tracing perspective:

-- Steve

Hi Steve, will you pick this or someoneelse?

I maintain the tracing infrastructure, but the tracing use cases are maintained by the maintainers of the users of the trace events. That is, who added these trace events? They are the ones most affected by these changes.

For example, it looks like Rafael J. Wysocki, is the one that added trace_cpu_frequency(). He's the one that is affected by this change, and is the one that you need to have take it.

Quoted 7 lines
Quoted 3 lines

Got it, thanks!

Hi Wysocki, could you take a look?

Please send the patch(es) to [email protected] with a CC to me and I will take care of them.

sure~

Quoted 3 lines

Thanks,
Rafael

Signature · 2 lines
Thanks,
Changbin Du