Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp331531lqt; Thu, 6 Jun 2024 05:13:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW6FvtDZwtIwnkD7zoKOOH65NJozJcUA2SOh16Ndcnllcpgug+slYFKJMWrb/Ox9yIlcztkkzGwBV0ZnsDftZ4ssLgF7SC3NYbUXDTAeg== X-Google-Smtp-Source: AGHT+IG8RxlFiVgAxy0ubooyGVKKi+XPSujyhqeqGa7x/LAh7eM4WUvJ5YnB/d0R59ZZ/iLcbDZp X-Received: by 2002:a17:902:ea82:b0:1f6:9181:47c4 with SMTP id d9443c01a7336-1f6a5a69b5amr50515165ad.45.1717675999822; Thu, 06 Jun 2024 05:13:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717675999; cv=pass; d=google.com; s=arc-20160816; b=mSHBLB+Jq7a4Tp23O3hJceu7otJJlTMOidA3f7iyi3RGKTp8ik5invguUd8HF2AldN 1JxZJJrH9DCrxODPXKUENevdlgsBA9jPwIxh26N42sZDRfDvcgLDAbf+8Tu4DRSwG9cB 3Ng/Q4sUBu0GchdSgrTxNUryoHZpNysoDccg13KxaF7LHCoceS2MK9Jbc5FloQ40ZN3Q Ln25CEnyQ81j7yrJtl42ZhckvFXFWPRz1+gabdJ0CSc/KpwR6iiTXCKbY7evWuE7tZ35 ctL4ZXA9WVpE4NcrpO8qze2pdFuJWOS0LiwxRCdFFeJ46hUkDgnyhGtfiOINEVbv0BCs Pkkg== 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=vqkZIFnXcWX9FiC1pc1gB5myEsMQVUiEsGLLTPAEMoE=; fh=mTYg3JJ8i2GBNLFt8qb4bgYwOyk0kmrOzICLbi6qJ1c=; b=NmWe2WhXrF3MkDEhFtqcTU1FlzL5qEbqy5oCTK/0YxowDWvatoFe1PA2qYz36lP9WQ NKOYxR9mqnEAfc9gdDQ8Ns6nolIBcB5k8udUqFAklSj1oEU9wSIqXqA41V3KgAd1ORzM 65kBNDF4EewIwVGJbwJupHQsCfnQ49t9525xIvpdu1YO3o/NinddThQfrcH7qo5TKoVw HeI83nl/eaM9IXL/cAc53OvP8R5nIIqNB+jdpVnzz8cq+Elpi4UJlynN1TePlnG72Sr+ XKxNyukDI1TZf/JYkwfd1mgFO9qhs92YrWenqR3QilTB286JUc3okJXC4UH/tU0wfqJV fB/A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-204245-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204245-linux.lists.archive=gmail.com@vger.kernel.org" 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-1f6bd7609ccsi10083545ad.67.2024.06.06.05.13.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 05:13:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204245-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 (google.com: domain of linux-kernel+bounces-204245-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204245-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 5E082283887 for ; Thu, 6 Jun 2024 12:13:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D00D9195FED; Thu, 6 Jun 2024 12:11:01 +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 44847195F23 for ; Thu, 6 Jun 2024 12:11:01 +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=1717675861; cv=none; b=V/35l2V8HBr3Ay8m5nbO7ecQErLM7IavFFgKX/zlyZb8BE0Mm5xtgAL23GQ3lGiwrdqEfoEojSaFHUkA5DxRcwQYEh938rFyZAS4GtD+aqJ+vVcCU/6EVjzzNhCCzwcT1lHveuY0OjTNHaScaTsg//NhlL0IO1qT6Dm76d/qf/k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717675861; c=relaxed/simple; bh=UQmRInHjs4WMU28q1p/Y/++JZxg0i2kAsZIONMTIPYM=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=o0XPjZdjrkTmx6Cc2uyjMHMOHsOcTzhhrEhLzMOr8sHrbYXVgpXdEhGWH7jtO/cGtmkKw/eyMJK75DPE/QgioXYtttFFT22LkMzTGHLSlE1Wb/iyHqZQeVkmozYJfQux/gRQ/DiMvrf5pKAcQL7zQv5EgmzdWoAB5TbszOk9blw= 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 C8E56C4DDF4; Thu, 6 Jun 2024 12:11:00 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1sFBxR-00000000nKq-1NW6; Thu, 06 Jun 2024 08:11:05 -0400 Message-ID: <20240606121105.194409809@goodmis.org> User-Agent: quilt/0.68 Date: Thu, 06 Jun 2024 08:10:09 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton Subject: [for-next][PATCH 05/15] ftrace: Add comments to ftrace_hash_rec_disable/enable() References: <20240606121004.857581251@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)" Add comments to describe what the functions ftrace_hash_rec_disable() and ftrace_hash_rec_enable() do. Also change the passing of the "inc" variable to __ftrace_hash_rec_update() to a boolean value as that is what it is supposed to take. Link: https://lore.kernel.org/linux-trace-kernel/20240605180408.857333430@goodmis.org Cc: Mathieu Desnoyers Cc: Andrew Morton Acked-by: Mark Rutland Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) --- kernel/trace/ftrace.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index abcdffa4d572..4140d0ce25f1 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -1863,14 +1863,24 @@ static bool __ftrace_hash_rec_update(struct ftrace_ops *ops, return update; } +/* + * 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, 0); + return __ftrace_hash_rec_update(ops, false); } +/* + * 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, 1); + return __ftrace_hash_rec_update(ops, true); } static void ftrace_hash_rec_update_modify(struct ftrace_ops *ops, int inc) -- 2.43.0