From patchwork Mon Mar 5 12:41:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10258857 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 412BB60365 for ; Mon, 5 Mar 2018 12:42:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31316289FF for ; Mon, 5 Mar 2018 12:42:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 25A9928A0B; Mon, 5 Mar 2018 12:42:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 53B79289FF for ; Mon, 5 Mar 2018 12:42:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5A46D6E318; Mon, 5 Mar 2018 12:42:11 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1ED836E02E for ; Mon, 5 Mar 2018 12:42:09 +0000 (UTC) Received: by mail-wr0-x244.google.com with SMTP id v111so17097168wrb.3 for ; Mon, 05 Mar 2018 04:42:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ursulin-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=k9GUiEB+AAywGRq2Bl5J68B4FGyEUSJHqjGe7exreek=; b=B/84Tni+ZlwXzRred9mnsiMiFCkEhxL2WNqctExvvfKx7oLvlOLm8T9s4JK05HhkI/ SauXgBBKbersZu/BZQYDF8qf3+AMSjY5KpRAePeJKtK50X9rPXZkzCAfVPmMEHYwjus1 5OvJhzFYNa2YL5GaAjFmETTci09PYAAHRwq/uEllfTMv87ng32ah1JjrqKklPZHds8gQ KPEc7CB3Vr7yDQyA6G+2h0AmHLsw6xaYJAf9zuZYJOdGZuoivTfcL3FNfZpM3d2E3YI5 8azqMWq2FgB3Ca8GStIDFNU9z27siHhg7RcgjlISowF53dVysPoHU5Q03Zm1bi5kwyxU Z+/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=k9GUiEB+AAywGRq2Bl5J68B4FGyEUSJHqjGe7exreek=; b=nOJbiEGLSseX7Fee2u1knfxslvFmHJF9WcafDZQQiAZRIVWj5nOiIlX8uQuqDC4VfF 26vddCuzVOguxz4SW/nCidFygErKZUrr1sl5sgo1ZbplFw/B9EZEPM6eiWshI5000BS+ z7d//Q4PwwcfLaUnBJ3qo1EmHC19JuBUxHQosQHPSSgmsGj3brRXuMuJKbowRSTszFZl 5mTGtUmM0+BxORRvcVJQQpLHtAlE+8yiZTJJLbizh99ZYbJXiOStLftmHW5f63PQu6VD BNmpw/gqFSFyUyhp92CMyHXLkYrtBu3n3u1CULDUi6KCO03viV3Rhv6h5ZYn2DnYR6bT oCdg== X-Gm-Message-State: APf1xPBqRrlcg3s5ZhZY79x4IVuLBdaqsVTkbIuhttFbnjNQ35y/v04q CwsF2uE6yICN6TusKMaHMiZM5w== X-Google-Smtp-Source: AG47ELvvbn82CdB3/cf5fEGGjL4SYZVeJYkew/mkVdkPSKYMI+yNB3dN9EwxV4Y7Mb0TCyBmVfCKXA== X-Received: by 10.223.171.6 with SMTP id q6mr13397338wrc.267.1520253728540; Mon, 05 Mar 2018 04:42:08 -0800 (PST) Received: from localhost.localdomain ([95.146.144.186]) by smtp.gmail.com with ESMTPSA id 67sm6159915wmw.17.2018.03.05.04.42.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Mar 2018 04:42:07 -0800 (PST) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Mon, 5 Mar 2018 12:41:58 +0000 Message-Id: <20180305124158.22793-1-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.14.1 Subject: [Intel-gfx] [PATCH i-g-t] intel-gpu-overlay: Update for renamed tracepoints X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Intel-gfx@lists.freedesktop.org MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Tvrtko Ursulin 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 --- 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;