From: Christian Gmeiner <christian.gmeiner@gmail.com> To: linux-kernel@vger.kernel.org Cc: cphealy@gmail.com, Christian Gmeiner <christian.gmeiner@gmail.com>, Lucas Stach <l.stach@pengutronix.de>, Russell King <linux+etnaviv@armlinux.org.uk>, David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>, etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 3/4] drm/etnaviv: show loadavg in debugfs Date: Fri, 10 Jul 2020 09:41:26 +0200 [thread overview] Message-ID: <20200710074143.306787-4-christian.gmeiner@gmail.com> (raw) In-Reply-To: <20200710074143.306787-1-christian.gmeiner@gmail.com> Might be helpful to see the loadavg in debugfs. Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> --- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c index 1f0eb7e00657..82fe4aafed57 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -884,7 +884,7 @@ int etnaviv_gpu_debugfs(struct etnaviv_gpu *gpu, struct seq_file *m) { struct dma_debug debug; u32 dma_lo, dma_hi, axi, idle; - int ret; + int ret, i; seq_printf(m, "%s Status:\n", dev_name(gpu->dev)); @@ -1002,6 +1002,16 @@ int etnaviv_gpu_debugfs(struct etnaviv_gpu *gpu, struct seq_file *m) if (idle & VIVS_HI_IDLE_STATE_AXI_LP) seq_puts(m, "\t AXI low power mode\n"); + seq_printf(m, "\tload:\n"); + spin_lock_bh(&gpu->loadavg_spinlock); + + for (i = 0; i < ARRAY_SIZE(etna_idle_module_names); i++) + seq_printf(m, "\t %s: %u%%\n", + etna_idle_module_names[i].name, + gpu->loadavg_percentage[i]); + + spin_unlock_bh(&gpu->loadavg_spinlock); + if (gpu->identity.features & chipFeatures_DEBUG_MODE) { u32 read0 = gpu_read(gpu, VIVS_MC_DEBUG_READ0); u32 read1 = gpu_read(gpu, VIVS_MC_DEBUG_READ1); -- 2.26.2
WARNING: multiple messages have this Message-ID (diff)
From: Christian Gmeiner <christian.gmeiner@gmail.com> To: linux-kernel@vger.kernel.org Cc: David Airlie <airlied@linux.ie>, etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Russell King <linux+etnaviv@armlinux.org.uk>, cphealy@gmail.com Subject: [PATCH 3/4] drm/etnaviv: show loadavg in debugfs Date: Fri, 10 Jul 2020 09:41:26 +0200 [thread overview] Message-ID: <20200710074143.306787-4-christian.gmeiner@gmail.com> (raw) In-Reply-To: <20200710074143.306787-1-christian.gmeiner@gmail.com> Might be helpful to see the loadavg in debugfs. Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> --- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c index 1f0eb7e00657..82fe4aafed57 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -884,7 +884,7 @@ int etnaviv_gpu_debugfs(struct etnaviv_gpu *gpu, struct seq_file *m) { struct dma_debug debug; u32 dma_lo, dma_hi, axi, idle; - int ret; + int ret, i; seq_printf(m, "%s Status:\n", dev_name(gpu->dev)); @@ -1002,6 +1002,16 @@ int etnaviv_gpu_debugfs(struct etnaviv_gpu *gpu, struct seq_file *m) if (idle & VIVS_HI_IDLE_STATE_AXI_LP) seq_puts(m, "\t AXI low power mode\n"); + seq_printf(m, "\tload:\n"); + spin_lock_bh(&gpu->loadavg_spinlock); + + for (i = 0; i < ARRAY_SIZE(etna_idle_module_names); i++) + seq_printf(m, "\t %s: %u%%\n", + etna_idle_module_names[i].name, + gpu->loadavg_percentage[i]); + + spin_unlock_bh(&gpu->loadavg_spinlock); + if (gpu->identity.features & chipFeatures_DEBUG_MODE) { u32 read0 = gpu_read(gpu, VIVS_MC_DEBUG_READ0); u32 read1 = gpu_read(gpu, VIVS_MC_DEBUG_READ1); -- 2.26.2 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-07-10 7:42 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-07-10 7:41 [PATCH 0/4] Add support for GPU load values Christian Gmeiner 2020-07-10 7:41 ` Christian Gmeiner 2020-07-10 7:41 ` [PATCH 1/4] drm/etnaviv: add simple moving average (SMA) Christian Gmeiner 2020-07-10 7:41 ` Christian Gmeiner 2020-07-10 7:41 ` [PATCH 2/4] drm/etnaviv: add loadavg accounting Christian Gmeiner 2020-07-10 7:41 ` Christian Gmeiner 2020-07-10 8:19 ` Lucas Stach 2020-07-10 8:19 ` Lucas Stach 2020-07-10 8:50 ` Christian Gmeiner 2020-07-10 8:50 ` Christian Gmeiner 2020-07-10 7:41 ` Christian Gmeiner [this message] 2020-07-10 7:41 ` [PATCH 3/4] drm/etnaviv: show loadavg in debugfs Christian Gmeiner 2020-07-10 7:41 ` [PATCH 4/4] drm/etnaviv: export loadavg via perfmon Christian Gmeiner 2020-07-10 7:41 ` Christian Gmeiner 2020-07-10 8:31 ` [PATCH 0/4] Add support for GPU load values Lucas Stach 2020-07-10 8:31 ` Lucas Stach 2020-07-10 8:44 ` Christian Gmeiner 2020-07-10 8:44 ` Christian Gmeiner 2020-07-10 12:21 ` Christian Gmeiner 2020-07-10 12:21 ` Christian Gmeiner
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=20200710074143.306787-4-christian.gmeiner@gmail.com \ --to=christian.gmeiner@gmail.com \ --cc=airlied@linux.ie \ --cc=cphealy@gmail.com \ --cc=daniel@ffwll.ch \ --cc=dri-devel@lists.freedesktop.org \ --cc=etnaviv@lists.freedesktop.org \ --cc=l.stach@pengutronix.de \ --cc=linux+etnaviv@armlinux.org.uk \ --cc=linux-kernel@vger.kernel.org \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.