diff options
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/cde_gk20a.c | 9 | ||||
-rw-r--r-- | include/trace/events/gk20a.h | 33 |
2 files changed, 42 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); |
diff --git a/include/trace/events/gk20a.h b/include/trace/events/gk20a.h index 4b3f94e7..8fa8cb94 100644 --- a/include/trace/events/gk20a.h +++ b/include/trace/events/gk20a.h | |||
@@ -293,6 +293,39 @@ TRACE_EVENT(gk20a_mmu_fault, | |||
293 | __entry->engine, __entry->client, __entry->fault_type) | 293 | __entry->engine, __entry->client, __entry->fault_type) |
294 | ); | 294 | ); |
295 | 295 | ||
296 | DECLARE_EVENT_CLASS(gk20a_cde, | ||
297 | TP_PROTO(const void *ctx), | ||
298 | TP_ARGS(ctx), | ||
299 | TP_STRUCT__entry(__field(const void *, ctx)), | ||
300 | TP_fast_assign(__entry->ctx = ctx;), | ||
301 | TP_printk("ctx=%p", __entry->ctx) | ||
302 | ); | ||
303 | |||
304 | DEFINE_EVENT(gk20a_cde, gk20a_cde_remove_ctx, | ||
305 | TP_PROTO(const void *ctx), | ||
306 | TP_ARGS(ctx) | ||
307 | ); | ||
308 | |||
309 | DEFINE_EVENT(gk20a_cde, gk20a_cde_release, | ||
310 | TP_PROTO(const void *ctx), | ||
311 | TP_ARGS(ctx) | ||
312 | ); | ||
313 | |||
314 | DEFINE_EVENT(gk20a_cde, gk20a_cde_get_context, | ||
315 | TP_PROTO(const void *ctx), | ||
316 | TP_ARGS(ctx) | ||
317 | ); | ||
318 | |||
319 | DEFINE_EVENT(gk20a_cde, gk20a_cde_allocate_context, | ||
320 | TP_PROTO(const void *ctx), | ||
321 | TP_ARGS(ctx) | ||
322 | ); | ||
323 | |||
324 | DEFINE_EVENT(gk20a_cde, gk20a_cde_finished_ctx_cb, | ||
325 | TP_PROTO(const void *ctx), | ||
326 | TP_ARGS(ctx) | ||
327 | ); | ||
328 | |||
296 | #endif /* _TRACE_GK20A_H */ | 329 | #endif /* _TRACE_GK20A_H */ |
297 | 330 | ||
298 | /* This part must be outside protection */ | 331 | /* This part must be outside protection */ |