diff options
author | Konsta Holtta <kholtta@nvidia.com> | 2017-06-15 04:15:51 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-06-19 11:35:11 -0400 |
commit | e6edb10656c86bbc8918c63ae99be25c2e343a99 (patch) | |
tree | 270cf200cac997b39ff52b14b7c367607a8487f5 /drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |
parent | 571c7c2fb37176671d55f004df4ed1055f7e8cb1 (diff) |
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>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 645183ba..1caecf3d 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -627,8 +627,8 @@ static void gk20a_channel_dump_ref_actions(struct channel_gk20a *ch) | |||
627 | { | 627 | { |
628 | #if GK20A_CHANNEL_REFCOUNT_TRACKING | 628 | #if GK20A_CHANNEL_REFCOUNT_TRACKING |
629 | size_t i, get; | 629 | size_t i, get; |
630 | unsigned long now = jiffies; | 630 | s64 now = nvgpu_current_time_ms(); |
631 | unsigned long prev_jiffies = 0; | 631 | s64 prev = 0; |
632 | struct device *dev = dev_from_gk20a(ch->g); | 632 | struct device *dev = dev_from_gk20a(ch->g); |
633 | 633 | ||
634 | nvgpu_spinlock_acquire(&ch->ref_actions_lock); | 634 | nvgpu_spinlock_acquire(&ch->ref_actions_lock); |
@@ -651,11 +651,11 @@ static void gk20a_channel_dump_ref_actions(struct channel_gk20a *ch) | |||
651 | act->type == channel_gk20a_ref_action_get | 651 | act->type == channel_gk20a_ref_action_get |
652 | ? "GET" : "PUT", | 652 | ? "GET" : "PUT", |
653 | GK20A_CHANNEL_REFCOUNT_TRACKING - 1 - i, | 653 | GK20A_CHANNEL_REFCOUNT_TRACKING - 1 - i, |
654 | jiffies_to_msecs(now - act->jiffies), | 654 | now - act->timestamp_ms, |
655 | jiffies_to_msecs(act->jiffies - prev_jiffies)); | 655 | act->timestamp_ms - prev); |
656 | 656 | ||
657 | print_stack_trace(&act->trace, 0); | 657 | print_stack_trace(&act->trace, 0); |
658 | prev_jiffies = act->jiffies; | 658 | prev = act->timestamp_ms; |
659 | } | 659 | } |
660 | 660 | ||
661 | get = (get + 1) % GK20A_CHANNEL_REFCOUNT_TRACKING; | 661 | get = (get + 1) % GK20A_CHANNEL_REFCOUNT_TRACKING; |
@@ -680,7 +680,7 @@ static void gk20a_channel_save_ref_source(struct channel_gk20a *ch, | |||
680 | act->trace.skip = 3; /* onwards from the caller of this */ | 680 | act->trace.skip = 3; /* onwards from the caller of this */ |
681 | act->trace.entries = act->trace_entries; | 681 | act->trace.entries = act->trace_entries; |
682 | save_stack_trace(&act->trace); | 682 | save_stack_trace(&act->trace); |
683 | act->jiffies = jiffies; | 683 | act->timestamp_ms = nvgpu_current_time_ms(); |
684 | ch->ref_actions_put = (ch->ref_actions_put + 1) % | 684 | ch->ref_actions_put = (ch->ref_actions_put + 1) % |
685 | GK20A_CHANNEL_REFCOUNT_TRACKING; | 685 | GK20A_CHANNEL_REFCOUNT_TRACKING; |
686 | 686 | ||