diff options
author | Konsta Holtta <kholtta@nvidia.com> | 2014-11-13 07:42:22 -0500 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-03-18 15:12:15 -0400 |
commit | f73552baea1ed48758bfece039aaf0c02102e0e7 (patch) | |
tree | c52982ee749a51c79f71fda1c6b1e56bbb9411d1 /drivers | |
parent | 2d7c5e1a5bf6e56e802c6e847baee5623d00431c (diff) |
gpu: nvgpu: cde: add trace events for ctx allocs
Trace cde context allocation and deallocation with ftrace.
Bug 200052943
Change-Id: Ieeb625166662971fb3eb3fb29c986fdb6809c10b
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/602886
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/cde_gk20a.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c index f85e0c4c..43e74c85 100644 --- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c | |||
@@ -22,6 +22,8 @@ | |||
22 | #include <linux/debugfs.h> | 22 | #include <linux/debugfs.h> |
23 | #include <linux/dma-buf.h> | 23 | #include <linux/dma-buf.h> |
24 | 24 | ||
25 | #include <trace/events/gk20a.h> | ||
26 | |||
25 | #include "gk20a.h" | 27 | #include "gk20a.h" |
26 | #include "channel_gk20a.h" | 28 | #include "channel_gk20a.h" |
27 | #include "mm_gk20a.h" | 29 | #include "mm_gk20a.h" |
@@ -80,6 +82,8 @@ __must_hold(&cde_app->mutex) | |||
80 | struct channel_gk20a *ch = cde_ctx->ch; | 82 | struct channel_gk20a *ch = cde_ctx->ch; |
81 | struct vm_gk20a *vm = ch->vm; | 83 | struct vm_gk20a *vm = ch->vm; |
82 | 84 | ||
85 | trace_gk20a_cde_remove_ctx(cde_ctx); | ||
86 | |||
83 | /* free the channel */ | 87 | /* free the channel */ |
84 | gk20a_free_channel(cde_ctx->ch, true); | 88 | gk20a_free_channel(cde_ctx->ch, true); |
85 | 89 | ||
@@ -728,6 +732,7 @@ __releases(&cde_app->mutex) | |||
728 | struct gk20a_cde_app *cde_app = &cde_ctx->g->cde_app; | 732 | struct gk20a_cde_app *cde_app = &cde_ctx->g->cde_app; |
729 | 733 | ||
730 | gk20a_dbg(gpu_dbg_cde_ctx, "releasing use on %p", cde_ctx); | 734 | gk20a_dbg(gpu_dbg_cde_ctx, "releasing use on %p", cde_ctx); |
735 | trace_gk20a_cde_release(cde_ctx); | ||
731 | 736 | ||
732 | mutex_lock(&cde_app->mutex); | 737 | mutex_lock(&cde_app->mutex); |
733 | 738 | ||
@@ -808,6 +813,7 @@ __must_hold(&cde_app->mutex) | |||
808 | cde_ctx, cde_app->ctx_count, | 813 | cde_ctx, cde_app->ctx_count, |
809 | cde_app->ctx_usecount, | 814 | cde_app->ctx_usecount, |
810 | cde_app->ctx_count_top); | 815 | cde_app->ctx_count_top); |
816 | trace_gk20a_cde_get_context(cde_ctx); | ||
811 | 817 | ||
812 | /* deleter work may be scheduled, but in_use prevents it */ | 818 | /* deleter work may be scheduled, but in_use prevents it */ |
813 | cde_ctx->in_use = true; | 819 | cde_ctx->in_use = true; |
@@ -833,6 +839,7 @@ __must_hold(&cde_app->mutex) | |||
833 | return cde_ctx; | 839 | return cde_ctx; |
834 | } | 840 | } |
835 | 841 | ||
842 | trace_gk20a_cde_get_context(cde_ctx); | ||
836 | cde_ctx->in_use = true; | 843 | cde_ctx->in_use = true; |
837 | cde_ctx->is_temporary = true; | 844 | cde_ctx->is_temporary = true; |
838 | cde_app->ctx_usecount++; | 845 | cde_app->ctx_usecount++; |
@@ -891,6 +898,7 @@ static struct gk20a_cde_ctx *gk20a_cde_allocate_context(struct gk20a *g) | |||
891 | gk20a_cde_ctx_deleter_fn); | 898 | gk20a_cde_ctx_deleter_fn); |
892 | 899 | ||
893 | gk20a_dbg(gpu_dbg_fn | gpu_dbg_cde_ctx, "cde: allocated %p", cde_ctx); | 900 | gk20a_dbg(gpu_dbg_fn | gpu_dbg_cde_ctx, "cde: allocated %p", cde_ctx); |
901 | trace_gk20a_cde_allocate_context(cde_ctx); | ||
894 | return cde_ctx; | 902 | return cde_ctx; |
895 | } | 903 | } |
896 | 904 | ||
@@ -1042,6 +1050,7 @@ __releases(&cde_app->mutex) | |||
1042 | if (!channel_idle) | 1050 | if (!channel_idle) |
1043 | return; | 1051 | return; |
1044 | 1052 | ||
1053 | trace_gk20a_cde_finished_ctx_cb(cde_ctx); | ||
1045 | gk20a_dbg(gpu_dbg_fn | gpu_dbg_cde_ctx, "cde: finished %p", cde_ctx); | 1054 | gk20a_dbg(gpu_dbg_fn | gpu_dbg_cde_ctx, "cde: finished %p", cde_ctx); |
1046 | WARN(!cde_ctx->in_use, "double finish cde context %p on channel %p", | 1055 | WARN(!cde_ctx->in_use, "double finish cde context %p on channel %p", |
1047 | cde_ctx, ch); | 1056 | cde_ctx, ch); |