From patchwork Tue Dec 26 18:01:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 183330 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1014263dyb; Tue, 26 Dec 2023 10:01:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IEq/S6sGIzqoVgb1Ql50ZAJP0yWVFL5PH1BvDd6HzrIgVERki4Hv4TgKhROjrofKGFeFz3E X-Received: by 2002:a17:907:6094:b0:a23:5753:7ba5 with SMTP id ht20-20020a170907609400b00a2357537ba5mr3970033ejc.47.1703613711267; Tue, 26 Dec 2023 10:01:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703613711; cv=none; d=google.com; s=arc-20160816; b=GcSS3jNWufh4+jFCGJ+59kZlqStWdUzW0EPu3AMDLeS1+qeK4AB0o1jjxodhZYQiSY oyPniBK5bUEO9SzreprZO2k1NFm2J/vORnZLeOHMryY+b5OL5m9tFWuwX14wO8oI17HK x5sCarQqKx5xeN9Pz2vuHltgYS8UQwZluWzF3N3M+iaZFfyGgod8lCBTBV/0QXf14Xcp 0zhyfzjLRSVtsya0JOJaN8i65NYEAsmo96253pCXwj7mG7Y9b1sHlTStfVfLEw5r9VCV SDAiJaE7EZxj3XGUPwIq0PKtyFC5arWAsuwCH+WnkTPilFaZsinWI4Y+ou6Yx1PrG+dn jVhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date; bh=YYwslIARNKGnyzzjBOdOCe7ldMjR0Fd5OYaJH1xvAfM=; fh=4y99xSOmP6X430EodNkzPEtYt5tLgog+VBdXFgcot/o=; b=SltDM7H+eFz2KIS8KsQVK72/V+sHnhwuo03s9GkjkupUIMHfSKayrvpJXnKv3ekv1b iYAtEA0a3k0zVZCI2GxCtsBbZB+iGyxxmPtfDtsQ03srAokSecNsB+FlstO2zKCNQDS7 KAMrOyQuN1SCTNRb1veQ1pLkKJwgbbtuvWRz/WkgsmhYxgBHoRBG5y3uI10MJ7hZumuz JROVi+dTjqEQM808c3x99oKOOyknd+CWPZczExpsKKsYhPymJDlssh0dwv3whqH919d+ jZHtozBwYoxWjP+IkpjStTfOJrYwMamrUzlhknLI6+crDca3nqcORxub3AySJotQleCJ uoYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-11604-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11604-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 xa12-20020a170907b9cc00b00a26f3d60386si1642233ejc.646.2023.12.26.10.01.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 10:01:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11604-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-11604-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11604-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 E053F1F21C36 for ; Tue, 26 Dec 2023 18:01:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 99E8451C32; Tue, 26 Dec 2023 18:01:08 +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 1818353E10; Tue, 26 Dec 2023 18:01:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CFD22C433C7; Tue, 26 Dec 2023 18:01:05 +0000 (UTC) Date: Tue, 26 Dec 2023 13:01:49 -0500 From: Steven Rostedt To: LKML , linux-doc@vger.kernel.org, Linux Trace Kernel , Jonathan Corbet Cc: Masami Hiramatsu , Mathieu Desnoyers Subject: [PATCH v2] ring-buffer/Documentation: Add documentation on buffer_percent file Message-ID: <20231226130149.4685c838@gandalf.local.home> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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: 1786366764760783011 X-GMAIL-MSGID: 1786368450677044810 From: "Steven Rostedt (Google)" When the buffer_percent file was added to the kernel, the documentation should have been updated to document what that file does. Fixes: 03329f9939781 ("tracing: Add tracefs file buffer_percentage") Signed-off-by: Steven Rostedt (Google) --- Changes since v1: https://lore.kernel.org/all/20231226123525.71a6d0fb@gandalf.local.home/ - Fixed some grammar issues. Documentation/trace/ftrace.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst index 933e7efb9f1b..84b810a6cf76 100644 --- a/Documentation/trace/ftrace.rst +++ b/Documentation/trace/ftrace.rst @@ -180,6 +180,21 @@ of ftrace. Here is a list of some of the key files: Only active when the file contains a number greater than 0. (in microseconds) + buffer_percent: + + This is the water-mark for how much the ring buffer needs to be filled + before a waiter is woken up. That is, if an application calls a + blocking read syscall on one of the per_cpu trace_pipe_raw files, it + will block until the given amount of data specified by buffer_percent + is in the ring buffer before it wakes the reader up. This also + controls how the splice system calls are blocked on this file. + + 0 - means to wake up as soon as there is any data in the ring buffer. + 50 - means to wake up when roughly half of the ring buffer sub-buffers + are full. + 100 - means to block until the ring buffer is totally full and is + about to start overwriting the older data. + buffer_size_kb: This sets or displays the number of kilobytes each CPU