mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 09:04:39 +02:00
drm/msm: Add mmu prealloc tracepoint
So we can monitor how many pages are getting preallocated vs how many get used. Signed-off-by: Rob Clark <robdclark@chromium.org> Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com> Tested-by: Antonino Maniscalco <antomani103@gmail.com> Reviewed-by: Antonino Maniscalco <antomani103@gmail.com> Patchwork: https://patchwork.freedesktop.org/patch/661521/
This commit is contained in:
parent
0b4339c55e
commit
05a2496834
|
|
@ -205,6 +205,20 @@ TRACE_EVENT(msm_gpu_preemption_irq,
|
|||
TP_printk("preempted to %u", __entry->ring_id)
|
||||
);
|
||||
|
||||
TRACE_EVENT(msm_mmu_prealloc_cleanup,
|
||||
TP_PROTO(u32 count, u32 remaining),
|
||||
TP_ARGS(count, remaining),
|
||||
TP_STRUCT__entry(
|
||||
__field(u32, count)
|
||||
__field(u32, remaining)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->count = count;
|
||||
__entry->remaining = remaining;
|
||||
),
|
||||
TP_printk("count=%u, remaining=%u", __entry->count, __entry->remaining)
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
#undef TRACE_INCLUDE_PATH
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#include <linux/io-pgtable.h>
|
||||
#include <linux/kmemleak.h>
|
||||
#include "msm_drv.h"
|
||||
#include "msm_gpu_trace.h"
|
||||
#include "msm_mmu.h"
|
||||
|
||||
struct msm_iommu {
|
||||
|
|
@ -346,6 +347,9 @@ msm_iommu_pagetable_prealloc_cleanup(struct msm_mmu *mmu, struct msm_mmu_preallo
|
|||
struct kmem_cache *pt_cache = get_pt_cache(mmu);
|
||||
uint32_t remaining_pt_count = p->count - p->ptr;
|
||||
|
||||
if (p->count > 0)
|
||||
trace_msm_mmu_prealloc_cleanup(p->count, remaining_pt_count);
|
||||
|
||||
kmem_cache_free_bulk(pt_cache, remaining_pt_count, &p->pages[p->ptr]);
|
||||
kvfree(p->pages);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user