Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tursulin@ursulin.net>
To: igt-dev@lists.freedesktop.org
Cc: Intel-gfx@lists.freedesktop.org,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: [igt-dev] [PATCH i-g-t] intel-gpu-overlay: Update for renamed tracepoints
Date: Mon,  5 Mar 2018 12:41:58 +0000	[thread overview]
Message-ID: <20180305124158.22793-1-tvrtko.ursulin@linux.intel.com> (raw)

From: Tvrtko Ursulin <tvrtko.ursulin@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@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

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

             reply	other threads:[~2018-03-05 12:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-05 12:41 Tvrtko Ursulin [this message]
2018-03-05 16:14 ` [igt-dev] ✓ Fi.CI.BAT: success for intel-gpu-overlay: Update for renamed tracepoints Patchwork
2018-03-05 20:39 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-03-06 10:58 ` [igt-dev] [PATCH i-g-t] " Chris Wilson
2018-03-06 11:17   ` [Intel-gfx] " Tvrtko Ursulin
2018-03-15 10:01 ` [igt-dev] [PATCH i-g-t v2] " Tvrtko Ursulin
2018-03-15 10:32   ` [Intel-gfx] " Chris Wilson
2018-03-15 12:24 ` [igt-dev] ✗ Fi.CI.BAT: warning for intel-gpu-overlay: Update for renamed tracepoints (rev2) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180305124158.22793-1-tvrtko.ursulin@linux.intel.com \
    --to=tursulin@ursulin.net \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=tvrtko.ursulin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox