Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2737937rwo; Thu, 3 Aug 2023 14:15:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlGlghPylR7v+GgShE38enoGU0sarYJ5b3gN98sS5JFatt4jIv7rMK6wNzCT8yslyFsy7+tK X-Received: by 2002:adf:ef8c:0:b0:317:5eb8:b1c4 with SMTP id d12-20020adfef8c000000b003175eb8b1c4mr8454693wro.2.1691097339288; Thu, 03 Aug 2023 14:15:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691097339; cv=none; d=google.com; s=arc-20160816; b=DwBaYOYzwogibC1w29VMlsVCzMtIwiFX/3pJ1PCFu5o1vudHj9wFqF8F8ms4EP5XWR 8emsZAqmw0eFgD4Das8vyaMTSeXOVjlVJuML4PA3c+DkFl23fK5dS+zWpnFpea+WXm69 VqbLYq5w5R6cMUkN6jfbotNxrBrLPuMcyF5B4/5ozYDFPMLCFXllsTb6j+0Bhm15vjK0 ZhEd4RKWUmoDrK56G0GhiB1dGMNDhfXMwjHiHyE4FjLQTw7FZBb36bY+cmwV0u2wP9ub csNqVfdos2nMMhUKHq4pYjJrD2kV2dLi4m0ZwffMIovTyDl5KY6B88huw6UPB6v+22yK iC1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=WUsStjJpVD7qt6r5K0hLWecq0MMWSxahYThfGKl6wi8=; fh=WBbt7B2ORktfZ94B6Tygz4Q4GfG494szuPzAvl8V5n4=; b=QH7zoBweIXbDgV/tqGxuK9TXhHZpK8raj8jAgCAxLv/NwXU4vPqYY/2UHorkszH5Gc RUQIgx9knctfUBxjW8FBXz3q4JP7QPBUuIc9riJzyLG2bW0HQqj1eGWG2Tm4EKRWSAVY xR+MggOb3HW0ydXgzNyyz/Esx3HrX/JRAcZ3b9IFDVmiNYQ5pORQ3u2XXWC1j6KvIxjw xn9OTj0/YB5TwioRsbOx6cgel1TcXbXuUm592lrIQeeIWUhIx4XNskx+ajwm3YFjHQpG Wg7ZBW7vX8zOMyEAtMiANZSoaHYppEW7YJ7Ix3aPreYaXRIhEe1BGylJa5Dmy4PTnSVr l81w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=qcUFyujX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u9-20020a17090617c900b009920f18a5e9si484164eje.728.2023.08.03.14.15.07; Thu, 03 Aug 2023 14:15:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=qcUFyujX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232226AbjHCUwo (ORCPT + 99 others); Thu, 3 Aug 2023 16:52:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbjHCUwn (ORCPT ); Thu, 3 Aug 2023 16:52:43 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25544A2; Thu, 3 Aug 2023 13:52:42 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-316feb137a7so1234284f8f.1; Thu, 03 Aug 2023 13:52:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691095960; x=1691700760; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=WUsStjJpVD7qt6r5K0hLWecq0MMWSxahYThfGKl6wi8=; b=qcUFyujXpeiN583AOnEqxZzKYkhUE7gwQyKGYlLhbux+5HUS66loXxVDZMtKUIWGts 6SeF5BoEf8I9HLoWz516J4Ve/yKd6AoRhPfwv1YdppII5Uk5DMYPoGitYTdswmiH6mE6 LgjTFrl63mjY7rFg6ECCnzz2eNePICw3jzuIhE+eAtLp6koU7t07Fps4l5K/q2g/aiqA bZTqUh+SOT3SVBsK67X495Qj/xIeVZULq9dPnu5UDC+47AB2JgsqZ8tdogayVsezGunR Ly3EBGc6/McMn19UOoz1b22QscRkDyMlN/0R6XN/Fxtx9CXZQ5RzYGeH9nn7+W5f881m M2yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691095960; x=1691700760; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WUsStjJpVD7qt6r5K0hLWecq0MMWSxahYThfGKl6wi8=; b=Bl8akAX0U1LEWLyiB/U/2Gx8fo9oorcKxsDLq3BvbhnykC0Zsj7F9u+/DLZGjb9uP1 NAgPrH3qeVi3G1k6cNs3D2W/KaljFOL1r6Zmmg8eZDpgqaNrXzcNJH5O3vrrOScDKCnF JlvtBMxgvJlbCcvIc7O/yXB9ZGkLr4u46oQhQvsfeMbdsk9h2jHmbaAdcuGHypqhntCs 3PMnPquCT8Slw348zyToK8oL8Xjk72vxK/Xv8cP13bRkq7nXp7avWMeEOnRqka9sTAiq ala8lMTdSa41UtFRLpH5LwLk3puGGdOvk/G/jXSd3eZPeQ1LC4LZdXlWqXiSLD3BKtpq NHrQ== X-Gm-Message-State: ABy/qLaeLUVazaymZMCAYXQt0j92l5A3J1TcDjBkzXarIGiWNhxEkPzf PvW4yWBz9/d2YH1laPLJgaA= X-Received: by 2002:adf:ec05:0:b0:313:ded8:f346 with SMTP id x5-20020adfec05000000b00313ded8f346mr8657716wrn.22.1691095960055; Thu, 03 Aug 2023 13:52:40 -0700 (PDT) Received: from localhost.localdomain (host86-140-156-29.range86-140.btcentralplus.com. [86.140.156.29]) by smtp.gmail.com with ESMTPSA id o10-20020a5d474a000000b003141a3c4353sm749138wrs.30.2023.08.03.13.52.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Aug 2023 13:52:39 -0700 (PDT) From: Levi Yun To: rostedt@goodmis.org, mhiramat@kernel.org Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Levi Yun Subject: [PATCH] ftrace: Use within_module to check rec->ip within specified module. Date: Thu, 3 Aug 2023 21:52:36 +0100 Message-ID: <20230803205236.32201-1-ppbuk5246@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Levi Yun --- 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 = &ftrace_pages_start; for (pg = ftrace_pages_start; pg; pg = *last_pg) { rec = &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; /* Weak functions should still be ignored */ -- 2.37.2