From patchwork Mon Apr 18 13:22:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: He Zhe X-Patchwork-Id: 12816621 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9DAB5C433F5 for ; Mon, 18 Apr 2022 13:35:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TRmgBahmPzsqDqXqWQ+VfyqW7qNM0xCVCtSFFGHEoUI=; b=UoM8rDqDQsUeMt 63Nb+VVNxCtNypDobpDU5Znr9QWiMYeeh4GJkZGJV1SZoJelRNR7dT7An2EtjtFD+ZIMFr9JjIoXg 7xs4+N1xwU8r69Co+iDaIKomnQkl/m4k6A7u4AdK/LNnx1uBTHnBAsruPfCvW5q3kMzvY93xClkmH kvL3xHGOoO8VjoNIZGxjxz9UwoaRP8gnvFAPZETMd4qs+s47/fNmUBxThJqryESpxD6Q9IZoyNlnM oX6zCCyTAKh5GrvxiOQVu3IVOC4ONw36XM/kGr7bLvNc+lJpS7mgx3Pv4IxrPkK2PPxA0Gd/yzuhB DZi/EYdJiogUI13WjXNg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngRVg-00H5OH-1S; Mon, 18 Apr 2022 13:33:48 +0000 Received: from mx0a-0064b401.pphosted.com ([205.220.166.238]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngRLj-00H0MO-Nz; Mon, 18 Apr 2022 13:23:30 +0000 Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 23ICpX2o007677; Mon, 18 Apr 2022 06:23:10 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=PPS06212021; bh=+ZlBGbmmFuH0EnsblfGqUbucFTvETbcXmwFeuOEOMkU=; b=GnoF1GZSc42SUp2R2+eM0qX5TZzwqiEFt3azsmsE9SlfiGba0YNDv53rX4VKgmsNmYrM h8+pKZCv6BSr/yIIwGVH9yKnLqP9GT8yJKpdc3z2kCcf7YZ2GQ6BmEtutO8DaeKuIPo/ qQlSD6Kgvg6j32Dr51WtKcHPq9h5osYQXZOiKd4aSVc03C5q4a3Nm26gImZ+7KX+tz6r QAoo5qoGBRAcjU6K7KVl7Ub21w2WQAzGYK192aUlezhBCMFm3wM+kyzmE3Pp1Jcalwgt kla+R3ahG/D1eX7i/fQ5KC2f1wuQRazHOlq5+CQbhYNO+j6qq0OUQCFXemjN/v3froFj 6A== Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam08lp2041.outbound.protection.outlook.com [104.47.74.41]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3ffs3118r9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 18 Apr 2022 06:23:09 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S+NQy8ZXT4CVp3bQBw3ehPG4rtu11IDJ2LI6L6Gf+T/8PPxmmaTVIIbJCt8SAjv1erbJbu4AX0SiuSFFPHKFF4ijCHwOTbcZR1m33t87AtL+d/pUX83cPfgEZhPwIE0e2V82r4AqF77X4/fG7mafzSuCPoayZIcxXdmA5mBiOeUQ7tNJQKCsTGxYNYAvBJYK8zlKZ8Yess7UapYjyzohhBAbUQw78lz7l1filpwSvi65v25VgOu8hSIUxsBadVBIe7gWlPkco88Xq9l8qunrV3rfz1FiAMI9cej1a9jQkLIxMjV8enVkFLqlwu67H8TpPvnU7swcqu+VB2iDSg/wCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+ZlBGbmmFuH0EnsblfGqUbucFTvETbcXmwFeuOEOMkU=; b=jeyXHRPsQUK+uIBWBz3ODTQgnj36mKLZLXwzHAFJ6Be5w9Y3MOTKOgE/0cf/lbxzy+AN3IUbCeNButH/JxeZWTDrGUwl5V4v0J2GJL3HxiB7JiBeAhauVf7A6J1M3U8rUV+Jgt/b/WQZdgC474j/VagP6xpCBPmVXLIcX1j7TihEGffTkpXgXVkQwORN9f1uZY0BZrZIepPVISY7UYSpbl2XD3rZbpUSM3CCPsvmu9y6stjuM2FFP4jDgMh3tE30nl23lZCfniz62wAfSxrijfuE6Pxmn/3Iavkwwj0AVmx5nvG/PAHlIKXsiZLGLh67cBUqJqTKsXbEpjkshG1r5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from MWHPR11MB1358.namprd11.prod.outlook.com (2603:10b6:300:23::8) by BN6PR11MB1473.namprd11.prod.outlook.com (2603:10b6:405:a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.18; Mon, 18 Apr 2022 13:23:07 +0000 Received: from MWHPR11MB1358.namprd11.prod.outlook.com ([fe80::1cd4:125:344:9fc]) by MWHPR11MB1358.namprd11.prod.outlook.com ([fe80::1cd4:125:344:9fc%7]) with mapi id 15.20.5164.025; Mon, 18 Apr 2022 13:23:06 +0000 From: He Zhe To: catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, tglx@linutronix.de, bp@alien8.de, dave.hansen@linux.intel.com, keescook@chromium.org, alexander.shishkin@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org, benh@kernel.crashing.org, paulus@samba.org, borntraeger@linux.ibm.com, svens@linux.ibm.com, hpa@zytor.com Cc: x86@kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, zhe.he@windriver.com Subject: [PATCH RFC 6/8] s390: stacktrace: Make callbacks use new prototype with frame info Date: Mon, 18 Apr 2022 21:22:15 +0800 Message-Id: <20220418132217.1573072-7-zhe.he@windriver.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220418132217.1573072-1-zhe.he@windriver.com> References: <20220418132217.1573072-1-zhe.he@windriver.com> X-ClientProxiedBy: HK2PR02CA0133.apcprd02.prod.outlook.com (2603:1096:202:16::17) To MWHPR11MB1358.namprd11.prod.outlook.com (2603:10b6:300:23::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cb629049-01cc-414e-111d-08da213e931b X-MS-TrafficTypeDiagnostic: BN6PR11MB1473:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nYHQPLbE2qMzo0bog1p+QqBu+aoUoFBh6D1wWKJ9rLtI0VzQdVErZtCXiEmJvYVD0DOTPm3vO4WNLTeul8PahplGMeCxWRoVPknJ3ImuL9eP0dX6b4pxuK/qGzMBUOB8WGbDgX99l20Zqyx9/S3UTxGrnSulAxFwGBLeEdixJMHRKeLrFz6A5INxo00C54+LSyzsT2TJdETNh4BbWLl9kjnnI8wxa+MaELrThRfUDrRLkp6HQL3+Z8GSJRiMYciEwtBCeqW7hYNZl2Mfubr4FqLLOuHArXh+2oBzIy4ChJe0FX1LOFIcpGmf2FbBH7kvGAKQrM5bPfq83w3x1DJ1eFWCwSGqOngkCv7/pG1M599puPw4UlRwPXROANI8kXDWyAOH5NYbLQMuslR7dkmYNlDXKuER1Aeokcwc67e74yzlmMmq7rIuYxTcNjwevNJQGYFFGvzooUDb6LWIcC77VW9ni/8Crxd5NeewlNI/QZ4Fg+busg/ug3n4Q0xCTGOET0MoiCFB/QNa0dwrIBFgpO4Bkfrvyx5qFjfuaRVdxoDKm5FSIeWF35JSdC9YkdzL9VLTMjbnjxSDftkMDDhXzIBzfcfAqzszRpJMYpWnJ+6WQRK9y3Qe0a4irAbvBshFALgbkQWLdiAkzeo8r04GFGoZLko1d41/V+nuYuA79v48I0L+90c7SeSjV5+ZYEtL7lvGUBTU0vvZcvMhsj0ASww4aiGjQ7+atcUU/eUjQNM= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1358.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(86362001)(5660300002)(83380400001)(52116002)(26005)(6506007)(6512007)(8936002)(1076003)(107886003)(2616005)(38350700002)(38100700002)(186003)(2906002)(7416002)(508600001)(36756003)(921005)(6666004)(6486002)(316002)(66946007)(66556008)(66476007)(4326008)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NOIxFjHCwuZ5kpb1Yz7IzQZEt47p3HN5QHFw8/Hts8A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VByMOp4dXB8PYSpP5PNpz20HiGQKT84PDvXw/BSxRt4OCnpqjEtEKGYHETrZKJY79Xcra5l476faBXDfDAFfvY5BgHNrNlWWYwjCKoLkEoGrm/lsk/8GvhQ6EMva0DDhHcEd9H0nhuPGMl6GHWlou/4dTRHvGRyF/Fo7XRqY7SgBiwjLwxbbkSRN+3Xkg+B3m4Plbdcu4YBSFjCa3/NW17vdYDJrA243Krhxhv/p4pGTl4Ng76r61KYI7FtyLqGZMGGZNBZhSFzfBcgZfXPfFPv5Zv1bpT0i+BCVfXK0V1f+btZRFxMGH7/D5AoRbQ6EXnNJXwHmoZBGSbfeyKGW72CCyEe4uCtcg2rilZqUWm74pIVqPqRmYK0P4vjfF4eSGYC5rDbgqSP3HGIXcJ/I0ZcqIIRkotqk9/JHRM2uzn1L9Stu9b6I4WXfRdLEo1jMkpNjNb1JWCYiht48fIjMcPJi+47r0sQTcvtKu3eXXZnbUI7l0bvInXzQ+UwuqXyOfVvuXACNdYrQgUK2r2D+1izpRZY11d3lIjxjMueh6IEPmbMjcnUCaMlqeiqyVCm2LAZNI9aeDBOWKzpH0+on2A0V2PjlKxhQzEwr6VwOaR1lnmvzQ== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: cb629049-01cc-414e-111d-08da213e931b X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1358.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Apr 2022 13:23:06.7466 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VoYCIAxzwI9rBjncuFQNduLOburjZpVxN5hmb7dRDU/W4kHgMY9R4ka2wLG5PZQKHt8YRcy+I7OdsnhYJPBGnA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1473 X-Proofpoint-ORIG-GUID: fl8Os_InqEnXl8h61EvDV0gQnr-XMSCN X-Proofpoint-GUID: fl8Os_InqEnXl8h61EvDV0gQnr-XMSCN X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-18_02,2022-04-15_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 mlxlogscore=573 mlxscore=0 adultscore=0 clxscore=1015 spamscore=0 bulkscore=0 malwarescore=0 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204180078 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220418_062327_860998_CA2344BE X-CRM114-Status: GOOD ( 15.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org stack_trace_consume_fn has been changed to bool (*stack_trace_consume_fn)(void *cookie, struct frame_info *fi); to be able to pass more information. Turn to use pc in struct frame_info in arch_stack_walk callbacks without functinoal change. Signed-off-by: He Zhe --- arch/s390/kernel/stacktrace.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/s390/kernel/stacktrace.c b/arch/s390/kernel/stacktrace.c index 7ee455e8e3d5..66aa7da0d974 100644 --- a/arch/s390/kernel/stacktrace.c +++ b/arch/s390/kernel/stacktrace.c @@ -14,11 +14,11 @@ void arch_stack_walk(stack_trace_consume_fn consume_entry, void *cookie, struct task_struct *task, struct pt_regs *regs) { struct unwind_state state; - unsigned long addr; + struct frame_info fi; unwind_for_each_frame(&state, task, regs, 0) { - addr = unwind_get_return_address(&state); - if (!addr || !consume_entry(cookie, addr)) + fi.pc = unwind_get_return_address(&state); + if (!fi.pc || !consume_entry(cookie, &fi)) break; } } @@ -27,7 +27,7 @@ int arch_stack_walk_reliable(stack_trace_consume_fn consume_entry, void *cookie, struct task_struct *task) { struct unwind_state state; - unsigned long addr; + struct frame_info fi; unwind_for_each_frame(&state, task, NULL, 0) { if (state.stack_info.type != STACK_TYPE_TASK) @@ -36,8 +36,8 @@ int arch_stack_walk_reliable(stack_trace_consume_fn consume_entry, if (state.regs) return -EINVAL; - addr = unwind_get_return_address(&state); - if (!addr) + fi.pc = unwind_get_return_address(&state); + if (!fi.pc) return -EINVAL; #ifdef CONFIG_KPROBES @@ -49,7 +49,7 @@ int arch_stack_walk_reliable(stack_trace_consume_fn consume_entry, return -EINVAL; #endif - if (!consume_entry(cookie, addr)) + if (!consume_entry(cookie, &fi)) return -EINVAL; }