From: Dave Airlie <airlied@xxxxxxxxxx> This just adds a tracepoint that can be caught in perf for when the clocks change. Signed-off-by: Dave Airlie <airlied@xxxxxxxxxx> --- drivers/gpu/drm/radeon/radeon_pm.c | 3 +++ drivers/gpu/drm/radeon/radeon_trace.h | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index 6fabe89..2a44332 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c @@ -30,6 +30,7 @@ #include <linux/power_supply.h> #include <linux/hwmon.h> #include <linux/hwmon-sysfs.h> +#include "radeon_trace.h" #define RADEON_IDLE_LOOP_MS 100 #define RADEON_RECLOCK_DELAY_MS 200 @@ -165,6 +166,8 @@ static void radeon_set_power_state(struct radeon_device *rdev) (rdev->pm.requested_power_state_index == rdev->pm.current_power_state_index)) return; + trace_radeon_set_power_state(rdev); + if (radeon_gui_idle(rdev)) { sclk = rdev->pm.power_state[rdev->pm.requested_power_state_index]. clock_info[rdev->pm.requested_clock_mode_index].sclk; diff --git a/drivers/gpu/drm/radeon/radeon_trace.h b/drivers/gpu/drm/radeon/radeon_trace.h index eafd816..ef0fd05 100644 --- a/drivers/gpu/drm/radeon/radeon_trace.h +++ b/drivers/gpu/drm/radeon/radeon_trace.h @@ -27,6 +27,24 @@ TRACE_EVENT(radeon_bo_create, TP_printk("bo=%p, pages=%u", __entry->bo, __entry->pages) ); +TRACE_EVENT(radeon_set_power_state, + TP_PROTO(struct radeon_device *rdev), + TP_ARGS(rdev), + TP_STRUCT__entry( + __field(int, requested_clock_mode) + __field(int, current_clock_mode) + __field(int, requested_power_state) + __field(int, current_power_state) + ), + TP_fast_assign( + __entry->requested_clock_mode = rdev->pm.requested_clock_mode_index; + __entry->current_clock_mode = rdev->pm.current_clock_mode_index; + __entry->requested_power_state = rdev->pm.requested_power_state_index; + __entry->current_power_state = rdev->pm.current_power_state_index; + ), + TP_printk("clock %d->%d, power %d->%d", __entry->current_clock_mode, __entry->requested_clock_mode, __entry->current_power_state, __entry->requested_power_state) +); + DECLARE_EVENT_CLASS(radeon_fence_request, TP_PROTO(struct drm_device *dev, u32 seqno), -- 1.7.6 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/dri-devel