Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/msm/a6xx: Add traces for preemption

Add trace points corresponding to preemption being triggered and being
completed for latency measurement purposes.

Reviewed-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
Tested-by: Rob Clark <robdclark@gmail.com>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-QRD
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8550-QRD
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8450-HDK
Signed-off-by: Antonino Maniscalco <antomani103@gmail.com>
Patchwork: https://patchwork.freedesktop.org/patch/618026/
Signed-off-by: Rob Clark <robdclark@chromium.org>

authored by

Antonino Maniscalco and committed by
Rob Clark
35d36dc1 50117cad

+34
+6
drivers/gpu/drm/msm/adreno/a6xx_preempt.c
··· 7 7 #include "a6xx_gpu.h" 8 8 #include "a6xx_gmu.xml.h" 9 9 #include "msm_mmu.h" 10 + #include "msm_gpu_trace.h" 10 11 11 12 /* 12 13 * Try to transition the preemption state from old to new. Return ··· 175 174 176 175 set_preempt_state(a6xx_gpu, PREEMPT_NONE); 177 176 177 + trace_msm_gpu_preemption_irq(a6xx_gpu->cur_ring->id); 178 + 178 179 /* 179 180 * Retrigger preemption to avoid a deadlock that might occur when preemption 180 181 * is skipped due to it being already in flight when requested. ··· 296 293 * to be atomic. 297 294 */ 298 295 ring->restore_wptr = false; 296 + 297 + trace_msm_gpu_preemption_trigger(a6xx_gpu->cur_ring->id, 298 + ring ? ring->id : -1); 299 299 300 300 spin_unlock_irqrestore(&ring->preempt_lock, flags); 301 301
+28
drivers/gpu/drm/msm/msm_gpu_trace.h
··· 177 177 TP_printk("%u", __entry->dummy) 178 178 ); 179 179 180 + TRACE_EVENT(msm_gpu_preemption_trigger, 181 + TP_PROTO(int ring_id_from, int ring_id_to), 182 + TP_ARGS(ring_id_from, ring_id_to), 183 + TP_STRUCT__entry( 184 + __field(int, ring_id_from) 185 + __field(int, ring_id_to) 186 + ), 187 + TP_fast_assign( 188 + __entry->ring_id_from = ring_id_from; 189 + __entry->ring_id_to = ring_id_to; 190 + ), 191 + TP_printk("preempting %u -> %u", 192 + __entry->ring_id_from, 193 + __entry->ring_id_to) 194 + ); 195 + 196 + TRACE_EVENT(msm_gpu_preemption_irq, 197 + TP_PROTO(u32 ring_id), 198 + TP_ARGS(ring_id), 199 + TP_STRUCT__entry( 200 + __field(u32, ring_id) 201 + ), 202 + TP_fast_assign( 203 + __entry->ring_id = ring_id; 204 + ), 205 + TP_printk("preempted to %u", __entry->ring_id) 206 + ); 207 + 180 208 #endif 181 209 182 210 #undef TRACE_INCLUDE_PATH