From dd875bb8d1fc5fa5e94eaaeafc18eb1409c21171 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Wed, 29 Apr 2020 20:21:59 +0530 Subject: [PATCH] gpu: nvgpu: add custom log prints for profiler Define new flag gpu_dbg_prof for profiler specific debug prints. Add debug prints to existing profiler specific functions. Bug 2510974 Change-Id: Ifee6af2b6efe7b29f1337b6d8c89fd2156e1e2ca Signed-off-by: Deepak Nibade Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2365676 Reviewed-by: automaticguardword Reviewed-by: Konsta Holtta Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/profiler/profiler.c | 8 +++++++- drivers/gpu/nvgpu/include/nvgpu/log_common.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/common/profiler/profiler.c b/drivers/gpu/nvgpu/common/profiler/profiler.c index 1ff9654eb..6e6e84184 100644 --- a/drivers/gpu/nvgpu/common/profiler/profiler.c +++ b/drivers/gpu/nvgpu/common/profiler/profiler.c @@ -38,7 +38,7 @@ int nvgpu_profiler_alloc(struct gk20a *g, struct nvgpu_profiler_object *prof; *_prof = NULL; - nvgpu_log(g, gpu_dbg_fn | gpu_dbg_gpu_dbg, " "); + nvgpu_log(g, gpu_dbg_prof, " "); prof = nvgpu_kzalloc(g, sizeof(*prof)); if (prof == NULL) { @@ -51,6 +51,9 @@ int nvgpu_profiler_alloc(struct gk20a *g, nvgpu_init_list_node(&prof->prof_obj_entry); nvgpu_list_add(&prof->prof_obj_entry, &g->profiler_objects); + nvgpu_log(g, gpu_dbg_prof, "Allocated profiler handle %u", + prof->prof_handle); + *_prof = prof; return 0; } @@ -59,6 +62,9 @@ void nvgpu_profiler_free(struct nvgpu_profiler_object *prof) { struct gk20a *g = prof->g; + nvgpu_log(g, gpu_dbg_prof, "Free profiler handle %u", + prof->prof_handle); + nvgpu_list_del(&prof->prof_obj_entry); nvgpu_kfree(g, prof); } diff --git a/drivers/gpu/nvgpu/include/nvgpu/log_common.h b/drivers/gpu/nvgpu/include/nvgpu/log_common.h index 215cc65e5..b4f797e50 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/log_common.h +++ b/drivers/gpu/nvgpu/include/nvgpu/log_common.h @@ -66,6 +66,7 @@ enum nvgpu_log_type { #define gpu_dbg_clk_arb BIT(26) /* Clk arbiter debugging. */ #define gpu_dbg_event BIT(27) /* Events to User debugging. */ #define gpu_dbg_vsrv BIT(28) /* server debugging. */ +#define gpu_dbg_prof BIT(29) /* GPU profiler object debugging. */ #define gpu_dbg_mem BIT(31) /* memory accesses; very verbose. */ #define gpu_dbg_device BIT(32) /* Device initialization and querying. */