From patchwork Sun Dec 10 03:54:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 176274 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp6353990vqy; Sat, 9 Dec 2023 20:05:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IGy+dhcFWBHIQNfuQ18O/dWwqoSFOCLqm66Y5FXUW373VvE6Qtq/TBQT9COfTtr08Sqjwly X-Received: by 2002:a05:6a20:918b:b0:18f:97c:b9fa with SMTP id v11-20020a056a20918b00b0018f097cb9famr1274723pzd.84.1702181115623; Sat, 09 Dec 2023 20:05:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702181115; cv=none; d=google.com; s=arc-20160816; b=qUQ7bRaievRFT0qwLKNbIlKZVXseY5oytPNLHMcMQEMD1vpma1HOhJiOWP3Q3y6mdk Z6cRPBZ/P84wOfie+qHEfqwNEIAcbQWvoUPzk9rtFxtCyixwxOUQAMkncaoKhG5pp2bK 8qGFDqHWdZ268QHK5zyvwl0UCXd4XJtwr6hixEaCUmA7hN7RBvwAjKcU9cdlr1a+4uiU sc6a8yPJwswfXjAlUqOGmWwrlTHwSpA2JQgvuWahv4DsB3oNbqIGhpI0T9ICoLLQvrao EXQo/odEV8IaFgBBPCGNHjvWkHSgsJQQFzr6UOdHywll7WYHvvwMaiSFFrHHrnjS6vT3 RoAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=tdKtp+q3Qb3XGeC7e6FROAGw+qd8YOirCoNgdW22lfU=; fh=pL1t9p0RxD5qCgSUniSa3P4+XmpksJYPzX6TE+dndao=; b=xWZIxcDN6MpQl+bOawOUyKZpaQTVkGdKiFH8f3279dVJ2TimL2KJkGUT+WN0ecR71a uOV0SpRpYalLkqqOlsictYMIId+KiMc29hEEKjEMJmOwd9Kh6upbW0qgQ0is7iIGveHY 77USaJ2SS3j7Md7A9RKCamKSftD6fJhKTzfcQIGE4/bxUOyhL+H2rlSW5oT6ez3em9km BwPAqbzffoX9zPFRRuC5XVvQda2IVuu1wIRyNu0/eGeHmJJbnoCa3BzcOn5xRLzLxBod gjiJ/hfUrzyOUGibols1Kt4l/Kt/U6lVtXhgu4+RkEwmAZjF5bXPZmqDljBOckVyBQ9d FL8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id c12-20020a170903234c00b001cfcf1faaa6si4111158plh.206.2023.12.09.20.05.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Dec 2023 20:05:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 7E51C8069346; Sat, 9 Dec 2023 20:05:11 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231709AbjLJEE7 (ORCPT + 99 others); Sat, 9 Dec 2023 23:04:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231506AbjLJEEI (ORCPT ); Sat, 9 Dec 2023 23:04:08 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4797E115 for ; Sat, 9 Dec 2023 20:04:15 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2BD60C433CB; Sun, 10 Dec 2023 04:04:15 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1rCB3k-000000021Rm-0rbT; Sat, 09 Dec 2023 23:04:52 -0500 Message-ID: <20231210040451.982725347@goodmis.org> User-Agent: quilt/0.67 Date: Sat, 09 Dec 2023 22:54:17 -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 13/14] ring-buffer: Add documentation on the buffer_subbuf_order file References: <20231210035404.053677508@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sat, 09 Dec 2023 20:05:11 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784866265286456453 X-GMAIL-MSGID: 1784866265286456453 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