From patchwork Tue Dec 19 18:54:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 181225 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2156699dyi; Tue, 19 Dec 2023 10:59:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IEehHzFeSPAsaa6Eh1co2KVfyqP0CzfPYqBrb7d4R/zM3MyOEEM7iJCu8/3sPQmO5KYYLRo X-Received: by 2002:a05:6512:a90:b0:50e:4b8a:df86 with SMTP id m16-20020a0565120a9000b0050e4b8adf86mr660592lfu.32.1703012356781; Tue, 19 Dec 2023 10:59:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703012356; cv=none; d=google.com; s=arc-20160816; b=aJJMcLB+ZbvFE9x4LfRU3TBfejjYjHsOKJGGardHcO4uUm4dj4y+EJYwcVt/1aJgp1 K4+D+KdTvjT1XtQzFKUtP19PhdSBac4DpZ3pfgR4jkJ3hr7zvB89xoC3CcoZomxQFogj kHqvEymbEqhn7M50NjiUxYaDGugzj9HPuTrltoD6tGFISxzbDR2zEwR0V+4OidC9pwon doWtsXreS2yw4K+rCMUupUwy497QhZtYO5mqdsN43/8G4MRRgjyaKzSRYw5QvXgENkHs 6vSqZMtssV0xr2PiWEfdz0/1l2D8chRzCoy+ESlTZZuiXXkOJ92yyQIysChUWvkQDwDH zmig== 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=tdKtp+q3Qb3XGeC7e6FROAGw+qd8YOirCoNgdW22lfU=; fh=pL1t9p0RxD5qCgSUniSa3P4+XmpksJYPzX6TE+dndao=; b=q9s1zZXmygLntJyQUHh+3V+E1ZdZ0/ZK+fs/RHEQUKEhfe5yTJu6GPQyFkRyfxvBa6 /+g12AX8RfWxgpbvbQ++UENiIrHYYLpuqRAfFhDsGl9ZvQsKsLCGifE+Ma07k1HWj1pD m5oDCo/jFudPR4MyZRUcs8Cd11F86ZL6ISF6EGyoaJ56Jj6x4cjMKThghEmpfYHlmsyW T0z9l4rJYh4gqDiXF7yKPq9ZEdHoY0hOSiIARbvvUfAHd5qVYSvuut03QynJTo/R/BEG YbDMAzQ6VH49gD7glwfADezX2VFMwtlLZTdU4lXnDJrXAbUzLoj9iCYPx+WhiLxbgnu9 Szkg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-5848-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5848-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id cf14-20020a170906b2ce00b00a268753dbb6si333947ejb.555.2023.12.19.10.59.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 10:59:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5848-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-5848-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5848-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 4D95A1F2495A for ; Tue, 19 Dec 2023 18:59:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0222941C85; Tue, 19 Dec 2023 18:55:35 +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 71A2D3DBA3; Tue, 19 Dec 2023 18:55:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ECCB1C433C9; Tue, 19 Dec 2023 18:55:31 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1rFfGZ-00000003R5q-1toW; Tue, 19 Dec 2023 13:56:31 -0500 Message-ID: <20231219185631.230636734@goodmis.org> User-Agent: quilt/0.67 Date: Tue, 19 Dec 2023 13:54:27 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Tzvetomir Stoyanov , Vincent Donnefort , Kent Overstreet Subject: [PATCH v5 13/15] ring-buffer: Add documentation on the buffer_subbuf_order file References: <20231219185414.474197117@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: 1785737884968926048 X-GMAIL-MSGID: 1785737884968926048 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. 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