Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1790969rdh; Tue, 26 Sep 2023 03:51:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHANsZu+gM0JUHrDuKELjMRO7p6XIelryyxBjwA7FkiasMMEAznYzv2fWHoRXZy0Kr30QVv X-Received: by 2002:a05:6a00:2347:b0:68f:e9ce:92a5 with SMTP id j7-20020a056a00234700b0068fe9ce92a5mr8143126pfj.4.1695725507530; Tue, 26 Sep 2023 03:51:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695725507; cv=none; d=google.com; s=arc-20160816; b=PWwf5s1wJIaKYkuCr+guDXd2q4fnoRUVGEFvrlJkRRew9nAyJUNbt9xIg0n7DRV1DP VZ51M8iZRZhDi3VuvgL1Q4ax8rdbJ2Fu4NS9XPcGCqnrsVwJ5rLIM7rJtvVPKj4zvwzv volD1juRL52yFRiPwnKtFHf8IEAYJDVmHCGvQZ1RszZcUqX7VF98WjvCYeB9YZg9GJaw H3zzFgnD9mSPXUBCu5d8CEcVjGuLDxD39OpE4vUJVDx8JgfOUKUgrxBAy0V4PqUeZBic s7dc+XCYMLkqqRO1ymYSHeq9Fi3faXTLIi7gN0XmBcZ9fxoAnHtAXJ2mNcfwBr9ca15S HlHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id; bh=PXF6rfrgzOCn1SdpoHoOVclo5eFU7BL8UukzZ7ibt64=; fh=3iOsOZ+J5i46dWd9CTmgqeVBQ2mTO2qtJjLa7mrUDjY=; b=scZ9MneOffoWkCT0USRyDqQsGxxFbMO/08RCoXJ/a3HFaC66GqjXiPwYZfrKQ+Hz38 qhfxjWSU9K9Vyuk6dZXgDTMpGKvcHuVRXVF2o95qDnwSGgd2J3CB3EgLoBYStv9vAoP0 NE5wY6BZznBSBmSeoACdFdZgDCwojBUJ+/TvoPxQI4vJAcXkSPpg0Fssgt7CHFpujosh TR8dr7hbe325aGAjCr1MWwcCbcmuu3anvH5Vru7kUKlNBjDjcwEPBh5JKTTml5l8svgS sDv/Ew2AcmuJbxWcgD5xg9FYDhtVBk4i6eLi+FS8m/RTKv6eZAQ4Y0q9Xk7zP2Ph1FM5 sWgQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id ca24-20020a056a00419800b0068fea05ecdasi12430499pfb.182.2023.09.26.03.51.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 03:51:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 7872D81F9662; Tue, 26 Sep 2023 03:38:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234397AbjIZKi3 (ORCPT + 99 others); Tue, 26 Sep 2023 06:38:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231182AbjIZKiZ (ORCPT ); Tue, 26 Sep 2023 06:38:25 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3B3A4E5; Tue, 26 Sep 2023 03:38:17 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 429D7DA7; Tue, 26 Sep 2023 03:38:55 -0700 (PDT) Received: from [10.1.36.17] (e133047.arm.com [10.1.36.17]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E3E663F6C4; Tue, 26 Sep 2023 03:38:15 -0700 (PDT) Message-ID: Date: Tue, 26 Sep 2023 11:38:14 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH] tracing: document buffer_size_kb more precisely Content-Language: en-US To: Zheng Yejian , rostedt@goodmis.org, mhiramat@kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-doc@vger.kernel.org References: From: Christian Loehle In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS 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]); Tue, 26 Sep 2023 03:38:29 -0700 (PDT) On 25/09/2023 12:44, Zheng Yejian wrote: > On 2023/9/25 18:02, Christian Loehle wrote: >> buffer_size_kb no longer shows the requested amount, but the one that >> is actually used internally for the ring buffer. >> >> commit 6d98a0f2ac3c ("tracing: Set actual size after ring buffer resize") >> changed the sysfs behavior such that value read will always show the >> actual size, while previously it showed the size that was requested >> through the sysfs interface, even if it was rounded up to fulfill >> the request. >> So the documentation can state that more precisely now. >> >> Signed-off-by: Christian Loehle >> --- >>   Documentation/trace/ftrace.rst | 2 +- >>   1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst >> index 23572f6697c0..2e066b3b6edc 100644 >> --- a/Documentation/trace/ftrace.rst >> +++ b/Documentation/trace/ftrace.rst >> @@ -191,7 +191,7 @@ of ftrace. Here is a list of some of the key files: >>       A few extra pages may be allocated to accommodate buffer management >>       meta-data. If the last page allocated has room for more bytes >>       than requested, the rest of the page will be used, >> -    making the actual allocation bigger than requested or shown. >> +    making the actual allocation bigger than requested. > > Hi, the actual allocation should still be bigger than shown due to the > loss of accuracy when doing unit conversion from bytes to kilobytes (see > tracing_entries_read()). > Right, the sysfs obviously only allows for KB aligned setting, but you're right. If set on the cmdline non-KB multiples are possible and accuracy is lost. Nevermind then. > -- > > Thanks, > Zheng Yejian > >>       ( Note, the size may not be a multiple of the page size >>       due to buffer management meta-data. ) >>   >