@@ -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:
@@ -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 */
Tracking the performance state can be useful for debugging/understanding power domain behavior. Signed-off-by: Matthias Kaehlcke <mka@chromium.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(+)