Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp551667lqt; Thu, 6 Jun 2024 10:56:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWPgqkV82Bc30InAmUQL4LfA+4jqFSxgHKFkBQ38XFLIg1cgLUERw42Fj32MuwP0JjOIBYkSb4k7MNGgT8UUHs8t+ZToBO4BJd3C47Eag== X-Google-Smtp-Source: AGHT+IFjdCc4PGoqnd+InXKfDGq9quDGE50Q3owrsFTurFt5PDcnbdyecD5dIPnblyhOfz0xNoEH X-Received: by 2002:a17:903:244d:b0:1f6:78f7:1503 with SMTP id d9443c01a7336-1f6d036aa2cmr3594455ad.43.1717696563639; Thu, 06 Jun 2024 10:56:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717696563; cv=pass; d=google.com; s=arc-20160816; b=wZOB5KcAa1St7vYvPHnkAocfHZ8ycVIkMZlcndgHVE0lmBcVXHYVwz+Xf1pNnwaGNu BF5cuTEQHevao+Zy4W1V0+FKNo3q6TabhiCL5xe2z1aOiM7GuRB7ia1RwLe8KKBsehB5 6RCPbJ68GQRST9xZ90q08D53VltGsrKs3TsFELTCh/GMNlhv5/Mnc95gYq7ElsFRIgZJ ETiAOx7HQwyOFzQAj6fLzr4mWN3RmGlEdCA1cwWtSOPsJXake1GXE48c05rJfj66BU3X VQ6QF5ztnoFbav2heqObI65yFQCY+hUcyhBl8DDsIBryLuX+WUlLe7OYdYwVAUkT5tHK 8LUg== 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=jIpXJEQpBGAZco/aQpv6qafyjMKxBUYaf9/m88s0T0k=; fh=D7vGFCemkZDU34ZWTdMMgxTv/fBH8o6Jqms0Kr1Z2d4=; b=sypYwYdz6Y9rT2Ftkr6iUVVQLQ5vX878+v1SA5I+JYkLXF1FFJesBJvcinjHKid5v4 N4jA+bzUMT8jrRzCpPgs9zYvGt/KvTSC/JnZNvdYzrHk4cnlZSP2KTn4Vq1UwZdQCqPC KQe9+ucbVo660f/MgG3TaGi+0WnToGdEdLIFPLcDQb8d5orCcdnuMCziBkb4qGRQUMOw xwirc7IBkUokhkLy16bi5yY4m5cqWPeYdTW2LHge+PzUDUvo7NZoQsHpvnPahmy3nbcE gDjzZrvS9OUBKQr/RjfqildIgNDA7yLGaH5yY9xCVJXzJZk5l01BF1mrgO/mTarbwhX5 KVDg==; 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-204843-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204843-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd822eb6si14907455ad.601.2024.06.06.10.56.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 10:56:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204843-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; 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-204843-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204843-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 3DC9F289C85 for ; Thu, 6 Jun 2024 17:56:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 344EC19923F; Thu, 6 Jun 2024 17:55:54 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F06838DD4; Thu, 6 Jun 2024 17:55:51 +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=1717696553; cv=none; b=DIyf1GGhDBjEjv/KY9GJQWVxh4gueyHW1s0/qqF20TvkDbtBx+x42nX0Vg77FImYh81bboaZOaVGEUDT8Hmu9Ca/+hVJ9dM5n90S3O6D7DnYu4qCjpRTxUn4vDV1oLzudwhw6vgBZ+5eUgI8xqi3uLpom4iI15sdtGMHg0F5lnE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717696553; c=relaxed/simple; bh=+aZc9JlPoYcncM6b/nb2pxrsKL/yaLWWvwkEqCj8ZLk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=eKeg0or77RL4R1qpBKLFCvapQi7S+aHpJ9Monc2ohyF7F9xUsDYtJL6aZ3ANWXZIi60xjbMAFkH8XPzunB6DHpxQy0dTbAwgyoHXoQG9ANl7r2g5R5ps637edEY3zD+3eFYqyfZ8P8UyBAgb5FYh7/OJdpF3s+/aeBprmiHLxlc= 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 B1FFB2F4; Thu, 6 Jun 2024 10:56:15 -0700 (PDT) Received: from J2N7QTR9R3.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 679513F64C; Thu, 6 Jun 2024 10:55:50 -0700 (PDT) Date: Thu, 6 Jun 2024 18:55:47 +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 v2 4/5] ftrace: Convert "inc" parameter to bool in ftrace_hash_rec_update_modify() Message-ID: References: <20240605180334.090848865@goodmis.org> <20240605180409.021080462@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: <20240605180409.021080462@goodmis.org> On Wed, Jun 05, 2024 at 02:03:38PM -0400, Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > The parameter "inc" in the function ftrace_hash_rec_update_modify() is > boolean. Change it to be such. > > Also add documentation to what the function does. > > Signed-off-by: Steven Rostedt (Google) Acked-by: Mark Rutland Mark. > --- > kernel/trace/ftrace.c | 23 ++++++++++++++++++++--- > 1 file changed, 20 insertions(+), 3 deletions(-) > > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c > index 1a2444199740..83f23f8fc26d 100644 > --- a/kernel/trace/ftrace.c > +++ b/kernel/trace/ftrace.c > @@ -1882,7 +1882,24 @@ static bool ftrace_hash_rec_enable(struct ftrace_ops *ops) > return __ftrace_hash_rec_update(ops, true); > } > > -static void ftrace_hash_rec_update_modify(struct ftrace_ops *ops, int inc) > +/* > + * This function will update what functions @ops traces when its filter > + * changes. > + * > + * The @inc states if the @ops callbacks are going to be added or removed. > + * When one of the @ops hashes are updated to a "new_hash" the dyn_ftrace > + * records are update via: > + * > + * ftrace_hash_rec_disable_modify(ops); > + * ops->hash = new_hash > + * ftrace_hash_rec_enable_modify(ops); > + * > + * Where the @ops is removed from all the records it is tracing using > + * its old hash. The @ops hash is updated to the new hash, and then > + * the @ops is added back to the records so that it is tracing all > + * the new functions. > + */ > +static void ftrace_hash_rec_update_modify(struct ftrace_ops *ops, bool inc) > { > struct ftrace_ops *op; > > @@ -1906,12 +1923,12 @@ static void ftrace_hash_rec_update_modify(struct ftrace_ops *ops, int inc) > > static void ftrace_hash_rec_disable_modify(struct ftrace_ops *ops) > { > - ftrace_hash_rec_update_modify(ops, 0); > + ftrace_hash_rec_update_modify(ops, false); > } > > static void ftrace_hash_rec_enable_modify(struct ftrace_ops *ops) > { > - ftrace_hash_rec_update_modify(ops, 1); > + ftrace_hash_rec_update_modify(ops, true); > } > > /* > -- > 2.43.0 > >