aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorVilas Bhat <vilasbhat@google.com>2024-02-21 19:47:53 +0000
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-02-22 20:27:39 +0100
commit015abee404760249a5c968b9ce29216b94b8ced1 (patch)
treef5dc5aacadc46fa210ef43aa54d934fef9552bd2 /drivers/base
parentb7d46644e554ed017dfabc0841acf418d0584bc9 (diff)
downloadlinux-015abee404760249a5c968b9ce29216b94b8ced1.tar.gz
PM: runtime: add tracepoint for runtime_status changes
Existing runtime PM ftrace events (`rpm_suspend`, `rpm_resume`, `rpm_return_int`) offer limited visibility into the exact timing of device runtime power state transitions, particularly when asynchronous operations are involved. When the `rpm_suspend` or `rpm_resume` functions are invoked with the `RPM_ASYNC` flag, a return value of 0 i.e., success merely indicates that the device power state request has been queued, not that the device has yet transitioned. A new ftrace event, `rpm_status`, is introduced. This event directly logs the `power.runtime_status` value of a device whenever it changes providing granular tracking of runtime power state transitions regardless of synchronous or asynchronous `rpm_suspend` / `rpm_resume` usage. Signed-off-by: Vilas Bhat <vilasbhat@google.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/runtime.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 5275a6b2e980bb..2ee45841486bc7 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -94,6 +94,7 @@ static void update_pm_runtime_accounting(struct device *dev)
static void __update_runtime_status(struct device *dev, enum rpm_status status)
{
update_pm_runtime_accounting(dev);
+ trace_rpm_status(dev, status);
dev->power.runtime_status = status;
}