Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp142682ybx; Wed, 6 Nov 2019 14:35:17 -0800 (PST) X-Google-Smtp-Source: APXvYqxFmrVfWP4QUDJ0P30UQh7kt0Lu8aOnegT/tWU/JhuZ588OXwZ9aHjM/kGm+0Bpqt3R4nR6 X-Received: by 2002:aa7:c2c7:: with SMTP id m7mr104288edp.295.1573079717701; Wed, 06 Nov 2019 14:35:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573079717; cv=none; d=google.com; s=arc-20160816; b=bQD1i41xPhO2qEpRDRSDqXHCiuoci8S8t/YIen19hc0g7NNDnBVNntZLkz+0t7x1r1 qcNHrj+1dxfVpG8nj+Cyu14J14i/smslwCA4/keIcszNCxGaNXtlbobpYs5YftzIjab8 zEPd5Dm9/5iFEFVrz5ogp3cdnIp5QI/G9B7sC7fDmckRb9it0MNDuMG7IH0SSLPS28t6 fRaJQjlugwhnKVIR4O9ijNTPRHs1tOzYCmToyBtqW1u02ZoMyYR/sBvFcnq6XUujxHjz BrTuFumkckRzxAhz8B0WkXx0cUHdDJdk6rzYLeQgHefSK+vWBRtSamBrYzgvFQEGveuA UCsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=+BxsQOJn5N5WfZQVx6VMTvk2i5H3xiGYWFZJJSAm0hg=; b=BWYZ4YZtFGr9lyeVxNuKB27BTzVtTjHbOWgJk+fONFBLH9crIhkId8BXHzOWJ3ItCd AeUYrkgfPHR40he7r+0P5iuP9WXAilt+vNaV441EwWV8yPwJY2/1UtJQye7e2HkKc1fh Z3evvIp6Ym6I55pE6MajvTOvNK2u4iVw5+0YVyY/yg7XFzq4YNxK6lx2ADRZ+/7C8aAT V9jaQPEGVQ/vRydinE/27slL7C++3BC03swDhcsu0v39Ypx01c0hduQiQlb6mnEZxZ29 OHFcdX6Nh/uvatS9w45eetR7sWSoUQhi926Ean7vhstd/njN5Cj2RXVyjyYLRyVUyor8 jQrw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7si192487ejk.20.2019.11.06.14.34.54; Wed, 06 Nov 2019 14:35:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728133AbfKFWeL (ORCPT + 99 others); Wed, 6 Nov 2019 17:34:11 -0500 Received: from smtprelay0077.hostedemail.com ([216.40.44.77]:38489 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727196AbfKFWeK (ORCPT ); Wed, 6 Nov 2019 17:34:10 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay02.hostedemail.com (Postfix) with ESMTP id 130DC1260; Wed, 6 Nov 2019 22:34:09 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:599:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3872:4250:4321:5007:6119:8603:10004:10400:10848:11026:11232:11658:11914:12296:12297:12438:12740:12760:12895:13069:13311:13357:13439:14659:14721:21080:21627:30054:30091,0,RBL:47.151.135.224:@perches.com:.lbl8.mailshell.net-62.8.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: bean84_5e4a6809fff01 X-Filterd-Recvd-Size: 1842 Received: from XPS-9350.home (unknown [47.151.135.224]) (Authenticated sender: joe@perches.com) by omf17.hostedemail.com (Postfix) with ESMTPA; Wed, 6 Nov 2019 22:34:07 +0000 (UTC) Message-ID: Subject: Re: [PATCH] xtensa: improve stack dumping From: Joe Perches To: Max Filippov , linux-xtensa@linux-xtensa.org Cc: Chris Zankel , linux-kernel@vger.kernel.org, Dmitry Safonov , Petr Mladek Date: Wed, 06 Nov 2019 14:33:55 -0800 In-Reply-To: <20191106181617.1832-1-jcmvbkbc@gmail.com> References: <20191106181617.1832-1-jcmvbkbc@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.34.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2019-11-06 at 10:16 -0800, Max Filippov wrote: > Collect whole stack dump lines in a buffer and print the whole buffer > when it's ready with pr_info instead of pr_cont. This makes stack dump > lines consistent in SMP case and relies less on pr_cont/printk > differences related to timestamps. > Make size of stack dump configurable. > Drop extra newline output in show_trace as its output format does not > depend on CONFIG_KALLSYMS. [] > diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c [] > @@ -512,10 +510,12 @@ void show_stack(struct task_struct *task, unsigned long *sp) > for (i = 0; i < kstack_depth_to_print; i++) { > if (kstack_end(sp)) > break; > - pr_cont(" %08lx", *sp++); > + sprintf(buf + (i % 8) * 9, " %08lx", *sp++); > if (i % 8 == 7) > - pr_cont("\n"); > + pr_info("%s\n", buf); > } > + if (i % 8) > + pr_info("%s\n", buf); Could this be done using hex_dump_to_buffer by precalculating kstack_end ?