Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932069AbdI1NaD (ORCPT ); Thu, 28 Sep 2017 09:30:03 -0400 Received: from smtprelay0088.hostedemail.com ([216.40.44.88]:34916 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752647AbdI1NaB (ORCPT ); Thu, 28 Sep 2017 09:30:01 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:541:599:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3872:3874:4321:5007:6119:7875:7903:10004:10400:10848:11026:11232:11473:11657:11658:11914:12043:12296:12438:12740:12760:12895:13069:13161:13229:13311:13357:13439:14659:14721:21080:21451:21627:30054:30070:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: basin54_39f7794248754 X-Filterd-Recvd-Size: 2595 Message-ID: <1506605396.29089.22.camel@perches.com> Subject: Re: [PATCH v3 3/6] gpu: host1x: Improve debug disassembly formatting From: Joe Perches To: Mikko Perttunen , thierry.reding@gmail.com, jonathanh@nvidia.com Cc: digetx@gmail.com, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 28 Sep 2017 06:29:56 -0700 In-Reply-To: <20170928125044.32516-4-mperttunen@nvidia.com> References: <20170928125044.32516-1-mperttunen@nvidia.com> <20170928125044.32516-4-mperttunen@nvidia.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1626 Lines: 52 On Thu, 2017-09-28 at 15:50 +0300, Mikko Perttunen wrote: > The host1x driver prints out "disassembly" dumps of the command FIFO > and gather contents on submission timeouts. However, the output has > been quite difficult to read with unnecessary newlines and occasional > missing parentheses. I think it would be cleaner/simpler to change this by adding a line initiator with just a KERN_ at the few places that actually start a newline. Then change the write_to_seqfile to skip any output that starts with KERN_ > diff --git a/drivers/gpu/host1x/hw/debug_hw_1x01.c b/drivers/gpu/host1x/hw/debug_hw_1x01.c [] > @@ -111,11 +111,11 @@ static void host1x_debug_show_channel_fifo(struct host1x *host, > val = host1x_sync_readl(host, HOST1X_SYNC_CFPEEK_READ); > > if (!data_count) { > - host1x_debug_output(o, "%08x:", val); > + host1x_debug_output(o, "%08x: ", val); ie: change this and the other start of lines to prepend KERN_INFO host_x_debug_putput(o, KERN_INFO "%08x ", val); > data_count = show_channel_command(o, val); > } else { > - host1x_debug_output(o, "%08x%s", val, > - data_count > 0 ? ", " : "])\n"); And don't change all the other continuation lines And change the write_to_ functions to static inline void write_to_seqfile(void *ctx, const char *str, size_t len) { const char *output = printk_skip_level(str); seq_write(ctx, output, len - (str - output)); } static inline void write_to_printk(void *ctx, const char *str, size_t len) { const char *output = printk_skip_level(str); if (output == str) pr_cont("%s", str); else printk("s", str); }