From patchwork Mon Apr 18 13:22:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: He Zhe X-Patchwork-Id: 12816595 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 C8646C433EF for ; Mon, 18 Apr 2022 13:28:03 +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=yB2O525n5nWdQSYzJAACjavu7XV14gdDeSFiZd+v0bE=; b=AY1nHoGUjEeQ5Z h6uKHjQW+6tRf1yLkQW/krsLIak2dVPsGZ2g73JE0/VmmxuuRQDuw3NjvQlYJFqmRh6mZJB0WOkmT PyB5JxT8vJNI0wiVen2eY3jBbk+CQAKMYrHqcHXSdg657Zc21dig+em9PrfgNA74MI92OYpAufFPe jtx0n9KmICpZB9pXiDKK/qghrs685V6uqAU+U6w6x2/UGihuuCQ0dSqinQVF92RT5j5J0DDqowHIy bxDMREBp/R3QBl+WGjn4w96381uvrxZP7qQ8VK0nQJ3sQHgFXcM7n+7Pp3H8dtNI8pRMQVigolWcK GVL3sJwPhJO4RkOXWYrg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngROk-00H26u-LU; Mon, 18 Apr 2022 13:26:35 +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 1ngRLg-00H0Jk-QT; Mon, 18 Apr 2022 13:23:28 +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 23IC03fF017303; Mon, 18 Apr 2022 06:22:53 -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=zbDgblK7RewJFoMTrbxTkPOFdnN0ql1h+vVBC3YB56s=; b=li90JFSz9j8n4ca65kS5PF7ENAFQkXf37M4gcYUV72uiskH4cnK/UreWqsDCF2bAZssI KoxKZuwG1A97q25TBl1SgHsxRSiVX+DI3USvkr5rL2MChcAfu3uOio8Op2KJeCLn1a2b aMxi6bv9sj8UTclFbj85xu6YG5FSQ4PTZJ+yjDEVq0EMFj6SEotGHDncvX5b5D7KseSZ cNQAr5kcBU8LlfXQ71nMa/G37ZTVOA/d3RyLu09aga3ZJiSiEH0dTE0wUAXQHNy7bNiC iJnlpUdqvaX/3VIPl1Bp7hY9rZ+X1jvuMq2DpwRpWvmkTC6g+Jx8c/bLtFV4eesVtkAH xQ== Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam07lp2048.outbound.protection.outlook.com [104.47.56.48]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3ffs3118r4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 18 Apr 2022 06:22:52 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M8C3puzHERKphpID9gcNtI7rr3TqCG1JeGDvmQBHg+RoSI02gZQ3FbwSOp7GILjkgcobeHkuQi9inox6//Tig47yM2PODi1Zh8lVVNEMwtMOjJnkRhGNdUQcmbxc5rTjDjb5vUVLyvODfuPFNOIJf2QT3HztIbDxZWe18LZn3zAVYV6WZZakoCtUCS/wIBgxqBNVfSrQPxVApBOuv20AcRpHX1nzRSWCjYLiOaedO2NfEORE8w7CDtKFW/UvbI+IDjl8cdbg+kKJCoOP2UwoC9WVTEPO2ndizDuW8wzpYiqUeZ2qBVDB5IIfKGInPjVLUfhm231nCeBEWfwlPHGcmA== 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=zbDgblK7RewJFoMTrbxTkPOFdnN0ql1h+vVBC3YB56s=; b=J5y/kZGvJq/O6IeWfsqlX5IWDF+PGmniftC4Tt1sn6DXvNT19U5OYY6fTQwEY8Cq3mhLVK22I7qWNr1lyLjsy/o50xqQCAggi0NZKu3VqP8nBkOTu7+Ms+rh3UP58Vj0AphfRIf6h8DCEjpoGDAOSqH+1kbype6lkfoWmjAfi9jn+l9vZU/HnGbGOsCTpcKIbUkKkFLpkxHoNtsNb/Vqc5q5XydRPwze7oaOSESlSkk7G8VTzTuIm0DC7i9l6wqEAwN0dWj6QQ5tUdjHMevyNUdWsQJuS6Dhu4cGhaLyEWOyg2HAfpJFdSaj4o3LkatdnRm6xzqJk9nUpUz24/AQ3w== 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 DM6PR11MB2857.namprd11.prod.outlook.com (2603:10b6:5:cb::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20; Mon, 18 Apr 2022 13:22:51 +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:22:51 +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 3/8] arm64: stacktrace: Make callbacks use new prototype with frame info Date: Mon, 18 Apr 2022 21:22:12 +0800 Message-Id: <20220418132217.1573072-4-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: d60d8851-3b6b-4b3d-a9a4-08da213e89e7 X-MS-TrafficTypeDiagnostic: DM6PR11MB2857: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: R2OomJ1ud8x1JfD/EgMKQOtn0GBgI7M1gxYnmAtJZp3eDOWcyQFsWEUzkRdtlFqHTn0TRtih3ykpmsHqFCwaWPEdNZmMyjZ+Yg6xVlTInwIOYoeZRESxqaZfLT8ABZ6mXDJRn/sY/erzVAey6Ild7z/61Mv26EMMB5P/OMshd5LdkPffT3VatpPy1Jy8oGeEwONKBZcSWOJphRIJ6dbUfGURCv9lyKcdvc/yv+vtUkxqvZ2FnV9yI/LCqmzc+mxJ4v6ai/37A/817MuYIc2F2yGFMTCvMEIzMlnm1IUvLxRoF5c6959/P1znVF2JluAYdUMzje3neALwIZ/09SjRnYZV962LOAnVyO0L/oz4frXFpb4V4QZ0Ll99YcT8llYN81FKll+puYvE7bMOaSGPK2bFWSlqx7rpL9zbb++A4yum8nYtetvhmUQkITXS1kO5BDWc8Yp8M+Ng9h1OIGl6rRTlLIIna2XdUTiApIm73g+lH2yxtTNkO6kyKKw2VqETUP9WzHNAeN+hWQ5TLSjoPpkafQtsNHj7s7aWXUeQejfHmOdKedmWI+ToBmfR+Qgq8y9zxjH60rNJaHA7IWU+ZlpvFJoWTMeS+XQG5ZD3iskVTXsDB2M/re+eNnUOz5FzQFZR9gSO2d4wx7Ir+LfguoSAo3+A9f5ItgW3Po8O/PYZNH1iwIbAhZQ5PSRHfpaBd5WYdZMv/yV1AJd43z0h8AVY3NFj0lptredcBb67l6s= 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)(66556008)(2616005)(186003)(86362001)(83380400001)(1076003)(38100700002)(66946007)(316002)(66476007)(7416002)(107886003)(8936002)(2906002)(4326008)(6506007)(38350700002)(5660300002)(508600001)(36756003)(52116002)(8676002)(26005)(6486002)(921005)(6512007)(6666004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ibstF8u78mMOLkjC+DkMbtk6BeGVIf2sN4/j11j5t9C07J8ntkXQNd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KZ96EoDoXQt3eAlJuUUVbackzHrKtXeHr05r1iaF1hq6j2vKCg31Hd4rVH4WTPnRJ7WqxkBSYWb+VeqUrr7kVGMGpFqah9EKx39RBKifffkuqPzNpe+9q7Xq0hR3HkX4U+LmJpI+y98o+6BQm1n+l6iZ/RtTGDlfaCSviEAmMvsrXtqbEBBBLtvF5gIHCvtAJl2ESLO2JfZcR681l7poou7w4xN/YAqMkobb9zL+vt59CBp8t1PLpRnXLN3EZqPkGuEcnqF0STt6DvO03XNKE4wPPM74/LgVy7dZWtc0N6yJoHgpzDEtz6A9WaOzSsmxAFDdwhFQJ2wCHjmJcuza2h1E0W8fmulWWUAuGfMl9oL3uH56N4S+9Hlq2rxsWvvbdRzg50ejLz4cyhhrxP5zQLr4QrjqvrgUaMVVkacisxAYrwCvsYn5yEdrZqjIcXSO0jEyVTnWIraqy3q67sSlah6U1Wq/msR7ATZ+wWzm5Ui1sfe0FD1BTU4bmsNV1hwqWC0rzYaAmnxPoIpS6z+8SJYQy3yzWR8Vb27DfN8EqdrO6Dqf5iS4C1Jj20p96av7PKf/+qYdsyxZ5pPqhkf07UQnObvpriXv3KF3QGlZtV2vwA== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: d60d8851-3b6b-4b3d-a9a4-08da213e89e7 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:22:51.2789 (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: 5AM5bRFD8rqvRXLZ7tVS2yBZbLqXJMSQywW/01BsmIw3f7qLzsRtbDgsYtppCpm+bTtovIYSWNYU7gazJIHSVA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2857 X-Proofpoint-ORIG-GUID: A3MrDu8cp4c8-4S824gXgQ6jMmsr-U6w X-Proofpoint-GUID: A3MrDu8cp4c8-4S824gXgQ6jMmsr-U6w 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=795 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_062324_944028_FDCC4F05 X-CRM114-Status: GOOD ( 17.60 ) 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/arm64/kernel/perf_callchain.c | 4 ++-- arch/arm64/kernel/process.c | 6 +++--- arch/arm64/kernel/return_address.c | 4 ++-- arch/arm64/kernel/time.c | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/arm64/kernel/perf_callchain.c b/arch/arm64/kernel/perf_callchain.c index 65b196e3ca6c..d32918b34c0c 100644 --- a/arch/arm64/kernel/perf_callchain.c +++ b/arch/arm64/kernel/perf_callchain.c @@ -132,10 +132,10 @@ void perf_callchain_user(struct perf_callchain_entry_ctx *entry, } } -static bool callchain_trace(void *data, unsigned long pc) +static bool callchain_trace(void *data, struct frame_info *fi) { struct perf_callchain_entry_ctx *entry = data; - return perf_callchain_store(entry, pc) == 0; + return perf_callchain_store(entry, fi->pc) == 0; } void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index 7fa97df55e3a..e96a8a614a1a 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -527,12 +527,12 @@ struct wchan_info { int count; }; -static bool get_wchan_cb(void *arg, unsigned long pc) +static bool get_wchan_cb(void *arg, struct frame_info *fi) { struct wchan_info *wchan_info = arg; - if (!in_sched_functions(pc)) { - wchan_info->pc = pc; + if (!in_sched_functions(fi->pc)) { + wchan_info->pc = fi->pc; return false; } return wchan_info->count++ < 16; diff --git a/arch/arm64/kernel/return_address.c b/arch/arm64/kernel/return_address.c index 68330017d04f..ec9be91623c4 100644 --- a/arch/arm64/kernel/return_address.c +++ b/arch/arm64/kernel/return_address.c @@ -18,12 +18,12 @@ struct return_address_data { void *addr; }; -static bool save_return_addr(void *d, unsigned long pc) +static bool save_return_addr(void *d, struct frame_info *fi) { struct return_address_data *data = d; if (!data->level) { - data->addr = (void *)pc; + data->addr = (void *)fi->pc; return false; } else { --data->level; diff --git a/arch/arm64/kernel/time.c b/arch/arm64/kernel/time.c index b5855eb7435d..6b1a9de7c852 100644 --- a/arch/arm64/kernel/time.c +++ b/arch/arm64/kernel/time.c @@ -32,13 +32,13 @@ #include #include -static bool profile_pc_cb(void *arg, unsigned long pc) +static bool profile_pc_cb(void *arg, struct frame_info *fi) { unsigned long *prof_pc = arg; - if (in_lock_functions(pc)) + if (in_lock_functions(fi->pc)) return true; - *prof_pc = pc; + *prof_pc = fi->pc; return false; }