gpu: nvgpu: abstract submit profiling

Add gk20a_fifo_profile_snapshot() to store the submit time in a
profiling entry that was acquired from gk20a_fifo_profile_acquire().
Also get rid of ifdef CONFIG_DEBUG_FS by stubbing the acquire and free
functions when debugfs is not enabled. This reduces some cyclomatic
complexity in the submit path.

Jira NVGPU-708

Change-Id: I39829a6475cfe3aa582620219e420bde62228e52
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1729545
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Konsta Holtta
2018-05-22 12:59:02 +03:00
committed by mobile promotions
parent 45d0a9c711
commit cae514120b
4 changed files with 32 additions and 18 deletions

View File

@@ -19,6 +19,7 @@
#include <linux/seq_file.h>
#include <nvgpu/sort.h>
#include <nvgpu/timers.h>
void __gk20a_fifo_profile_free(struct nvgpu_ref *ref);
@@ -325,6 +326,12 @@ void gk20a_fifo_debugfs_init(struct gk20a *g)
}
void gk20a_fifo_profile_snapshot(struct fifo_profile_gk20a *profile, int idx)
{
if (profile)
profile->timestamp[idx] = nvgpu_current_time_ns();
}
void __gk20a_fifo_profile_free(struct nvgpu_ref *ref)
{
struct fifo_gk20a *f = container_of(ref, struct fifo_gk20a,