From patchwork Thu Aug 3 20:52:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Levi Yun X-Patchwork-Id: 130868 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp1423543vqx; Thu, 3 Aug 2023 14:47:00 -0700 (PDT) X-Google-Smtp-Source: APBJJlEQ0B8ATf90HKJKBnIpGC7uLn+kKcHkhMsCt+M+J7CGvwz8WqwrwqQ89V4cLudr+b2jRnNt X-Received: by 2002:a17:902:ce92:b0:1b8:1591:9f81 with SMTP id f18-20020a170902ce9200b001b815919f81mr21497363plg.4.1691099220155; Thu, 03 Aug 2023 14:47:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691099220; cv=none; d=google.com; s=arc-20160816; b=gqr2p8SpBOEyFM29fx6wdGJqKFzPvYqdqrhvFD38WMltEJVHVvY4M3uEHH5MDTxgdU z5LshRE6gSt/pIJtFU20Uiw0mHZz/4rp2hhYV/4S79JXnOLV6u+D28xmkchwGSBoA/+e v5CTBRgUk5dBm+BjfC5ETSCpqrFnEBsXhlWSoNYWMENUNZG8BUx+E0Th/8xDWgtxleko fy+N0EkRRe36ZQJPueH3OheOITS5OGaiStEDSZS6zWUdNV8FNdjrBPXiYcGb13CMhh1D jfYMHVXtedJ/441UTZZjHSX6+RqlMmBXL0EO7W/+rvuh0ZpeTOF91F39BPoscLjwg8CJ 0kKA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c3-20020a170902d48300b001bbad3b063bsi594496plg.345.2023.08.03.14.46.45; Thu, 03 Aug 2023 14:47:00 -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 S230097AbjHCUwo (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 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773246055922292303 X-GMAIL-MSGID: 1773246055922292303 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 */