gpu: nvgpu: Fix kmem debugging

Make the kmem debugging prints much more easily usable. Previously the
prints would only take effect if the full tracking was enabled:

  CONFIG_NVGPU_TRACK_MEM_USAGE

However, there are many times when just the debug prints would be nice
to have by simply setting the log mask bit in the log mask.

  echo 0x80000 > /sys/kernel/debug/<gpu>/log_mask

Also this change now uses the real nvgpu_log() function instead of the
legacy nvgpu_dbg() function. This makes the logging appear with proper
GPU printing as well.

Change-Id: If545da3d357d38fe8252e7d548c6765b995cd3d7
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1560248
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
Alex Waterman
2017-09-14 13:43:24 -07:00
committed by mobile promotions
parent b9082f0760
commit 3e841d6a37
2 changed files with 47 additions and 24 deletions

View File

@@ -185,8 +185,8 @@ void nvgpu_kmem_cache_free(struct nvgpu_kmem_cache *cache, void *ptr);
*/
#define nvgpu_vfree(g, addr) __nvgpu_vfree(g, addr)
#define kmem_dbg(fmt, args...) \
gk20a_dbg(gpu_dbg_kmem, fmt, ##args)
#define kmem_dbg(g, fmt, args...) \
nvgpu_log(g, gpu_dbg_kmem, fmt, ##args)
/**
* nvgpu_kmem_init - Initialize the kmem tracking stuff.