Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5247358imm; Tue, 31 Jul 2018 07:52:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf0MqGFGKA52l1caYZZbfMiMIT/MITjaVIct1pJPBLu8VNVeNHQf3BWacSL0wlqd+d5YWcr X-Received: by 2002:a63:1063:: with SMTP id 35-v6mr20884598pgq.249.1533048754287; Tue, 31 Jul 2018 07:52:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533048754; cv=none; d=google.com; s=arc-20160816; b=bmiOtKy09TuUXX0BZH6848a00HoSt83tW8sxJXfMA9uEoXOaIJ/r13WzPDbGinTIrV 8dlOKWvvjfR96HcP5LDeArV38yFizm4Me1ptnPztIonai9gc90HWSgW+wgVlSTnrYtur 82qybZJjqA9rhc2b429z3SKOes6arinPAMvQ2YVSkfNJH1Ai61aWKYWW/QjzJHyX9Mjp hkM7acs2LS5DXJjWMpRvzWbxi5ce2OKV9iNlV5SII3OSEgn4p7fMPH92UKRLn0kl6u9Y 5YAdZDcUNhwkw6NZ28+/hGGmq51cK/i1o8jgZS/95VZNV5OnDX35WBLUXs8foYnx8I72 5Lmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:subject:cc:to:from :arc-authentication-results; bh=lW2P4jFfULpaVBXtsDRkJhQk0vyBWCUKFQyZDt7QxiY=; b=Pew3RmYWVpPmcHJfpvxJ10K8EnRS7scJs6E3Xzet1NCBpB43sggpGligrIXvRw80bS qw3L+TahyyE3xtZZtfZCUVr7bB5M74nK2UeK8iSFx4NBP4bLfewSUxNzG1yh5qo1/BE6 R5SNSNEfbwC18wKEZ0ykVr2qwMDbltS7/HpaiA1jbsSzE2v/efKTYlxvwLpVxnQJoSLb ZCpNebSubzJtqxdxHoZtjsdFzpJIHjLQklYuw+Dshzao95Mh8G8eM2lsMUAp/saA918S /Sd/wM3Axn5a1ZUwO1DvjhNOw7UygJFdQZ/64mKS60B9cBxP1nMHMsk9SeT19LOQaroT XwVg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 67-v6si15326880pfc.21.2018.07.31.07.52.20; Tue, 31 Jul 2018 07:52:34 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732632AbeGaQbw (ORCPT + 99 others); Tue, 31 Jul 2018 12:31:52 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:35672 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732443AbeGaQbv (ORCPT ); Tue, 31 Jul 2018 12:31:51 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6VE8xkw012999 for ; Tue, 31 Jul 2018 10:51:09 -0400 Received: from e36.co.us.ibm.com (e36.co.us.ibm.com [32.97.110.154]) by mx0a-001b2d01.pphosted.com with ESMTP id 2kjqk4xpbc-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 31 Jul 2018 10:51:09 -0400 Received: from localhost by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 31 Jul 2018 08:51:08 -0600 Received: from b03cxnp08025.gho.boulder.ibm.com (9.17.130.17) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 31 Jul 2018 08:51:04 -0600 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w6VEp3B864094452 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 31 Jul 2018 07:51:03 -0700 Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EC0E2BE05D; Tue, 31 Jul 2018 08:51:02 -0600 (MDT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B9A67BE04F; Tue, 31 Jul 2018 08:50:59 -0600 (MDT) Received: from kermit-br-ibm-com.br.ibm.com (unknown [9.18.235.193]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 31 Jul 2018 08:50:59 -0600 (MDT) From: Murilo Opsfelder Araujo To: linux-kernel@vger.kernel.org Cc: "Alastair D'Silva" , Andrew Donnellan , Balbir Singh , Benjamin Herrenschmidt , Christophe Leroy , Cyril Bur , "Eric W . Biederman" , Joe Perches , Michael Ellerman , Michael Neuling , Murilo Opsfelder Araujo , Nicholas Piggin , Paul Mackerras , Simon Guo , Sukadev Bhattiprolu , "Tobin C . Harding" , linuxppc-dev@lists.ozlabs.org Subject: [PATCH v3 7/9] powerpc: Add stacktrace.h header Date: Tue, 31 Jul 2018 11:50:18 -0300 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180731145020.14009-1-muriloo@linux.ibm.com> References: <20180731145020.14009-1-muriloo@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 18073114-0020-0000-0000-00000E461E0B X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009463; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01068483; UDB=6.00549299; IPR=6.00846683; MB=3.00022427; MTD=3.00000008; XFM=3.00000015; UTC=2018-07-31 14:51:08 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18073114-0021-0000-0000-000062792EE7 Message-Id: <20180731145020.14009-8-muriloo@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-31_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=923 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807310137 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move show_instructions() declaration to arch/powerpc/include/asm/stacktrace.h and include asm/stracktrace.h in arch/powerpc/kernel/process.c, which contains the implementation. This allows show_instructions() to be called on, for example, show_signal_msg(). Signed-off-by: Murilo Opsfelder Araujo --- arch/powerpc/include/asm/stacktrace.h | 13 +++++++++++++ arch/powerpc/kernel/process.c | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 arch/powerpc/include/asm/stacktrace.h diff --git a/arch/powerpc/include/asm/stacktrace.h b/arch/powerpc/include/asm/stacktrace.h new file mode 100644 index 000000000000..217ebc52ff97 --- /dev/null +++ b/arch/powerpc/include/asm/stacktrace.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Stack trace functions. + * + * Copyright 2018, Murilo Opsfelder Araujo, IBM Corporation. + */ + +#ifndef _ASM_POWERPC_STACKTRACE_H +#define _ASM_POWERPC_STACKTRACE_H + +void show_instructions(struct pt_regs *regs); + +#endif /* _ASM_POWERPC_STACKTRACE_H */ diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 50094c44bf79..e78799a8855a 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -1261,7 +1262,7 @@ struct task_struct *__switch_to(struct task_struct *prev, static int instructions_to_print = 16; -static void show_instructions(struct pt_regs *regs) +void show_instructions(struct pt_regs *regs) { int i; unsigned long pc = regs->nip - (instructions_to_print * 3 / 4 * -- 2.17.1