Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp193264lqr; Wed, 5 Jun 2024 03:15:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV3xvx+1mgs3xtZH0Z4EMB4dBcLPJEIm87wUArXiwuCAu3j6o4LR1l7cT54lPd9fVln3zeI90kDNVZFi+x51LGjMC39axez3xT+odnZIQ== X-Google-Smtp-Source: AGHT+IFyfAB9XnXM2Wn+YR6RZc0btIS2AT/Hq2IES7hI6SiMtWWu8RvCcvywFCVNsQd2d1a568Jv X-Received: by 2002:a17:907:c85:b0:a61:9c28:f172 with SMTP id a640c23a62f3a-a69a002e7c6mr115452966b.51.1717582552283; Wed, 05 Jun 2024 03:15:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717582552; cv=pass; d=google.com; s=arc-20160816; b=Ds6frl112KOt+fEs4C5OBO7f5p/HhhnKgiWaSdRmANs71q+/nscqqx/P/TVEqawK7e MccZo0tVQGbZs+NZrnAHRTSwPFg0AkFtYD0oaQ3Y3OR2DMJpPIJ94R9tLrcfifKzFktP 3mHrO+eczOj0RwBaLP2LrHmZ4ykzQpKkOiRGL92HG47+BP6/+kqmd/Qq7ctf+mBbHMmg aqLFtzDuf92zf0puQLs3of37+kz/TagYZivqtlhnWS/edUyKkj7GEMHSJnY+6hb5exRB wdO7AiJkNxZPLkVyuqEy3hEb9c4Zgvey00KXcZfXTfI3IQafc47axv41sGAZhkqIo8Vo ykdg== 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=iMG8/GKcWzoiHUWJHzq6NNEsOzxzDqXEM/QSc5kGv9c=; fh=D7vGFCemkZDU34ZWTdMMgxTv/fBH8o6Jqms0Kr1Z2d4=; b=gbF6jqnWtRhWFmU4D0KDLQJg2+WYCx+7cQBZgZOZKOGvc42XnAYyWGuimuvvwgvTzm dX15nLoo5MqmL5cyXfoipd7Rd2P3uPtz2pRodI4j8yLjJpOnpOdlfYHy4TLmfSzOq4Ld oy5p0zA5wRbSCiHLjBaAgFQ9xmFVoYEpQRbrtMyRqMHEZE84/u17QhpRghlVWXPL2agQ Gy/rk6+htjbaF2ebJmNGOQ2iBwTlgYFdn2t7+STAUimPXazI6D3PPGcuXRjZuBXlmZMi M2LaRIXBEpCWD9hSgHQbgMBRslBKjFV1Eyp+wMWfq8ph0shTTZ7uyEvb3wtivZd431XF 33Pw==; 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-202179-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202179-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-a68fba72a14si346371866b.479.2024.06.05.03.15.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 03:15:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202179-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-202179-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202179-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 058821F239EE for ; Wed, 5 Jun 2024 10:15:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C563E190050; Wed, 5 Jun 2024 10:15:45 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 67E2113FD92; Wed, 5 Jun 2024 10:15:43 +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=1717582545; cv=none; b=b5G0ijEHSsP16WXHwyQVmbjLRJlx7T+Vox5UEYBflm7ikr2KP3Oldqf4xmTaI85Q4FFOfZf45rzJ4KkeWVfgHQY0CzizhX8cpRNQbT+SHlHnQ+FNYIF/FTaT3L5Xdg9/s1qqv7Gz2JOSrhB93lT+0ceo6Bb8LE+9kw3JlRM3fNs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717582545; c=relaxed/simple; bh=IUX6zIPyypIRUN0tk9hXbZutMUX1lSDUS76QuLJCPBs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=eOcJtXYbYKBNCni1dMei+umEUK6rkMrCCyeDqR3TUExNxV0eZbyLT7REv+cfhEqwm7sg0QU+21mZaA6/0B3oP36SPgTtJ9seb1+sTV1NliAj1Dr/PwgWUY97XF5+jQaMcb/LeFt0k12yrKGAVIz3xUoBP++2YRa3JEaDR2GhTI8= 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 3E813339; Wed, 5 Jun 2024 03:16:07 -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 B14A23F792; Wed, 5 Jun 2024 03:15:41 -0700 (PDT) Date: Wed, 5 Jun 2024 11:15:38 +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 2/5] ftrace: Comment __ftrace_hash_rec_update() and make filter_hash bool Message-ID: References: <20240604212817.384103202@goodmis.org> <20240604212854.725383717@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.725383717@goodmis.org> On Tue, Jun 04, 2024 at 05:28:19PM -0400, Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > The function __ftrace_hash_rec_update() parameter "filter_hash" is only > used for true or false (boolean), but is of type int. It already has an > "inc" parameter that is boolean. This is confusing, make "filter_hash" > boolean as well. > > While at it, add some documentation to that function especially since it > holds the guts of the filtering logic of ftrace. > > Signed-off-by: Steven Rostedt (Google) > --- > kernel/trace/ftrace.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c > index 9dcdefe9d1aa..93c7c5fd4249 100644 > --- a/kernel/trace/ftrace.c > +++ b/kernel/trace/ftrace.c > @@ -1701,8 +1701,20 @@ static bool skip_record(struct dyn_ftrace *rec) > !(rec->flags & FTRACE_FL_ENABLED); > } > > +/* > + * This is the main engine to the ftrace updates. > + * > + * It will iterate through all the available ftrace functions > + * (the ones that ftrace can have callbacks to) and set the flags > + * to the associated dyn_ftrace records. I beleive s/to/in/ here, to make this one of: set the flags in the associated dyn_ftrace records. ... rather than: set the flags to the associated dyn_ftrace records. > + * > + * @filter_hash: True if for the filter hash is udpated, false for the > + * notrace hash Typo: s/udpated/updated/ ... though I couldn't parse this regardless; maybe: @filter_hash: true to update the filter hash, false to update the notrace hash Mark. > + * @inc: True to add this hash, false to remove it (increment the > + * recorder counters or decrement them). > + */ > static bool __ftrace_hash_rec_update(struct ftrace_ops *ops, > - int filter_hash, > + bool filter_hash, > bool inc) > { > struct ftrace_hash *hash; > -- > 2.43.0 > >