mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: add knob to control fecs_trace feature
Currently, NVGPU_SUPPORT_FECS_CTXSW_TRACE enabled flag is set to true when fecs_trace s/w setup is executed successfully. Sometimes, fecs_trace is required to be disabled for debugging. This change will help disable/enable fecs_trace feature by modifying one of the enabled flags. Enable NVGPU_SUPPORT_FECS_CTXSW_TRACE during chip specific hal init. Control fec_trace init and ctxsw dev open depending on NVGPU_SUPPORT_FECS_CTXSW_TRACE flag status. JIRA NVGPU-5616 Change-Id: Id0754a5af7cd95a67a1f0ae5de36115d44e1111b Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2357501 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Alex Waterman
parent
8fbc4e5b56
commit
9d723a5f1f
@@ -26,6 +26,7 @@
|
||||
#include <nvgpu/barrier.h>
|
||||
#include <nvgpu/gk20a.h>
|
||||
#include <nvgpu/channel.h>
|
||||
#include <nvgpu/enabled.h>
|
||||
#include <nvgpu/gr/fecs_trace.h>
|
||||
#include <nvgpu/string.h>
|
||||
#include <nvgpu/nvgpu_init.h>
|
||||
@@ -325,6 +326,11 @@ int gk20a_ctxsw_dev_open(struct inode *inode, struct file *filp)
|
||||
if (!g)
|
||||
return -ENODEV;
|
||||
|
||||
if (!nvgpu_is_enabled(g, NVGPU_SUPPORT_FECS_CTXSW_TRACE)) {
|
||||
nvgpu_put(&l->g);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
nvgpu_log(g, gpu_dbg_fn|gpu_dbg_ctxsw, "g=%p", g);
|
||||
|
||||
if (!capable(CAP_SYS_ADMIN)) {
|
||||
@@ -576,7 +582,7 @@ int gk20a_ctxsw_trace_init(struct gk20a *g)
|
||||
nvgpu_log(g, gpu_dbg_fn|gpu_dbg_ctxsw, "g=%p trace=%p", g, trace);
|
||||
|
||||
/* if tracing is not supported, skip this */
|
||||
if (!g->ops.gr.fecs_trace.init)
|
||||
if (!nvgpu_is_enabled(g, NVGPU_SUPPORT_FECS_CTXSW_TRACE))
|
||||
return 0;
|
||||
|
||||
if (likely(trace))
|
||||
|
||||
Reference in New Issue
Block a user