gpu: nvgpu: Condition debug dump on recovery profiling

If recovery sequence profiling is enabled skip the debug dump that
happens during an MMU fault. This prevents the debug dump from
dominating the time spent by the recovery sequence. The debug dump
is severly limited in speed by the (lack of) UART bandwidth.

JIRA NVGPU-5606

Change-Id: Ifc7c326d33d9115d58b13c0fa42ec4bb7acb3075
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2382591
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Alex Waterman
2020-07-20 17:11:05 -05:00
parent d0714b40c1
commit 0f5818b89e
3 changed files with 35 additions and 1 deletions

View File

@@ -44,6 +44,20 @@ static inline u32 matrix_to_linear_index(struct nvgpu_swprofiler *p,
return (row * p->psample_len) + col;
}
/*
* Just check the samples field; it'll be allocated for an enabled profiler.
* This is an intrisically racy call; don't rely on it to determine whether the
* underlying pointers/fields really are initialized or not.
*
* However, since this doesn't take the profiler lock, if you use it under the
* profiler lock, you can be sure the state won't change while you hold the
* lock.
*/
bool nvgpu_swprofile_is_enabled(struct nvgpu_swprofiler *p)
{
return p->samples != NULL;
}
void nvgpu_swprofile_initialize(struct gk20a *g,
struct nvgpu_swprofiler *p,
const char *col_names[])

View File

@@ -232,7 +232,9 @@ void gv11b_fifo_recover(struct gk20a *g, u32 act_eng_bitmask,
#endif
if (rc_type == RC_TYPE_MMU_FAULT) {
gk20a_debug_dump(g);
if (!nvgpu_swprofile_is_enabled(prof)) {
gk20a_debug_dump(g);
}
#ifdef CONFIG_NVGPU_DEBUGGER
client_type = mmufault->client_type;
#endif

View File

@@ -129,6 +129,24 @@ int nvgpu_swprofile_open(struct gk20a *g, struct nvgpu_swprofiler *p);
*/
void nvgpu_swprofile_close(struct nvgpu_swprofiler *p);
/**
* @brief Check if a profiler is enabled.
*
* @param[in] p The profiler to check.
*
* Returns true if the profiler is currently enabled. Do not rely on this
* to ensure that the underlying data and fields remain initialized. This does
* not take the profiler's lock.
*
* However, you can rely on the profiler's state not changing if you take the
* profiler's lock before calling this. In that scenario the profiler's state
* (but not necessarily the actual data) will be unchanged until you release
* the lock.
*
* @return %true if the profiler is enabled; %false otherwise.
*/
bool nvgpu_swprofile_is_enabled(struct nvgpu_swprofiler *p);
/**
* @brief Begin a series of timestamp samples.
*