[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20191002113736.v2.2.I366ab5442f66ddff643948c6923cc6916ddfd840@changeid>
Date: Wed, 2 Oct 2019 11:37:43 -0700
From: Matthias Kaehlcke <mka@...omium.org>
To: "Rafael J . Wysocki" <rjw@...ysocki.net>,
Kevin Hilman <khilman@...nel.org>,
Ulf Hansson <ulf.hansson@...aro.org>,
Len Brown <len.brown@...el.com>, Pavel Machek <pavel@....cz>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...hat.com>
Cc: Douglas Anderson <dianders@...omium.org>,
Matthias Kaehlcke <mka@...omium.org>, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 2/2] PM / Domains: Add trace event for genpd_set_performance_state
Tracking the performance state can be useful for
debugging/understanding power domain behavior.
Signed-off-by: Matthias Kaehlcke <mka@...omium.org>
---
Changes in v2:
- split original patch in two, one for genpd_set_performance_state
one for genpd_power_on/off
- updated commit message (original subject was "PM / Domains: Add
tracepoints")
drivers/base/power/domain.c | 3 +++
include/trace/events/power.h | 18 ++++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 88eff9c4e79a..1130b984808d 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -332,6 +332,9 @@ static int _genpd_set_performance_state(struct generic_pm_domain *genpd,
goto err;
genpd->performance_state = state;
+
+ trace_genpd_set_performance_state(genpd);
+
return 0;
err:
diff --git a/include/trace/events/power.h b/include/trace/events/power.h
index d92cb53c20ed..2c2c7bb5bef0 100644
--- a/include/trace/events/power.h
+++ b/include/trace/events/power.h
@@ -559,6 +559,24 @@ DEFINE_EVENT(genpd_power_on_off, genpd_power_off,
TP_ARGS(genpd)
);
+
+TRACE_EVENT(genpd_set_performance_state,
+ TP_PROTO(struct generic_pm_domain *genpd),
+
+ TP_ARGS(genpd),
+
+ TP_STRUCT__entry(
+ __string(name, genpd->name)
+ __field(unsigned int, state)
+ ),
+
+ TP_fast_assign(
+ __assign_str(name, genpd->name);
+ __entry->state = genpd->performance_state;
+ ),
+
+ TP_printk("name=%s state=%u", __get_str(name), __entry->state)
+);
#endif /* CONFIG_PM_GENERIC_DOMAINS */
#endif /* _TRACE_POWER_H */
--
2.23.0.444.g18eeb5a265-goog
Powered by blists - more mailing lists