From patchwork Mon Dec 11 12:50:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Senozhatsky X-Patchwork-Id: 10104983 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 85388602B3 for ; Mon, 11 Dec 2017 12:54:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59EB229587 for ; Mon, 11 Dec 2017 12:54:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D6CA29589; Mon, 11 Dec 2017 12:54:00 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable 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 F09D729587 for ; Mon, 11 Dec 2017 12:53:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753052AbdLKMvg (ORCPT ); Mon, 11 Dec 2017 07:51:36 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:36012 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753031AbdLKMvb (ORCPT ); Mon, 11 Dec 2017 07:51:31 -0500 Received: by mail-pf0-f195.google.com with SMTP id p84so11471584pfd.3; Mon, 11 Dec 2017 04:51:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tGwX8z91QSwwkSQBUA9U7aM8223sfdzPuJhMLjL97Tg=; b=BuJsLJHINypmi5UJYd7iU5s9duFa1M85AJJM6MFpEIA/Ku+f2Ked4ymbmLe6rBdKaO TpRbLmd7V61Bq0wfhYnz4l8HtHJcHzHHTylY2mrxg++V9cSQMRYcKitBVpAFPH5b4qiO nmQxEiTS6xwK8jDenbB/hdavnvQEHUYSNhConpDSsITzC6AmG3mpz0NPDcRGPchnv2rD 3wglt+NYclFEqbCyz12qnUczSvxdUkvzt3fluiW4fbG9esyGuEapGCDenQmy91aETtCl Xh/S9jYQzbWK68sqbJKDKHVExoDPTKqgncBJmsM70psXxIew207uLOZMZ2FL8K4jpyjX yFfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tGwX8z91QSwwkSQBUA9U7aM8223sfdzPuJhMLjL97Tg=; b=Ajm7YGCBSfv9QFXV0IEzrfcZFL5n+/WCUoVv75OsgBHIpF4NMjfW8kreJ3clPmNYeX fVv4dHN+lM9E1pNVO1B/OKITarEd44KhjfTFR5xSVKWx3qQfNW7RtxQRgSQq5z8EcqAw S9FHRB6c3t0N5BJF04y/k5rgkvO5HVf6PoJz/U415Bpj41Xj/GTR/umfg39/fDibrBZf KpYpuxNAR2AzAavjEuPt43JNayKgl/Hn76p7ZC5s7/HBmIG9++7Wury3kKUjsv6xYle7 JsnDWr0pUd3bORTif7gsDgkqYieVj1knLFth1Fe6mKrHeu2JmBqKVV+29J4Mu5UfOOKT P76A== X-Gm-Message-State: AKGB3mKgqk2HtOS6j9jw9YwlzO880FwmSx6YWFoSaC+/M4qz4jv+WqJp ur/kRPrxaq8722EOhpWp2vo= X-Google-Smtp-Source: ACJfBov/EK4eVWdpQDZ1KIJ7r/7yjltoLvHTO8AGpS4gn2YjKT0zBZACEUNllqYpbkN7akH3YEjgrg== X-Received: by 10.101.101.205 with SMTP id y13mr238203pgv.249.1512996691309; Mon, 11 Dec 2017 04:51:31 -0800 (PST) Received: from localhost.localdomain ([110.70.53.61]) by smtp.gmail.com with ESMTPSA id j13sm23374380pff.131.2017.12.11.04.51.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Dec 2017 04:51:30 -0800 (PST) From: Sergey Senozhatsky X-Google-Original-From: Sergey Senozhatsky To: Andrew Morton , Russell King , Catalin Marinas , Mark Salter , Tony Luck , David Howells , Yoshinori Sato , Guan Xuetao , Borislav Petkov , Greg Kroah-Hartman , Thomas Gleixner , Peter Zijlstra , Vineet Gupta , Fengguang Wu Cc: Steven Rostedt , Petr Mladek , LKML , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-ia64@vger.kernel.org, linux-am33-list@redhat.com, linux-sh@vger.kernel.org, linux-edac@vger.kernel.org, x86@kernel.org, linux-snps-arc@lists.infradead.org, Sergey Senozhatsky , Sergey Senozhatsky , Fenghua Yu Subject: [PATCH 04/13] ia64: do not use print_symbol() Date: Mon, 11 Dec 2017 21:50:16 +0900 Message-Id: <20171211125025.2270-5-sergey.senozhatsky@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171211125025.2270-1-sergey.senozhatsky@gmail.com> References: <20171211125025.2270-1-sergey.senozhatsky@gmail.com> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP print_symbol() uses extra stack space to sprintf() symbol information and then to feed that buffer to printk() char buffer[KSYM_SYMBOL_LEN]; sprint_symbol(buffer, address); printk(fmt, buffer); Replace print_symbol() with a direct printk("%pS") call. Additionally ia64_do_show_stack() had extra buffer [128 bytes on stack], which we also can drop now. Signed-off-by: Sergey Senozhatsky Cc: Tony Luck Cc: Fenghua Yu --- arch/ia64/kernel/process.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c index dda0082056b3..968b5f33e725 100644 --- a/arch/ia64/kernel/process.c +++ b/arch/ia64/kernel/process.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -69,7 +68,6 @@ void ia64_do_show_stack (struct unw_frame_info *info, void *arg) { unsigned long ip, sp, bsp; - char buf[128]; /* don't make it so big that it overflows the stack! */ printk("\nCall Trace:\n"); do { @@ -79,11 +77,9 @@ ia64_do_show_stack (struct unw_frame_info *info, void *arg) unw_get_sp(info, &sp); unw_get_bsp(info, &bsp); - snprintf(buf, sizeof(buf), - " [<%016lx>] %%s\n" + printk(" [<%016lx>] %pS\n" " sp=%016lx bsp=%016lx\n", - ip, sp, bsp); - print_symbol(buf, ip); + ip, (void *)ip, sp, bsp); } while (unw_unwind(info) >= 0); } @@ -111,7 +107,7 @@ show_regs (struct pt_regs *regs) printk("psr : %016lx ifs : %016lx ip : [<%016lx>] %s (%s)\n", regs->cr_ipsr, regs->cr_ifs, ip, print_tainted(), init_utsname()->release); - print_symbol("ip is at %s\n", ip); + printk("ip is at %pS\n", (void *)ip); printk("unat: %016lx pfs : %016lx rsc : %016lx\n", regs->ar_unat, regs->ar_pfs, regs->ar_rsc); printk("rnat: %016lx bsps: %016lx pr : %016lx\n",