[PATCH v2 2/2] PM / Domains: Add trace event for genpd_set_performance_state
From: Matthias Kaehlcke
Date: Wed Oct 02 2019 - 14:37:56 EST
Tracking the performance state can be useful for
debugging/understanding power domain behavior.
Signed-off-by: Matthias Kaehlcke <mka@xxxxxxxxxxxx>
---
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