From nobody Fri Dec 19 06:17:46 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D441C71153 for ; Sat, 2 Sep 2023 11:51:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352116AbjIBLvY (ORCPT ); Sat, 2 Sep 2023 07:51:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352079AbjIBLvO (ORCPT ); Sat, 2 Sep 2023 07:51:14 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED26710F6 for ; Sat, 2 Sep 2023 04:51:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 25F8BCE25C7 for ; Sat, 2 Sep 2023 11:51:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F195C4339A; Sat, 2 Sep 2023 11:51:07 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.96) (envelope-from ) id 1qcP9r-000Jxm-0l; Sat, 02 Sep 2023 07:51:19 -0400 Message-ID: <20230902115119.048419430@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 02 Sep 2023 07:50:40 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Andrew Morton , Levi Yun Subject: [for-linus][PATCH 05/11] ftrace: Use within_module to check rec->ip within specified module. References: <20230902115035.786076237@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Levi Yun within_module_core && within_module_init condition is same to within module but it's more readable. Use within_module instead of former condition to check rec->ip within specified module area or not. Link: https://lore.kernel.org/linux-trace-kernel/20230803205236.32201-1-ppb= uk5246@gmail.com Signed-off-by: Levi Yun Signed-off-by: Steven Rostedt (Google) --- kernel/trace/ftrace.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 05c0024815bf..c46dd6d97afe 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -6779,8 +6779,7 @@ void ftrace_release_mod(struct module *mod) last_pg =3D &ftrace_pages_start; for (pg =3D ftrace_pages_start; pg; pg =3D *last_pg) { rec =3D &pg->records[0]; - if (within_module_core(rec->ip, mod) || - within_module_init(rec->ip, mod)) { + if (within_module(rec->ip, mod)) { /* * As core pages are first, the first * page should never be a module page. @@ -6852,8 +6851,7 @@ void ftrace_module_enable(struct module *mod) * not part of this module, then skip this pg, * which the "break" will do. */ - if (!within_module_core(rec->ip, mod) && - !within_module_init(rec->ip, mod)) + if (!within_module(rec->ip, mod)) break; =20 /* Weak functions should still be ignored */ --=20 2.40.1