Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp579127lqr; Wed, 5 Jun 2024 14:50:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVvIZjDdXaEju9ZXzUY8FqbJqJJFHnNBf51UwtsjgQU2NEbWGGw7jD/dN1O36uTyUPeyzHO3x7N3K6Kw4+Pn5v4hDZiuH6E6Vj5h8uIUQ== X-Google-Smtp-Source: AGHT+IEo4FSvUNTZRD6O09VQzl9vxcIEYEdOsxPUQ+OPyIN7dVMpIhYfG70GXWM/O+ltWTEroQvs X-Received: by 2002:ac2:490b:0:b0:51a:d08d:bab4 with SMTP id 2adb3069b0e04-52bab507719mr2359466e87.55.1717624230147; Wed, 05 Jun 2024 14:50:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717624230; cv=pass; d=google.com; s=arc-20160816; b=KFcywch8EGy8F2uRLjxrBdTjHmaUEIE0S41ONdvAKRgl5qkfDBV9cQN67CFaoMb+hU x/aBNu/9C1j98vpPLI7ovM1pUpMmqOE8Lhi+8x8/VJWes0RInsqWzJKlNgthvhpuM6sp +lAaDWmRzk+/+5cso4Mw+iTXTK0TvA/yBAbSyJJm4tjRNYBLj+kntL/Oi602aRbekxvH C6836HdBG/dfHD96rOCpQZ7+b6GqK8xLOWaT4JQpntOEOfoh9CY1mcHMDa+AO30kyBWN AuEvWznbQ+BRS5qMrmI7JxgzGXt67a9KETR6ge/m+7Lhz1iix42E5DMnppgnBLWAA6cj xyGg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=Tx4Sur8UWOPUmdToBzgKqo0/YguwvPH1apw8gn5HChA=; fh=r8cahHtk9ZY6RnB34WVZMxNAFZ6PJVA0hvtHgw/BniI=; b=RZ+jbbFCv5rraQMFnEzSpwSuf7kkVa8JLxHSDsAdctBSaj7g3Ofky7siAmHtuqLEYm dQWPngNY6X6qO5AYlOhpK7NkmWEYa3bRop/WURdT0/ed5WvaXvRsKAoLqGpLfLqY4+o6 5QABJlfeNbcu10hO7yEXgs8FCkNKAh+2COqAn8cq6Vy8PFhGzHvn9Mr5cilOKmVGHHR0 xb0h1kUhSx15nt7/OHUQSXdwgdoK9BTUrejJ6ZkXFYesaqrp19Vj/t6kwzOJyfzQv3Hb sHefnQKfeNM9RaUJ/dLiu6pu5O89XIKt/lSCcHTIFv9LvLk+/67ve8q3Ni2lctwLc9T4 hAsg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TAykoGX1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-203324-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203324-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a7556c5e1si2646813a12.610.2024.06.05.14.50.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 14:50:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203324-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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TAykoGX1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-203324-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203324-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 am.mirrors.kernel.org (Postfix) with ESMTPS id D595E1F256E2 for ; Wed, 5 Jun 2024 21:50:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DF4A315EFAC; Wed, 5 Jun 2024 21:50:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TAykoGX1" 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 14974E567; Wed, 5 Jun 2024 21:50:22 +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=1717624223; cv=none; b=YdFZNHpEIHANEyvVtOEA6Ozv3KXREESey9z8seAvLTnn6G/ZLuWMQtILhzFvwcOZxytn9wSXN2jq9+zks5xHGP10pdlvwulu7KLzXZd4tt8ToR/roNsgdnT1HEQl9TUorF2bgpfX2Aq+xv4uck2i54Dun22Qkop7iamVJB+tOx0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717624223; c=relaxed/simple; bh=Ymc9wcpaG97mbeNDzlGXrcwYGTgFta7AZuf3yen2Aio=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=Q6oxGfv8J8dvTkEv2k/M8uSz2D8/vLffhUx9T5MsaJBqtOc83xCiZv3HUx7QH/cf6GdOai6aD6LOE+cS8RoXOAy8VqCxq+5S8914d3yimq5BDqqLodi5tuoE+YGHgsNHD/gziQtmOQz5a4/9qyTjwykPUEDn4ILjonlc1CtLXFc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TAykoGX1; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4B34C2BD11; Wed, 5 Jun 2024 21:50:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717624222; bh=Ymc9wcpaG97mbeNDzlGXrcwYGTgFta7AZuf3yen2Aio=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=TAykoGX10RKgePgPfuf2G/JzeaU6Ebd2RnNuyIrLkKrilRieEQMr3dr2xosrlEfcT XeC/hxNvXZX4be+hORGScwlXVnYbqwAM5Cewt/akt+mDmxWYu2x7V9qA1cK/QPpbBO 4GuKIQYJGRL7sxLhfGIhNeEM0rmGwJ/ZDqjBfZC05GU7fk8k1coZ93O25bdAQC/fvT kow/IKgFiN51Z4rEXqtwgcYN6lc9PZ/DAqYpjNPDpD3RjJVDoOhuD/lNkNTdOqNp58 zZ6R3mQcUZ5u3mrvv6vlJbosOqlIQc3v8Pg8xfRCNQX1a+b19xDZPzlyCMs4NA237/ TULEy2zU0zAKw== Date: Thu, 6 Jun 2024 06:50:18 +0900 From: Masami Hiramatsu (Google) To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton Subject: Re: [PATCH 3/5] ftrace: Remove "filter_hash" parameter from ftrace_hash_rec_disable/enable() Message-Id: <20240606065018.0bf1d82a3bf9c526aee9a170@kernel.org> In-Reply-To: <20240604212854.883675803@goodmis.org> References: <20240604212817.384103202@goodmis.org> <20240604212854.883675803@goodmis.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit On Tue, 04 Jun 2024 17:28:20 -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. > Looks good to me. Reviewed-by: Masami Hiramatsu (Google) Thank you, > 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 > > -- Masami Hiramatsu (Google)