Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp382601lqb; Tue, 4 Jun 2024 14:29:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVJNBW9RPyjiyWBrBHHNgWxqu9vTjdNIENnhxbLOwLr1lzZJMPF5aa+IVIM9UM8RbfLqZ/g5TZfH7+FijLmMeRuhnO3U4BOl8S3OMguEg== X-Google-Smtp-Source: AGHT+IGHRyGWycZiyVTV9HL5mN0+EiaP5L2EeaUi3bmHlg/aOTOPe4wZWrvkPfeWUXrGEAXrhmCb X-Received: by 2002:a05:6a00:98a:b0:6e9:38d0:5019 with SMTP id d2e1a72fcca58-703e56fb190mr842503b3a.0.1717536544465; Tue, 04 Jun 2024 14:29:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717536544; cv=pass; d=google.com; s=arc-20160816; b=JF1oJ9pSmTzqGsaA3nlYqHMOMqBR8eulVa+QmMYbnIparegVrcooU9EpJyxRcvvd2u dNa/K2aurFUjuW0UWXH2sfReNk1tB7d3SASyk9xv8j/Dk4yObblDGCSmwDauKCQzfznB ZA/3etETbAEYk2ANV1YqbAsw16MmTk2GDuGmIiY2UO9PYK1KZ/Z3mh3xZ9KjEPOxr2bV 5IjJg5UukzizPI/UUU3/wRA5/9rxdap9YzYoVKl+HEz/zZQTOopBJzhNcwI5wL+c6V3S xkLbLDQ5UgWj8hEkaCecXn28bPV1z/8RtRIc1lQdrAKvUVOHeKrY64cXQnppkE2E8Sbg uDag== 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=olda0Zbw9OKDZgg2cTFEYC4cPWTqm947AFdbEKLGxaM=; fh=mjDKelfe6UwtrbrQsWTm6mHxXqJJm1yC7XMGoQRRIY8=; b=yvA6U7QiuxIx6nzXW/YsS+Tw2xkEo23ZCXyYv28B1Vut4QkfVVTGt4rV0nIo4D0p+b CjBF2EmwLrVK2bbtPG/m2FP1SzC8IDf0ABdXVp7UrALBDU6wn+RQ4jOHuGChFmNzaR21 cuUYz+E+uqfxZU7YkKgcpOQR3SipN440usAt1G9d/xxghgtDXTjd1zHydvVQVX+IlUE5 myXOnSCvZAT+v3uu/3T7pnVJXurxlv6MHqduPu9mi0jeLhtws6PCl3Hi6F2jUARG/Zzj xnwqId03Q0qo0TlsF2rXKGQqCnn5MUp4AHpdQuXYmGz+pS0VeDVpVzSKpqcHoUJ48Wi9 UuQA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-201397-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201397-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c3540fb395si8891193a12.150.2024.06.04.14.29.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 14:29:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201397-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-201397-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201397-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id CA3DD28358C for ; Tue, 4 Jun 2024 21:29:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A3F614C5A0; Tue, 4 Jun 2024 21:28:54 +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 1EFF81422AD; 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=PkCRF/uBIhvugqME3zqObI2fcoLEClH7Ei+YjkVZSc5BgmxhHkbYhhRmDILt5LM7cfNLIw85uLae5GgdTayJ9ptOWScfcH0I/TId2Mi2dpaJo17QJDE8diKyHAgS8k+HkaCaLkLppsi03ygXtEdidiWs6FRBxDblw7rxZN/7K5o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717536534; c=relaxed/simple; bh=gzuMoHpSvUC71Fv0Tg5dkH6tkrJ5zCwfPg5xYrrAB6I=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=ngj+DHmo8/xEWj9YJBg/0elb+SXl+5e3z2Id0zitkUtWWV2BZnkvXXSbYUIJl77GLyrczJnFMELxdFymqZIev/Qs4IPL0DMH8qRFlq62fNhhjMAw0pvjsNWGRtqlfCCzMFkJMKpvWjOhK+JaCcP2C1G8c/Zz+l7swCOa6hDrTc8= 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 02786C4AF07; Tue, 4 Jun 2024 21:28:53 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1sEbiA-00000000bDo-3cdN; Tue, 04 Jun 2024 17:28:54 -0400 Message-ID: <20240604212854.725383717@goodmis.org> User-Agent: quilt/0.68 Date: Tue, 04 Jun 2024 17:28:19 -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 2/5] ftrace: Comment __ftrace_hash_rec_update() and make filter_hash bool 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 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. + * + * @filter_hash: True if for the filter hash is udpated, false for the + * notrace hash + * @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