From patchwork Wed Oct 31 17:05:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jordan Crouse X-Patchwork-Id: 10662973 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4D90617DF for ; Wed, 31 Oct 2018 17:06:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3EBF82B1FA for ; Wed, 31 Oct 2018 17:06:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3359E2B37A; Wed, 31 Oct 2018 17:06: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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F00F92B1FA for ; Wed, 31 Oct 2018 17:06:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729425AbeKACEw (ORCPT ); Wed, 31 Oct 2018 22:04:52 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:43020 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729391AbeKACEw (ORCPT ); Wed, 31 Oct 2018 22:04:52 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 835EC60A34; Wed, 31 Oct 2018 17:05:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1541005559; bh=Xu9dkwpx3ZN5wym9tLEzFTZG3tbRNoQqekSvdI/hdkk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LcMXszq+kTiUW1QjLMMQKrwcY2s3WCaA4y7pAARMFSu+YCIJ/kXqa6O8n9DOSBjS6 hoHiP9r5gk/MP33bKkJRXtF41f4HSHf/VyAPMqFhFiQGy9xxzIWyp5HSpU7R5eO5I8 IEqjcFB5RAEv5Uuyinm03c8e/AyOBCZ5Sg/gpFJc= 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 6A6836019F; Wed, 31 Oct 2018 17:05:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1541005558; bh=Xu9dkwpx3ZN5wym9tLEzFTZG3tbRNoQqekSvdI/hdkk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZWqJbA0dLeVxgbjcOTFhEaoX9FpFr7e8UCGy9x9I/06jxi3G2mi82EjNQAVKrAnxQ RZLaUPTFgfbJFnbgekSsFFVXWolezlsBa9MSg5THYj5yYSdG9RFHGsK+SohF5yf/Yb U7+WKetPWcHwNWUTfY2MN3lMUol2IQCgkzmpO9Xw= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 6A6836019F 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 Cc: dri-devel@lists.freedesktop.org, hoegsberg@chromium.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 4/6] drm/msm: Clean up and enhance the output of the 'gem' debugfs node Date: Wed, 31 Oct 2018 11:05:50 -0600 Message-Id: <20181031170552.32542-5-jcrouse@codeaurora.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181031170552.32542-1-jcrouse@codeaurora.org> References: <20181031170552.32542-1-jcrouse@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add headers for the 'gem' debugfs file to make it easier to remember what all the values mean and move the list of virtual address regions to the next line and add the name and map status to make it clearer what we are looking at. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_gem.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c index 189d7f0f1aad..805a300f8663 100644 --- a/drivers/gpu/drm/msm/msm_gem.c +++ b/drivers/gpu/drm/msm/msm_gem.c @@ -763,16 +763,23 @@ void msm_gem_describe(struct drm_gem_object *obj, struct seq_file *m) break; } - seq_printf(m, "%08x: %c %2d (%2d) %08llx %p\t", + seq_printf(m, "%08x: %c %2d (%2d) %08llx %p", msm_obj->flags, is_active(msm_obj) ? 'A' : 'I', obj->name, kref_read(&obj->refcount), off, msm_obj->vaddr); - /* FIXME: we need to print the address space here too */ - list_for_each_entry(vma, &msm_obj->vmas, list) - seq_printf(m, " %08llx", vma->iova); + seq_printf(m, " %08zu%9s\n", obj->size, madv); - seq_printf(m, " %zu%s\n", obj->size, madv); + if (!list_empty(&msm_obj->vmas)) { + + seq_puts(m, " vmas:"); + + list_for_each_entry(vma, &msm_obj->vmas, list) + seq_printf(m, " [%s: %08llx,%s]", vma->aspace->name, + vma->iova, vma->mapped ? "mapped" : "unmapped"); + + seq_puts(m, "\n"); + } rcu_read_lock(); fobj = rcu_dereference(robj->fence); @@ -799,9 +806,10 @@ void msm_gem_describe_objects(struct list_head *list, struct seq_file *m) int count = 0; size_t size = 0; + seq_puts(m, " flags id ref offset kaddr size madv\n"); list_for_each_entry(msm_obj, list, mm_list) { struct drm_gem_object *obj = &msm_obj->base; - seq_printf(m, " "); + seq_puts(m, " "); msm_gem_describe(obj, m); count++; size += obj->size;