gpu: nvgpu: use time API in channel ref action debug

Save the time using nvgpu_current_time_ms() instead of the
Linux-specific jiffies counter.

Jira NVGPU-83

Change-Id: I19b4296d8b64ddf52506144e77d151f668ff7838
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1503002
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Konsta Holtta
2017-06-15 11:15:51 +03:00
committed by mobile promotions
parent 571c7c2fb3
commit e6edb10656
2 changed files with 7 additions and 7 deletions

View File

@@ -627,8 +627,8 @@ static void gk20a_channel_dump_ref_actions(struct channel_gk20a *ch)
{
#if GK20A_CHANNEL_REFCOUNT_TRACKING
size_t i, get;
unsigned long now = jiffies;
unsigned long prev_jiffies = 0;
s64 now = nvgpu_current_time_ms();
s64 prev = 0;
struct device *dev = dev_from_gk20a(ch->g);
nvgpu_spinlock_acquire(&ch->ref_actions_lock);
@@ -651,11 +651,11 @@ static void gk20a_channel_dump_ref_actions(struct channel_gk20a *ch)
act->type == channel_gk20a_ref_action_get
? "GET" : "PUT",
GK20A_CHANNEL_REFCOUNT_TRACKING - 1 - i,
jiffies_to_msecs(now - act->jiffies),
jiffies_to_msecs(act->jiffies - prev_jiffies));
now - act->timestamp_ms,
act->timestamp_ms - prev);
print_stack_trace(&act->trace, 0);
prev_jiffies = act->jiffies;
prev = act->timestamp_ms;
}
get = (get + 1) % GK20A_CHANNEL_REFCOUNT_TRACKING;
@@ -680,7 +680,7 @@ static void gk20a_channel_save_ref_source(struct channel_gk20a *ch,
act->trace.skip = 3; /* onwards from the caller of this */
act->trace.entries = act->trace_entries;
save_stack_trace(&act->trace);
act->jiffies = jiffies;
act->timestamp_ms = nvgpu_current_time_ms();
ch->ref_actions_put = (ch->ref_actions_put + 1) %
GK20A_CHANNEL_REFCOUNT_TRACKING;

View File

@@ -152,7 +152,7 @@ enum channel_gk20a_ref_action_type {
struct channel_gk20a_ref_action {
enum channel_gk20a_ref_action_type type;
unsigned long jiffies;
s64 timestamp_ms;
/*
* Many of these traces will be similar. Simpler to just capture
* duplicates than to have a separate database for the entries.