Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp654150rwe; Thu, 25 Aug 2022 07:04:52 -0700 (PDT) X-Google-Smtp-Source: AA6agR4nuL+rx+V7uWGeDCme5lNd3EaRao15h91Du9DmdJw4+81i44RgG6lF7oi67jAfHIRMv9sY X-Received: by 2002:aa7:88c3:0:b0:536:f035:ede0 with SMTP id k3-20020aa788c3000000b00536f035ede0mr4147673pff.74.1661436291582; Thu, 25 Aug 2022 07:04:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661436291; cv=none; d=google.com; s=arc-20160816; b=JO7uaep7eEK99JWmgH8YRRFhDDWuXySb7wAsjkPVsOJhiQ7cozcXR7mvNABr0RIrh7 8kqkPBkM5SnEKQdoglO0zCVSOpxG0aYrjg1iXIH8pYJ7FIaaQ88Av4ljWlL+Vag3ZIJX TpuDhV0kMpGqKA9yTtQf4UEguEhA7HYMlcU2EJwoV7RNqmo0BL0fB6RbVRZbIvZZL9aW XiAhJfkxfTH1A615mLorE3oEnlogS1hM9+ZBJflDRoD6ieo7Qz9ED0qaokTiupMyD0Ms aYtsBVt0Ol8nenmDJCrfJ9xLtZI7eoSAtrMlmRvY8H08lvGr2n1nhXCtSktMlU2CRY9d ZMQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=lEDkLsQ5eAOXGKaEe0Dxa69/PDopKKRsOYrCq0dTwzg=; b=JWG9E4dnUQsOAE5SxfISHwG9YuutT3Lnxf4bAe5D29iicU8y0H4SaV57FhNfNimXyF tUUfL3ZmKtvATQAp1jReQaG6sU1sm7M+H1RWTXYqnvRaN8eT1/989TONqKTRwXx1FWWr rLTp1RFDh7uCWT24Jtofnq0WLzB3lBme8FIsskuHpndD+eNlyiNmuuh/NwrF1cG7fIN6 yLceL0NYRZ10Sn1PZIUDbhmleWsdGCAYiKx6V8DKNXgUZE/hS4xitloKYkzHff9YYZI7 xgpf0oWIBw/ICTACfjxFfnBjk6FzAprIyUbSe9xBB4uei88u/e8pb6eOImLUWbS3OnGV cfyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=LHZ6MGRg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mw14-20020a17090b4d0e00b001f222133d1esi4421380pjb.186.2022.08.25.07.04.19; Thu, 25 Aug 2022 07:04:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=LHZ6MGRg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242313AbiHYNL7 (ORCPT + 99 others); Thu, 25 Aug 2022 09:11:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242292AbiHYNLy (ORCPT ); Thu, 25 Aug 2022 09:11:54 -0400 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D636A61E2 for ; Thu, 25 Aug 2022 06:11:53 -0700 (PDT) Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27P50VaP015174; Thu, 25 Aug 2022 08:11:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : content-transfer-encoding : in-reply-to; s=PODMain02222019; bh=lEDkLsQ5eAOXGKaEe0Dxa69/PDopKKRsOYrCq0dTwzg=; b=LHZ6MGRgbAFqMtMnWTDvDKcSpbyPcB189+K939SiRb3gszOjEBB2/4T27Uja8JXuLeV4 lHwRnaONauSire/0Ji8WMfYLczQEqKj7+mIS/I5DW7Q3abyK2Lle7kKjC0yGsHxX3okS r8MQ/3DioK8k5CgHsdSqMcc90IrIELK2B7tJ5wTWPsLZxnghKC0I0UWk/0qZiUSLPzVE ASwmg9TUnqxvIoKClnuHyQ4tGmO0y6P00EafIL6RBo7lIOYJ6CuKSJ6XmQ8gPY/KwjI3 40/w7qRRl1+z1IWyS83egJVtKnHjwSvUfL4gbs7/JOqhC9cj/UR7CWry5ovAr05vckR0 fA== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3j4dgmbw21-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Aug 2022 08:11:34 -0500 Received: from ediex01.ad.cirrus.com (198.61.84.80) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.9; Thu, 25 Aug 2022 08:11:32 -0500 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.2.1118.9 via Frontend Transport; Thu, 25 Aug 2022 08:11:32 -0500 Received: from ediswmail.ad.cirrus.com (ediswmail.ad.cirrus.com [198.61.86.93]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 1F521B0E; Thu, 25 Aug 2022 13:11:32 +0000 (UTC) Date: Thu, 25 Aug 2022 13:11:32 +0000 From: Charles Keepax To: Mark Brown CC: Martin =?utf-8?Q?Povi=C5=A1er?= , Liam Girdwood , Alyssa Rosenzweig , , , Richard Fitzgerald Subject: Re: [PATCH] ASoC: dapm: Export new 'graph.dot' file in debugfs Message-ID: <20220825131132.GN92394@ediswmail.ad.cirrus.com> References: <20220822095242.3779-1-povik+lin@cutebit.org> <3234D74E-0DFF-4BB5-87ED-6135BAC1F31D@cutebit.org> <6EDC1D4B-4B84-49A2-A60A-EA15D27251A7@cutebit.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="82I3+IH0IqGh5yIs" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Proofpoint-ORIG-GUID: 4Q1OSp4L-fb9xBYYP8pVWlqvdTE-tqIm X-Proofpoint-GUID: 4Q1OSp4L-fb9xBYYP8pVWlqvdTE-tqIm X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --82I3+IH0IqGh5yIs Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit On Mon, Aug 22, 2022 at 05:10:41PM +0100, Mark Brown wrote: > On Mon, Aug 22, 2022 at 03:11:48PM +0200, Martin Povišer wrote: > > > On 22. 8. 2022, at 15:04, Mark Brown wrote: > > > On Mon, Aug 22, 2022 at 02:38:09PM +0200, Martin Povišer wrote: > > > >> simply having a ‘graph.dot’ at hand, especially since it requires > > >> little code. (Although sure there’s the danger of it growing.) > > > > I'm also worried about people going in and wanting other more tool > > > specific formats adding, if we didn't have anything at all it'd be one > > > thing but we do have something. > > > Sure, although I would argue DOT is by a large margin the standard > > format to represent graphs in. > > Well, the debugfs stuff there is more a general tool for introspecting > the current DAPM state than it is indended to draw a pretty picture. > When I wrote it the scale of the devices I was working with was such > that I'm not usre a full graph would've been terribly useful, and > there's even larger devices since then (though also a lot of systems > like yours which do use very much smaller devices). I still seem to have a copy of Dimitris's tool lying around (attached), yes apologies we don't seem to have that publicly hosted anymore at some point it feels like we need to look at what was lost when the older Wolfson stuff was shutdown. Thanks, Charles --82I3+IH0IqGh5yIs Content-Type: text/plain; charset="us-ascii" Content-Disposition: attachment; filename="vizdapm" #!/bin/bash # # Copyright 2011, 2012, 2013 Wolfson Microelectronics plc # Author: Dimitris Papastamos # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # A tool to generate a visual graph of the current DAPM configuration. # Active paths are shown in green, inactive in red. # # This program requires `graphviz' to be installed. if [ $# -ne 2 ]; then echo "usage: $(basename $0) dapm-debugfs-path out-png" 1>&2 exit 1 fi widgets="$1" outpng="$2" graphviztmp=$(mktemp) trap "{ rm -f $graphviztmp; exit 1; }" SIGINT SIGTERM EXIT widget_active() { local w="$1" head -1 "$w" | grep -q ': On' if [ "$?" -eq 0 ]; then echo 1 else echo 0 fi } echo "digraph G {" > "$graphviztmp" echo -e "\tbgcolor = grey" >> "$graphviztmp" cd "$widgets" for widget in *; do echo -n "Parsing widget $widget..." while read line; do echo "${line}" | grep -q '^in' if [ ! "$?" -eq 0 ]; then continue fi source=$(echo "$line" | awk -F\" '{print $4}') active=$(widget_active "$widget") if [ "$active" -eq 1 ]; then echo -e "\t\"$source\" [color = green]" >> "$graphviztmp" echo -e "\t\"$widget\" [color = green]" >> "$graphviztmp" else echo -e "\t\"$source\" [color = red]" >> "$graphviztmp" echo -e "\t\"$widget\" [color = red]" >> "$graphviztmp" fi echo -e "\t\"$source\" -> \"$widget\"" >> "$graphviztmp" done < "$widget" echo "OK!" done cd - >/dev/null echo "}" >> "$graphviztmp" echo -n "Generating $outpng..." dot -Kfdp -Tpng "$graphviztmp" -o "$outpng" echo "OK!" --82I3+IH0IqGh5yIs--