Commit 74c0a69c authored by Rob Clark's avatar Rob Clark

drm/msm/gpu: Add GPU freq_change traces

Technically the GMU specific one is a bit redundant, but it was useful
to track down a bug.
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
Reviewed-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 38c2fa7a
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "a6xx_gpu.h" #include "a6xx_gpu.h"
#include "a6xx_gmu.xml.h" #include "a6xx_gmu.xml.h"
#include "msm_gem.h" #include "msm_gem.h"
#include "msm_gpu_trace.h"
#include "msm_mmu.h" #include "msm_mmu.h"
static void a6xx_gmu_fault(struct a6xx_gmu *gmu) static void a6xx_gmu_fault(struct a6xx_gmu *gmu)
...@@ -124,6 +125,8 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp) ...@@ -124,6 +125,8 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp)
gmu->current_perf_index = perf_index; gmu->current_perf_index = perf_index;
gmu->freq = gmu->gpu_freqs[perf_index]; gmu->freq = gmu->gpu_freqs[perf_index];
trace_msm_gmu_freq_change(gmu->freq, perf_index);
/* /*
* This can get called from devfreq while the hardware is idle. Don't * This can get called from devfreq while the hardware is idle. Don't
* bring up the power if it isn't already active * bring up the power if it isn't already active
......
...@@ -32,6 +32,8 @@ static int msm_devfreq_target(struct device *dev, unsigned long *freq, ...@@ -32,6 +32,8 @@ static int msm_devfreq_target(struct device *dev, unsigned long *freq,
if (IS_ERR(opp)) if (IS_ERR(opp))
return PTR_ERR(opp); return PTR_ERR(opp);
trace_msm_gpu_freq_change(dev_pm_opp_get_freq(opp));
if (gpu->funcs->gpu_set_freq) if (gpu->funcs->gpu_set_freq)
gpu->funcs->gpu_set_freq(gpu, opp); gpu->funcs->gpu_set_freq(gpu, opp);
else else
......
...@@ -83,6 +83,37 @@ TRACE_EVENT(msm_gpu_submit_retired, ...@@ -83,6 +83,37 @@ TRACE_EVENT(msm_gpu_submit_retired,
__entry->start_ticks, __entry->end_ticks) __entry->start_ticks, __entry->end_ticks)
); );
TRACE_EVENT(msm_gpu_freq_change,
TP_PROTO(u32 freq),
TP_ARGS(freq),
TP_STRUCT__entry(
__field(u32, freq)
),
TP_fast_assign(
/* trace freq in MHz to match intel_gpu_freq_change, to make life easier
* for userspace
*/
__entry->freq = DIV_ROUND_UP(freq, 1000000);
),
TP_printk("new_freq=%u", __entry->freq)
);
TRACE_EVENT(msm_gmu_freq_change,
TP_PROTO(u32 freq, u32 perf_index),
TP_ARGS(freq, perf_index),
TP_STRUCT__entry(
__field(u32, freq)
__field(u32, perf_index)
),
TP_fast_assign(
__entry->freq = freq;
__entry->perf_index = perf_index;
),
TP_printk("freq=%u, perf_index=%u", __entry->freq, __entry->perf_index)
);
#endif #endif
#undef TRACE_INCLUDE_PATH #undef TRACE_INCLUDE_PATH
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment