Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp472639lqr; Wed, 5 Jun 2024 11:09:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXz+4DNEZ9k3DkUc6XC416fYjAkzZV1q+0K1E17zr3GIE++mKfr8QmvrtkmifjpW/hBIuenexvBKJd8uyRxRdUr3brXFlvuTC+l3RZJ/Q== X-Google-Smtp-Source: AGHT+IF5oOugz/vka5f2vYM+T1brRyZmUCgZlNN1seGAVoMaau7JJBKxLvye9Gg+5bTV+aKxKCdy X-Received: by 2002:a67:ebd5:0:b0:48b:c061:e8fa with SMTP id ada2fe7eead31-48c04aa7728mr3660717137.33.1717610962669; Wed, 05 Jun 2024 11:09:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717610962; cv=pass; d=google.com; s=arc-20160816; b=TFUY81vnY99h1jtQVHSTrxJeHGts/tre3DTM/psgCguTc73BrjvVjc7HuZA4udqj9r AEp8+kfhCWIlu1HohbZqiXonbLhMZWp0sS30/u8/9OjAr1oaFzy+EDbU3r+VvwcOuCZJ WMuereKVa0GL4b1iWIyzSLkcka42L6Mn/fqjNHakIvhUylP9/ZeJNUfZ6PyyTa6By68f nUPG1iwb0bBdRQTUcgqZN2hmmleG2e4gLqVdKyyIoQQEsqMD81/pTOQ3FcUchoPtkMMy sEBP9P1SNIDX1pEK26+znAifURBz+Zwtjwi5G9GMZOl71uBulEVMKPBrBuy9C9rjr0zP ZwWw== 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=bugrgH1EM9OBRIB1Bxo/wUmkOXQMKesB0QaLTQq9WDs=; fh=mjDKelfe6UwtrbrQsWTm6mHxXqJJm1yC7XMGoQRRIY8=; b=ZtDZXokPHscfvmdIESIovicuCTneHyRX4qUkCdN5Mq1WyAgy5kzHvo+YoBrciJvElr cO/nP/LxVAkeDz/u7A6DMQD+i9VCuVACY9imjksOnI5aiQuwoNqsTNAWV/QBa0UT4/iO PgEb6a1VGkAi2Xsdh21YbBc5LCixwjlZa1+sqPHnCOcin6MyDruhFujthTgsismXBQIk IUpUzSKGAutGFdBhCKMATmgxp8q0jzrzxenbVHXYyz5Q6X8kYWCrvxwe3m5K6VQDhZLw m8kwur45OKepWZ+2re20TSd8DqnyHQi/evj3cgoD8JmkntLzfyOLQw9ddzwzePTphGAH CL+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-203030-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203030-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ada2fe7eead31-48bfa5b2f5asi962529137.605.2024.06.05.11.09.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 11:09:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203030-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-203030-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203030-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 542941C21CD1 for ; Wed, 5 Jun 2024 18:09:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1BADE13AA5C; Wed, 5 Jun 2024 18:04:07 +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 824D417555; Wed, 5 Jun 2024 18:04:06 +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=1717610646; cv=none; b=TOLWk7UqK97BBtnwmVCTZ/tlhkMuinuQA0UHDdwNqNaSa0aTnroJnGxTv/MxY02dSytwvjL06kgslKyRx5ZHJiZs490HtNfjMjvSO3L6RsxlT0+vH/d6qke0j13CyuCdKFddzKsmGvRrCZAFxSWsQpwyMWQF92G0yBozvc9O/Qs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610646; c=relaxed/simple; bh=cdBdOczOngRrZ9Kw7qfB8SrE8MYIlrw/6XETUzaMEo0=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=aZ5fPoKMbrbFuiPd75OidvS5xFgH20AO5FqgstmEoYINLJR3rrcYrTPBCcZF/6DXmKUUJzME2QpYChTuVP5rcLiF1n4sxhjQ+Sai5vJqfbBbXRrm7gMv7kcJtQgipDqTjqE7ClSoJP7nJ68sR1vj8zc69YFH9jnKUVHgAkV6Cy4= 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 2EDFEC4AF0B; Wed, 5 Jun 2024 18:04:06 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1sEuzY-00000000hY0-4C34; Wed, 05 Jun 2024 14:04:09 -0400 Message-ID: <20240605180408.857333430@goodmis.org> User-Agent: quilt/0.68 Date: Wed, 05 Jun 2024 14:03:37 -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 v2 3/5] ftrace: Add comments to ftrace_hash_rec_disable/enable() References: <20240605180334.090848865@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. Acked-by: Mark Rutland 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 f8d8de7adade..1a2444199740 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -1862,14 +1862,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