From patchwork Thu Dec 21 16:10:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 182341 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp518250dyi; Thu, 21 Dec 2023 08:13:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IF1/6q58R1KC0HY93/qToeJiK0sJzrqQHJ+2knmySBn5oBj24VNko4BfkrOjunidCqICME0 X-Received: by 2002:a05:6122:459d:b0:4b6:c771:47e8 with SMTP id de29-20020a056122459d00b004b6c77147e8mr712000vkb.20.1703175232051; Thu, 21 Dec 2023 08:13:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703175232; cv=none; d=google.com; s=arc-20160816; b=1G7Z9LwvQ1m5Uv3acFMrke7KoYbHvOoLOturW55w4R9DjizydRtqtXexUV39VpGPFE 1K5cIjtfJPncAa5EtIGbEq1Wlca6j33oMSXEJTwyEaoP8MHuNsOBXvFTm5WVvllgV3D3 TOFSRM3XGo+lGtB4o0roWKMVFHYT92QanzlNXEYcRzl6n2vcPokDbQortQPlRVCVvy/1 AWm1Vl7BRReekwFs+371aoZza+zUTyyLxtlEW9EYZ2WeL8EnhKEFlx+posKxvN78pdKF gtKPzNyO8jqoVRERHovaLh7evYrXSdwlgBZbM2CwN6nXigemdVDE403Wpz74vS539Sja MsQg== ARC-Message-Signature: i=1; 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=McYJKPLfQ+rkepx6eEblxPh4fiijViQKWNHp3/gGEXc=; fh=e3UoLP0GGIVG/JuDivUt2G6X10h9sIOfzt1IJTPiLuw=; b=U4XLtoan00U/nk86zCMXFGPVuCL61dWaYVZUKanOH6T6250i1573cQaKZ9TtvSVIj1 P0QlnA8I6vfMrq35dMPGKBVZMBwfh1y1ST16X58UBgllgVofmnt43CmMk1P0lWbs0xDU NL47NmIa5AzaHO2cJUs0WXExDAB6E6k/sf/oeUq2WkXcMgXBUCeuLC/3RBXqtVvWwTtZ a2OjVz7Ee4dNyAD+HQAyn9Wxiig4nxQxsiNenzSTjDmPCxfFGwB7G/3su9RVk39FdRYZ 0bi7tkG+EuRGELPwBFoYSG2Tj8+NZ5yqatmUjIR4MDMAcG5no4FaMU6CUTRXAQv+icFM ryEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-8737-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8737-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id b185-20020a1fe4c2000000b004b6e6e149b7si474111vkh.51.2023.12.21.08.13.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 08:13:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8737-ouuuleilei=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; spf=pass (google.com: domain of linux-kernel+bounces-8737-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8737-ouuuleilei=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 CBE6E1C22DAD for ; Thu, 21 Dec 2023 16:13:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7507059927; Thu, 21 Dec 2023 16:10:04 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org 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 B376364AB3 for ; Thu, 21 Dec 2023 16:10:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34733C433C7; Thu, 21 Dec 2023 16:10:02 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1rGLda-000000041Ma-0nq3; Thu, 21 Dec 2023 11:11:06 -0500 Message-ID: <20231221161105.976193556@goodmis.org> User-Agent: quilt/0.67 Date: Thu, 21 Dec 2023 11:10:37 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Tzvetomir Stoyanov , Vincent Donnefort , Kent Overstreet Subject: [for-next][PATCH 13/16] ring-buffer: Add documentation on the buffer_subbuf_order file References: <20231221161024.478795180@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785908672104878608 X-GMAIL-MSGID: 1785908672104878608 From: "Steven Rostedt (Google)" Add to the documentation how to use the buffer_subbuf_order file to change the size and how it affects what events can be added to the ring buffer. Link: https://lore.kernel.org/linux-trace-kernel/20231219185631.230636734@goodmis.org Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Mathieu Desnoyers Cc: Andrew Morton Cc: Tzvetomir Stoyanov Cc: Vincent Donnefort Cc: Kent Overstreet Signed-off-by: Steven Rostedt (Google) --- Documentation/trace/ftrace.rst | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst index 23572f6697c0..231d26ceedb0 100644 --- a/Documentation/trace/ftrace.rst +++ b/Documentation/trace/ftrace.rst @@ -203,6 +203,33 @@ of ftrace. Here is a list of some of the key files: This displays the total combined size of all the trace buffers. + buffer_subbuf_order: + + This sets or displays the sub buffer page size order. The ring buffer + is broken up into several same size "sub buffers". An event can not be + bigger than the size of the sub buffer. Normally, the sub buffer is + the size of the architecture's page (4K on x86). The sub buffer also + contains meta data at the start which also limits the size of an event. + That means when the sub buffer is a page size, no event can be larger + than the page size minus the sub buffer meta data. + + The buffer_subbuf_order allows the user to change the size of the sub + buffer. As the sub buffer is a set of pages by the power of 2, thus + the sub buffer total size is defined by the order: + + order size + ---- ---- + 0 PAGE_SIZE + 1 PAGE_SIZE * 2 + 2 PAGE_SIZE * 4 + 3 PAGE_SIZE * 8 + + Changing the order will change the sub buffer size allowing for events + to be larger than the page size. + + Note: When changing the order, tracing is stopped and any data in the + ring buffer and the snapshot buffer will be discarded. + free_buffer: If a process is performing tracing, and the ring buffer should be