Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp382687lqb; Tue, 4 Jun 2024 14:29:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVLkuimXNcAy4I5O61zSlZNvelw8BPhebF3NO0VYRVlCg7FHNFBVXRbL4KkkHM8GOI0KVAt169p8a7L7Eespl6y3XgPcqT1B4xZ0IryBg== X-Google-Smtp-Source: AGHT+IGlNhxg3P3qgE1YIi1MM3q4eGAvVdAoHzwMEAwSz8Thjw4W6Z/kajZlzI0iGHfazPNeyybh X-Received: by 2002:a05:6214:320e:b0:6ad:7663:f4c6 with SMTP id 6a1803df08f44-6b030a55314mr4779346d6.45.1717536558027; Tue, 04 Jun 2024 14:29:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717536558; cv=pass; d=google.com; s=arc-20160816; b=D9/WuJ1WCJ4s1sLpSIvM4gcCForoSeseKCjQqulKshDXiwQIIVVEcEykvZnN3Q6j3m kULsXEJgwGS9gKC7EvssmtNRkOSt+uDsNhcP2XHa8zJppDC9qCB0P7XqMt3W07VFt95s 9qkCSaVcqFrRiLkPI+XJBhZo1+qFWNIkdTYWDv3nz1jY1bJaGFEqu+Zxh1no0zz45jot ZZU2pm4D66q08PY8/uRNWjIJQNb/TT4/pScNg71tIVky9Jb0Hpbr6J3IrH0vyxGiYu3P cNUdai69DEVYd22RxhgYlN76EaW8uBNShNwpcDISlxHHv81DeFZLSTZnPXxCu/G6Tvij 8QdQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:subject:cc:to:from:date:user-agent:message-id; bh=aqdUFmACw6Jioj8iP5sHc9zDkABkHVtUXrxMxpPA+94=; fh=mjDKelfe6UwtrbrQsWTm6mHxXqJJm1yC7XMGoQRRIY8=; b=Huxu/47jPlAcEH8i+hOcGH1+ctfeHSR4Dyvjii5VN7S75257A/QeGjZibuV7Xe7yrZ XxVfMB7DUNnS0sOUaIQRTsymyv7ec+MIWuZD26aoUQn3hmrwnIjhD/ovVVcFxZx2lCzy u/qzesBAyAiKFJbtl6+Bm0s66xPLuEiFK4Me9edNdl2QvtSH6L0NfDuFz6uehoi4UHti MpyOK33fNkAA9ZUYGkeG9MfqjCR64A5w0p1Tjf4vrqTDq0AKDMJX9HXIn5r8jUJdOHdO j6d6SzyiUImFNYXEU7ibWRpbu9GQUReDkStWVr/7Soi01fF7aeOxNwloFyxrarYh+D4T 9DXA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-201400-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201400-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4a7425d6si122970906d6.162.2024.06.04.14.29.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 14:29:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201400-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-201400-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201400-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id BBB141C20372 for ; Tue, 4 Jun 2024 21:29:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1133914D2A7; Tue, 4 Jun 2024 21:28:55 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8221514C586; Tue, 4 Jun 2024 21:28:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717536534; cv=none; b=HanW1ngPgTheoI6CnA1CNQI/VI0L/VT26VKHKzwDONf61QKz2CMXL2OpbXoTe1PalrOaNJrQXbCRc5lBQmrtyV39EBiclUyLjL1lKOM2tYJUE3EHtLXPzk5tm9ZS7NAv9VN95k88lNveRfV23ujH4PPFTe5yKSsaLOc+hmfKKJY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717536534; c=relaxed/simple; bh=JhvSJxkMdY2PHLlJ3j/YPU1BE6x6XkU5wBZAtk/6Go4=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=u6AwpmUv9jrsaU16hfydixf6eklXSOVksOVMQ3OlmxDl/CYngSdG/X06PZbUAsarFFnbS4mqFoQlNGyPDSbdY8YYv5nRE6DZUFu3+cDHDkj689kK+mCdjOqPA0uMsprns+2lnEbtGKUtAbX3ZC0VYmUN3XBGpt0ebWJ2gZXZXf8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23302C4AF0B; Tue, 4 Jun 2024 21:28:54 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1sEbiB-00000000bEK-06a2; Tue, 04 Jun 2024 17:28:55 -0400 Message-ID: <20240604212854.883675803@goodmis.org> User-Agent: quilt/0.68 Date: Tue, 04 Jun 2024 17:28:20 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton Subject: [PATCH 3/5] ftrace: Remove "filter_hash" parameter from ftrace_hash_rec_disable/enable() References: <20240604212817.384103202@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 From: "Steven Rostedt (Google)" The functions ftrace_hash_rec_disable() and ftrace_hash_rec_enable() always has 1 passed to its "ftrace_hash" parameter. Remove the parameter and pass in true to __ftrace_hash_rec_update(). Also add some comments to both those functions explaining what they do. Signed-off-by: Steven Rostedt (Google) --- kernel/trace/ftrace.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 93c7c5fd4249..de652201c86c 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -1895,16 +1895,24 @@ static bool __ftrace_hash_rec_update(struct ftrace_ops *ops, return update; } -static bool ftrace_hash_rec_disable(struct ftrace_ops *ops, - int filter_hash) +/* + * This is called when an ops is removed from tracing. It will decrement + * the counters of the dyn_ftrace records for all the functions that + * the @ops attached to. + */ +static bool ftrace_hash_rec_disable(struct ftrace_ops *ops) { - return __ftrace_hash_rec_update(ops, filter_hash, 0); + return __ftrace_hash_rec_update(ops, true, 0); } -static bool ftrace_hash_rec_enable(struct ftrace_ops *ops, - int filter_hash) +/* + * This is called when an ops is added to tracing. It will increment + * the counters of the dyn_ftrace records for all the functions that + * the @ops attached to. + */ +static bool ftrace_hash_rec_enable(struct ftrace_ops *ops) { - return __ftrace_hash_rec_update(ops, filter_hash, 1); + return __ftrace_hash_rec_update(ops, true, 1); } static void ftrace_hash_rec_update_modify(struct ftrace_ops *ops, @@ -3062,7 +3070,7 @@ int ftrace_startup(struct ftrace_ops *ops, int command) return ret; } - if (ftrace_hash_rec_enable(ops, 1)) + if (ftrace_hash_rec_enable(ops)) command |= FTRACE_UPDATE_CALLS; ftrace_startup_enable(command); @@ -3104,7 +3112,7 @@ int ftrace_shutdown(struct ftrace_ops *ops, int command) /* Disabling ipmodify never fails */ ftrace_hash_ipmodify_disable(ops); - if (ftrace_hash_rec_disable(ops, 1)) + if (ftrace_hash_rec_disable(ops)) command |= FTRACE_UPDATE_CALLS; ops->flags &= ~FTRACE_OPS_FL_ENABLED; -- 2.43.0