[Intel-gfx] [PATCH i-g-t] intel-gpu-overlay: Update for renamed tracepoints

Tvrtko Ursulin tursulin at ursulin.net
Mon Mar 5 12:41:58 UTC 2018


From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Request tracepoints have been renames so update the tool to be able to
find them.

Also support falling back to the old name for compatibility.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
Compile tested only so also looking for someone to smoke test it if
possible. Otherwise I'll do it in due time once back to a test machine
with display.

I was also 50-50 whether it is worth supporting the old names, but it was
easy enough so I did it.
---
 overlay/gpu-perf.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/overlay/gpu-perf.c b/overlay/gpu-perf.c
index 0abd937e3618..bc49175da386 100644
--- a/overlay/gpu-perf.c
+++ b/overlay/gpu-perf.c
@@ -72,7 +72,7 @@ enum {
 };
 
 struct tracepoint {
-	const char *name;
+	const char *name, *altname;
 	int event_id;
 
 	struct {
@@ -90,9 +90,12 @@ struct tracepoint {
 	int global_seqno_field;
 	int plane_field;
 } tracepoints[TP_NB] = {
-	[TP_GEM_REQUEST_ADD]         = { .name = "i915/i915_gem_request_add", },
-	[TP_GEM_REQUEST_WAIT_BEGIN]  = { .name = "i915/i915_gem_request_wait_begin", },
-	[TP_GEM_REQUEST_WAIT_END]    = { .name = "i915/i915_gem_request_wait_end", },
+	[TP_GEM_REQUEST_ADD]         = { .name = "i915/i915_request_add",
+					 .altname = "i915/i915_gem_request_add" },
+	[TP_GEM_REQUEST_WAIT_BEGIN]  = { .name = "i915/i915_request_wait_begin",
+					 .altname = "i915/i915_gem_request_wait_begin" },
+	[TP_GEM_REQUEST_WAIT_END]    = { .name = "i915/i915_request_wait_end",
+					 .altname = "i915/i915_gem_request_wait_end" },
 	[TP_FLIP_COMPLETE]           = { .name = "i915/flip_complete", },
 	[TP_GEM_RING_SYNC_TO]        = { .name = "i915/gem_ring_sync_to", },
 	[TP_GEM_RING_SWITCH_CONTEXT] = { .name = "i915/gem_ring_switch_context", },
@@ -142,6 +145,12 @@ tracepoint_id(int tp_id)
 	ctx.ctx.tp = tp;
 	ctx.ctx.fp = fopen(buf, "r");
 
+	if (ctx.ctx.fp == NULL) {
+		snprintf(buf, sizeof(buf), "%s/tracing/events/%s/format",
+			 debugfs_path, tp->altname);
+		ctx.ctx.fp = fopen(buf, "r");
+	}
+
 	if (ctx.ctx.fp == NULL)
 		return 0;
 
-- 
2.14.1



More information about the Intel-gfx mailing list