Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp194103lqr; Wed, 5 Jun 2024 03:17:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUeC22eqR0CVWNNQkZE/R6z/BXal68OOcr7agWlQbTUmzVxatH25eKetN5RnkhdMgLuy0ieKCAy88JXKAO/CQDTQKNcnPyjzPZuhgT5fw== X-Google-Smtp-Source: AGHT+IG+qoN7LX0PMhkx0cNssscYWgHvRmWKuCrSSSP9bTGOLXtaQQb0eUG9p3eCRaXLx961HaQQ X-Received: by 2002:a17:906:13da:b0:a68:c06a:7826 with SMTP id a640c23a62f3a-a699f363816mr164807966b.16.1717582665074; Wed, 05 Jun 2024 03:17:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717582665; cv=pass; d=google.com; s=arc-20160816; b=P7GXmR6qGMyMm7Jub5uE3lDeKTXRE/P1SiLNHFKQHzdcgBHnKjgQrQ4g5vFJsgOfqr /XiSaBc1QsFCOOlNkM8ugg1E0CMkUhBZj2RK9qHyCWNUMITfiYfcuOmZecu7F6HKTPCD kFKQukqHt1XZkExOe/LqaCT6uQubEUP3zc9PwIjFxQE79NXJ8mz3x9JxjngGzn1hKtM5 uZgkAu3YffbWiXwDIMgTeeOQ9KlVKTLEXgBwJPshY0BGEVMdDIq7Ym21WAtzpv5V8tKO uZOitKqnBIje2bMnTGcSpZgalVp8wqWm/rZu8HDcs1MwgYgpnQO3zh3+hhqFymyGfaKS jP0Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=xNQDRVAnQsoevrAG4zE1/lTpLKgheAmpA7HF/Wy8/wg=; fh=D7vGFCemkZDU34ZWTdMMgxTv/fBH8o6Jqms0Kr1Z2d4=; b=EmMyDM4tLdwQwe4kmebUZCytlo6HkKB97xMCljppqjzAKuS71oj3fuVjWjsYtQk6J1 V9tIeqL8p6bWp7SXz0RpRmtIiYFtxlZW2h/gjE7SmD+G0EI6RR9rGG4s2VwwpAOnE7MW MmBLlfwdYS+d2CzW9yZ0Iii6JLs4H+7OPjOQ+DK8uEVJSq5IIUMaD9Wxod1tjQ7YdtWb 0LlEUf0OKtgCk5gNtjXixqHcK8buwWNhsMLYhZhRmDjxLrK1oYdEDs7t9jprLKgM7ymk hjcnUA3iyUzWkFhTseCraTmnmFdLVZ6jRN52tqw0kzX+5mHTW8Le09dylSQVhdTnVDL6 fc5Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-202180-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202180-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a690b3903a6si299871166b.822.2024.06.05.03.17.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 03:17:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202180-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-202180-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202180-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id C8F871F23520 for ; Wed, 5 Jun 2024 10:17:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 823F0190050; Wed, 5 Jun 2024 10:17:38 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D0371946D5; Wed, 5 Jun 2024 10:17:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717582658; cv=none; b=P21PrgSqRcqe+ToaI9byHO7dO0iQsY/I9BRoqVkx+/7fdUHZYjqK21BCPLXe7NYZfPuqOJytrcoVReotrPn7pVvDkdIRxHucpc5rhh7eQ5dnlxd5BVaHmcYsj3RL5kUuL0xmRNYxGvfv3ILbM621iRlbLGkTFSCM02EVZybSUCM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717582658; c=relaxed/simple; bh=vUJv8L+3IefnszZ1AcCTOOyf8R37J+f44bfYO2qfp7g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MJ4M+OPv6SL9V1bR6UUB8atQbskuX9ObV7vay96uxIj/b7FFhkkMFpqCa5oTHElGWLHKlIQGKD4e1++XpGVn6sb1PkIWKhjvwES7itTwRkVi0Eeh6a0Cn+lVADo/QWl56YidnsozMnR1TfWdyvatza6g95CfyxnXxwYvVO5cD9I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EA54A339; Wed, 5 Jun 2024 03:17:59 -0700 (PDT) Received: from J2N7QTR9R3 (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5D2293F792; Wed, 5 Jun 2024 03:17:34 -0700 (PDT) Date: Wed, 5 Jun 2024 11:17:31 +0100 From: Mark Rutland To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Masami Hiramatsu , Mathieu Desnoyers , Andrew Morton Subject: Re: [PATCH 3/5] ftrace: Remove "filter_hash" parameter from ftrace_hash_rec_disable/enable() Message-ID: References: <20240604212817.384103202@goodmis.org> <20240604212854.883675803@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=us-ascii Content-Disposition: inline In-Reply-To: <20240604212854.883675803@goodmis.org> On Tue, Jun 04, 2024 at 05:28:20PM -0400, Steven Rostedt wrote: > 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) Looks good to me. Acked-by: Mark Rutland Mark. > --- > 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 > >