All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpuidle: add tracepoint for enter_s2idle flow
@ 2025-05-20  3:09 qiwu.chen
  2025-05-20 23:27 ` kernel test robot
  2025-05-22 18:01 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: qiwu.chen @ 2025-05-20  3:09 UTC (permalink / raw)
  To: rafael, daniel.lezcano; +Cc: linux-pm, qiwu.chen

Add the tracepoint cpu_idle in enter_s2idle_proper for tracing
the enter and exit events with a determined idle state.

Signed-off-by: qiwu.chen <qiwu.chen@transsion.com>
---
 drivers/cpuidle/cpuidle.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index 0835da449db8..9ff8fa5db444 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -147,6 +147,7 @@ static noinstr void enter_s2idle_proper(struct cpuidle_driver *drv,
 	struct cpuidle_state *target_state = &drv->states[index];
 	ktime_t time_start, time_end;
 
+	trace_cpu_idle(index, dev->cpu);
 	instrumentation_begin();
 
 	time_start = ns_to_ktime(local_clock_noinstr());
@@ -178,6 +179,7 @@ static noinstr void enter_s2idle_proper(struct cpuidle_driver *drv,
 	dev->states_usage[index].s2idle_time += ktime_us_delta(time_end, time_start);
 	dev->states_usage[index].s2idle_usage++;
 	instrumentation_end();
+	trace_cpu_idle(PWR_EVENT_EXIT, dev->cpu);
 }
 
 /**
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-05-22 18:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-20  3:09 [PATCH] cpuidle: add tracepoint for enter_s2idle flow qiwu.chen
2025-05-20 23:27 ` kernel test robot
2025-05-22 18:01 ` kernel test robot

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.