From d914e662aef07cc2c3c58971ad21a9cc5fa0ce4d Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Thu, 17 May 2018 15:33:29 +0300 Subject: gpu: nvgpu: use nvgpu_current_time_ns in submit profiling Replace Linux-specific and dubious sched_clock() with common nvgpu_current_time_ns(). sched_clock() used also nanoseconds. Jira NVGPU-708 Change-Id: I70f992fe42cc9c3ffed374fdebd582867475e84f Signed-off-by: Konsta Holtta Reviewed-on: https://git-master.nvidia.com/r/1723202 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/channel.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/common/linux/channel.c') diff --git a/drivers/gpu/nvgpu/common/linux/channel.c b/drivers/gpu/nvgpu/common/linux/channel.c index 88bc2009..e2a10634 100644 --- a/drivers/gpu/nvgpu/common/linux/channel.c +++ b/drivers/gpu/nvgpu/common/linux/channel.c @@ -19,6 +19,7 @@ #include #include #include +#include /* * This is required for nvgpu_vm_find_buf() which is used in the tracing @@ -817,7 +818,7 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, } if (profile) - profile->timestamp[PROFILE_ENTRY] = sched_clock(); + profile->timestamp[PROFILE_ENTRY] = nvgpu_current_time_ns(); /* update debug settings */ nvgpu_ltc_sync_enabled(g); @@ -966,7 +967,7 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, } if (profile) - profile->timestamp[PROFILE_JOB_TRACKING] = sched_clock(); + profile->timestamp[PROFILE_JOB_TRACKING] = nvgpu_current_time_ns(); if (wait_cmd) gk20a_submit_append_priv_cmdbuf(c, wait_cmd); @@ -991,7 +992,7 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, /* TODO! Check for errors... */ gk20a_channel_add_job(c, job, skip_buffer_refcounting); if (profile) - profile->timestamp[PROFILE_APPEND] = sched_clock(); + profile->timestamp[PROFILE_APPEND] = nvgpu_current_time_ns(); g->ops.fifo.userd_gp_put(g, c); @@ -1010,7 +1011,7 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, c->gpfifo.put, c->gpfifo.get, c->gpfifo.entry_num); if (profile) - profile->timestamp[PROFILE_END] = sched_clock(); + profile->timestamp[PROFILE_END] = nvgpu_current_time_ns(); nvgpu_log_fn(g, "done"); return err; -- cgit v1.2.2