From patchwork Fri Jan 26 21:08:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jordan Crouse X-Patchwork-Id: 10187027 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 D9EC8602C8 for ; Fri, 26 Jan 2018 21:09:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CBBA82A81D for ; Fri, 26 Jan 2018 21:09:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C085C2A82A; Fri, 26 Jan 2018 21:09:02 +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 72EA12A81D for ; Fri, 26 Jan 2018 21:09:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 771596E767; Fri, 26 Jan 2018 21:08:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) by gabe.freedesktop.org (Postfix) with ESMTPS id 77CD06E6A4; Fri, 26 Jan 2018 21:08:56 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 631C26074E; Fri, 26 Jan 2018 21:08:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1517000936; bh=IpLfj8cuyK9lKZ6A1iGySZU/AkRqXOJ3NFvX1xM24Ug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D8sHwoj4m9JtDwYuSthEOCAJMp3+oH8a3Q9Jv/KZIvoaPqJtqzfDxxu+DdtiiwlHv 2hvVPu47J8C8/4Db2kQTL/AoDz18rGxUlwoOJjzgVsucqvjWzQj4Jz+oixNrmDIfqS ybNYRiHki7yYLH3YXDVSkrzoFD+39avOUftRuEH8= Received: from jcrouse-lnx.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jcrouse@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 71C7160A5F; Fri, 26 Jan 2018 21:08:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1517000935; bh=IpLfj8cuyK9lKZ6A1iGySZU/AkRqXOJ3NFvX1xM24Ug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VwEukXbX2J8NZW/wekHjM+1rIE3esvl1Daz40VOKTuxVPpApFUgviBmfjDzlibIjp cpP0VDefOd8MMt8T2Ulu/WJtKaOCgBezJq9YAaAjbJVOUCcQpBtpsY9Gw+AOnOWSj8 SoKDUJPHm/CHmGk9b7zuyxpRiULFodnwsqOy0V0U= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 71C7160A5F Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jcrouse@codeaurora.org From: Jordan Crouse To: freedreno@lists.freedesktop.org Subject: [PATCH 4/6] drm/msm/adreno: Convert the show/crash file format Date: Fri, 26 Jan 2018 14:08:48 -0700 Message-Id: <1517000930-1893-5-git-send-email-jcrouse@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1517000930-1893-1-git-send-email-jcrouse@codeaurora.org> References: <1517000930-1893-1-git-send-email-jcrouse@codeaurora.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Convert the format of the 'show' and 'crash' debugfs files to mostly standard YAML. This should be easier to parse and be more flexible for future changes and expansions. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 23 ++++++++++++++--------- drivers/gpu/drm/msm/msm_debugfs.c | 8 +++++--- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c index 963fce3..9e83c70 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c @@ -438,23 +438,28 @@ void adreno_show(struct msm_gpu *gpu, struct msm_gpu_state *state, if (IS_ERR_OR_NULL(state)) return; - seq_printf(m, "status: %08x\n", state->rbbm_status); seq_printf(m, "revision: %d (%d.%d.%d.%d)\n", adreno_gpu->info->revn, adreno_gpu->rev.core, adreno_gpu->rev.major, adreno_gpu->rev.minor, adreno_gpu->rev.patchid); - for (i = 0; i < gpu->nr_rings; i++) { - seq_printf(m, "rb %d: fence: %d/%d\n", i, - state->ring[i].fence, state->ring[i].seqno); + seq_printf(m, "rbbm-status: 0x%08x\n", state->rbbm_status); + + seq_printf(m, "ringbuffer:\n"); - seq_printf(m, " rptr: %d\n", state->ring[i].rptr); - seq_printf(m, "rb wptr: %d\n", state->ring[i].wptr); + for (i = 0; i < gpu->nr_rings; i++) { + seq_printf(m, " - id: %d\n", i); + seq_printf(m, " last-fence: %d\n", state->ring[i].seqno); + seq_printf(m, " retired-fence: %d\n", state->ring[i].fence); + seq_printf(m, " rptr: %d\n", state->ring[i].rptr); + seq_printf(m, " wptr: %d\n", state->ring[i].wptr); } - seq_printf(m, "IO:region %s 00000000 00020000\n", gpu->name); - for (i = 0; i < state->nr_registers; i++) { - seq_printf(m, "IO:R %08x %08x\n", + seq_printf(m, "registers:\n"); + seq_printf(m, " - [offset, value]\n"); + + for(i = 0; i < state->nr_registers; i++) { + seq_printf(m, " - [0x%04x, 0x%08x]\n", state->registers[i * 2] << 2, state->registers[(i * 2) + 1]); } diff --git a/drivers/gpu/drm/msm/msm_debugfs.c b/drivers/gpu/drm/msm/msm_debugfs.c index 50e049c..e6d41d9 100644 --- a/drivers/gpu/drm/msm/msm_debugfs.c +++ b/drivers/gpu/drm/msm/msm_debugfs.c @@ -33,9 +33,11 @@ static int msm_gpu_crash_show(struct seq_file *m, void *data) if (!state) return 0; - seq_printf(m, "%s Crash Status:\n", gpu->name); - seq_puts(m, "Kernel: " UTS_RELEASE "\n"); - seq_printf(m, "Time: %ld s %ld us\n", + /* FIXME: add tags? */ + seq_puts(m, "---\n"); + seq_puts(m, "kernel: " UTS_RELEASE "\n"); + seq_printf(m, "module: " KBUILD_MODNAME "\n"); + seq_printf(m, "time: %ld.%ld\n", state->time.tv_sec, state->time.tv_usec); if (state->comm) seq_printf(m, "comm: %s\n", state->comm);