Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1834172rdb; Tue, 3 Oct 2023 02:23:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGq55xa1I0xKBiWl8WhIXxiH29iyOSxig2g5aBNsnmvE9f9LIx7yM0zD1FJ8N/1D4f74c07 X-Received: by 2002:a05:6870:2186:b0:1e1:aae:7867 with SMTP id l6-20020a056870218600b001e10aae7867mr16929645oae.54.1696324982379; Tue, 03 Oct 2023 02:23:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696324982; cv=none; d=google.com; s=arc-20160816; b=Eg/YjuJK9q2h/NIM8u1FLwB1Y+nPnRbnrlNr4K/7Z8joShzcS6Kn7J6F1W4BFBjBcW JZ/Ji+getmAv1i1l/2jMdP2hsBQ9CSSLIK4EzGfNwV4eY+IUcszsBpaSiOjvE7VYwnLA Q0i9QEC5w1zMPJeJVm5j2qykFJaTFlg0vn2yZkbm0GpWTYif/+aGBaF8T0bDNZgo7h0F S13QAd0Y6zFizW9DUOHtaVSpaktcZzWnbzjgr6qo6WMhkxwOKLI2XzQLU/A0oqyEK6/8 d2nfFQR4CorXjrlwVccJkQIjUFCLDMyZLVmGJqI1h7RGCNyb9vrmKHA2qcCHl4q5HAVa nFKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=GmFmuhb3o4N93peu/dgTVubGPBS25MoLfRETsrWJw90=; fh=+B/w+5pT7KbzbI48RjYy93vTmWciYR5bqb7QLS1Ygs4=; b=J2OZeDbD79LVAPnrhmSevViB+ZLFJAs4iJEOqhNuSbs1sATDwbWGaG39+dkCOiLovv rjVvAvO6QX7YUomcDC9P9XZUDqbnRKzNUP6jeDK73fzlXd84EVsKTBjalVhWqG8TK37N cmGLSiGOPbBxycreeAiB7UtrZfX9sRTnSSt4SmqhCkOY3pkyXGKFiODQSpygXMRY479Z YbKJNjO1neYvcTlEVfVJr0ChKQ+XAvJ5kWhxJRNFbSHZtsTqak0rE7kTQC7ER3LTKKhH qVu/PjnFssxf6PGOKNLajwsQNk/qQ+nowoTIa++dpa8OwJqV983BQmRStPBrF7VykUKA JCrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BoV11+Yr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id h130-20020a636c88000000b00537c6c285a0si1001456pgc.167.2023.10.03.02.23.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 02:23:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BoV11+Yr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 7AF548271431; Tue, 3 Oct 2023 02:23:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239624AbjJCJW7 (ORCPT + 99 others); Tue, 3 Oct 2023 05:22:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239612AbjJCJW7 (ORCPT ); Tue, 3 Oct 2023 05:22:59 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AB2EAB; Tue, 3 Oct 2023 02:22:55 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-9adb9fa7200so142942766b.0; Tue, 03 Oct 2023 02:22:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696324974; x=1696929774; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=GmFmuhb3o4N93peu/dgTVubGPBS25MoLfRETsrWJw90=; b=BoV11+YrJPxx4qohFpLt+zRZJ7PoNeoG9TonnWyZP9yQ3Vmt2RnIGEToWP9BNfhsC6 QdpvL2Tm7fHmSuiD9urgryPFmOT1fFD+8IkkO4GoqpMPy+hIDuLwNIqj1qjVvlUods+L gYgqBc22b5u2xc8tqx7E4LvuarJUiJ30mu7M3nncMD+qasaBlHkhF5PN5MSYebGRnjHO 2ZgtkACZlREzpZJUlXaYL9nYZ/oQfDBRUa6FFAOCkIXV76cw2IP2MGfNRTwaUGHjfM1m jEymhFXNjyGXk478P93N+Ia0xzEITGiL7n4MEh4CJ9QBxmM544kNjA2zVlEk8ps2JK+e MThw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696324974; x=1696929774; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GmFmuhb3o4N93peu/dgTVubGPBS25MoLfRETsrWJw90=; b=k/RksNfIPpJUTLp/gX28/jOnq6nQ6ztfzYZBufNaZ0aJ5q3+1Ky2tux0DrXiPeV4/T 30F8yYZsl/UthCG83TTqxx8g2QuepBYXTQzDKSfiKA9Ztq1verxOurBrbtF6Bybeol+l uacs69cVdFZ6YX1Za36o2JoC3PPwUOHYvnBGDPQRTiSurh4+ehw7MKYYE0y2jOqcuQuA iNGGb0IB/xUos4oDxXukmhf27nfCIAKDOH0IEzc95ZT5KSRWxiPetT4sNvmEbj3Jt2yH juL/khoSjLEZP4JsyJecDU/Z0ruUI3KqP5g6/gjYV011e77SwLi+4YclYbRaGa6MaKFQ PNFg== X-Gm-Message-State: AOJu0YyugZ8cNiRd1yA20yM6lG3x932NmLNfHi3XCcCGpTYM60UKAkdE dz3Q7ph+HPopHF3NXAr0G68xNHPImlo= X-Received: by 2002:a17:906:32d3:b0:9a1:b528:d0f6 with SMTP id k19-20020a17090632d300b009a1b528d0f6mr1739532ejk.27.1696324973680; Tue, 03 Oct 2023 02:22:53 -0700 (PDT) Received: from gmail.com (1F2EF530.nat.pool.telekom.hu. [31.46.245.48]) by smtp.gmail.com with ESMTPSA id sa18-20020a170906edb200b0098733a40bb7sm734169ejb.155.2023.10.03.02.22.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 02:22:53 -0700 (PDT) Sender: Ingo Molnar Date: Tue, 3 Oct 2023 11:22:51 +0200 From: Ingo Molnar To: Leo Yan Cc: Arnaldo Carvalho de Melo , Ian Rogers , Thomas Richter , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Peter Zijlstra Subject: Re: [PATCH v3] perf doc: Document ring buffer mechanism Message-ID: References: <20230803114613.1786849-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230803114613.1786849-1-leo.yan@linaro.org> X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (howler.vger.email [0.0.0.0]); Tue, 03 Oct 2023 02:23:01 -0700 (PDT) * Leo Yan wrote: > In the Linux perf tool, the ring buffer serves not only as a medium for > transferring PMU event data but also as a vital mechanism for hardware > tracing using technologies like Intel PT and Arm CoreSight, etc. > > Consequently, the ring buffer mechanism plays a crucial role by ensuring > high throughput for data transfer between the kernel and user space > while avoiding excessive overhead caused by the ring buffer itself. > > This commit documents the ring buffer mechanism in detail. It provides > an in-depth explanation of the implementation of both the generic ring > buffer and the AUX ring buffer. Additionally, it covers how these ring > buffers support various tracing modes and explains the synchronization > with memory barriers. > > Signed-off-by: Leo Yan > --- > > Changes from v2: > - Refined doc for Thomas's suggestions (Thomas Richter). > > Changes from v1: > - Addressed Ian's comments and suggestions (Ian Rogers). > > > tools/perf/Documentation/perf-ring-buffer.txt | 762 ++++++++++++++++++ > 1 file changed, 762 insertions(+) > create mode 100644 tools/perf/Documentation/perf-ring-buffer.txt Nice addition! If it hasn't been picked up yet: Acked-by: Ingo Molnar Thanks, Ingo