From 707ea45e0f1d7a07885597777496b186dd5fb6f0 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Wed, 11 Jan 2017 15:00:54 -0800 Subject: gpu: nvgpu: kmem abstraction and tracking Implement kmem abstraction and tracking in nvgpu. The abstraction helps move nvgpu's core code away from being Linux dependent and allows kmem allocation tracking to be done for Linux and any other OS supported by nvgpu. Bug 1799159 Bug 1823380 Change-Id: Ieaae4ca1bbd1d4db4a1546616ab8b9fc53a4079d Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1283828 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 8006a4fe..69528c1f 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -27,6 +27,7 @@ struct gk20a_ctxsw_ucode_segments; struct gk20a_fecs_trace; struct gk20a_ctxsw_trace; struct acr_desc; +struct nvgpu_mem_alloc_tracker; #include #include @@ -915,6 +916,7 @@ struct gk20a { struct dentry *debugfs_runlist_interleave; struct dentry *debugfs_allocators; struct dentry *debugfs_xve; + struct dentry *debugfs_kmem; #endif struct gk20a_ctxsw_ucode_info ctxsw_ucode_info; @@ -1055,6 +1057,10 @@ struct gk20a { /* Check if msi is enabled */ bool msi_enabled; #endif +#ifdef CONFIG_NVGPU_TRACK_MEM_USAGE + struct nvgpu_mem_alloc_tracker *vmallocs; + struct nvgpu_mem_alloc_tracker *kmallocs; +#endif }; static inline unsigned long gk20a_get_gr_idle_timeout(struct gk20a *g) @@ -1131,6 +1137,7 @@ enum gk20a_dbg_categories { gpu_dbg_pmu_pstate = BIT(17), /* p state controlled by pmu */ gpu_dbg_xv = BIT(18), /* XVE debugging */ gpu_dbg_shutdown = BIT(19), /* GPU shutdown tracing */ + gpu_dbg_kmem = BIT(20), /* Kmem tracking debugging */ gpu_dbg_mem = BIT(31), /* memory accesses, very verbose */ }; -- cgit v1.2.2