Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1263018rdb; Tue, 30 Jan 2024 12:59:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IGnN6ZLPN18Saze02UN/+iTZCubnlOOfQ+vjhzC164VxqUAuQWe5t4g0d5ei/KWv1SiX3Q7 X-Received: by 2002:a17:90b:887:b0:293:ff12:4e46 with SMTP id bj7-20020a17090b088700b00293ff124e46mr6922740pjb.2.1706648359544; Tue, 30 Jan 2024 12:59:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706648359; cv=pass; d=google.com; s=arc-20160816; b=WqCdEfMkHpqtvDnej3R+kcDB+URZI6Ojc6XszIpALEz2KFf1TAeuOT5WEScBfh7iKg aotdhsYJ99iSFJwpHk3CdIUFVa7YD3RYbx0DtT9VD91OgAgwZ3fxOUhmcE6m2Rjd4QWi D3v1aUh1h/JDO0hsCi67KPBcNegI7nI5G3HYCpr4CpXZqwXfjZ0nwc21GwlBhuNNStD2 ulUM2xXJuHPQ9ZL//HJu/bgP6YuvS3Pr7BkzWxYrzIKnuxjJFVsyvEWtvR916FGeqpEp uK0Arrxk+8HzSKgm3jzXRxPot2Whv4WK+7avLz83Ar/5qTa4OdVPHm1w8oYXYqjYdrv9 82qw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature:dkim-filter; bh=vRKu2O/0VPzoBZOtxNzJJj2/lV4jOxX7B02gcKXYkV8=; fh=zmCV9TgchuvSO0DKgk7UR4drT1h6swM/+gh/CB6NQbs=; b=i/xgK5+DGDNSFO7/7GvFQeDr8saGzpWivMvxVfXN78hWtwytMLh6hBT3t7MJ10RPY2 2Nfo7mdlqf/4FPuy5poyYZERVzwyktb7t0bWa7a1lu3X7ymXx87OT6qnu/dbgyX5rCuu uIjddCgFYbFTIbCnHHmFuCZXqzbFeEzwavJWTetcYXPgdIaEEKJFkedDJpuWIH47oIlh wpMej4rv3i6UQ/qPGlUDKZpYWOAA/elD3aWO50MrxUYXn8n+6oGzOVD92fJfJSP6Y/U0 WFCjAK5jz1pSp0farm6HRTaVSio+RDxDx4DQmzoTMlQaqzgYdpN9mjuULFnvsR9WIlW0 KOEw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lwn.net header.s=20201203 header.b=H6jT2K0w; arc=pass (i=1 spf=pass spfdomain=lwn.net dkim=pass dkdomain=lwn.net dmarc=pass fromdomain=lwn.net); spf=pass (google.com: domain of linux-kernel+bounces-45305-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45305-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lwn.net Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 15-20020a17090a0b8f00b0028cf6318076si9854384pjr.98.2024.01.30.12.59.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 12:59:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45305-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@lwn.net header.s=20201203 header.b=H6jT2K0w; arc=pass (i=1 spf=pass spfdomain=lwn.net dkim=pass dkdomain=lwn.net dmarc=pass fromdomain=lwn.net); spf=pass (google.com: domain of linux-kernel+bounces-45305-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45305-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lwn.net 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 6288D287DE6 for ; Tue, 30 Jan 2024 20:59:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F32C7762C1; Tue, 30 Jan 2024 20:59:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lwn.net header.i=@lwn.net header.b="H6jT2K0w" Received: from ms.lwn.net (ms.lwn.net [45.79.88.28]) (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 AFF106A00F; Tue, 30 Jan 2024 20:59:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.79.88.28 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706648350; cv=none; b=R76CVF3SyHLH2c4de1wr0/9G+dxR8PwT+Yw1IuETvgYy1nhEzB0XbfGhEsS+kXePRh/Yb8/5hio1M5uQ2EuebPLbpm0wKJpXQZItitXxVFk8sXEXHwnDQ7bYovjdMamR/tCYXxYJmoAylk+4/SA2R3J5F9XGSjG+dEQBUV2L+3Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706648350; c=relaxed/simple; bh=MJJXb4qG2owFQ8t6ZUQMC31iJNYtleq0l6H3DZgMq7s=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=dtup2BUlmTBlld6EeTnf8w+g2FGUecPR39tHAvj/N5qWIn00IWoiNSNcAiGtEnP31qKKtPUESQeYAOM8fWwTiJ0KHCVO2HZqPE+KCn5GVC/8BEOGGmanGyiiBbx4H9wJi/pFFpEyiXSk6w70IxDiOQfeE7RZPETs+FfHPX3Vo0k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lwn.net; spf=pass smtp.mailfrom=lwn.net; dkim=pass (2048-bit key) header.d=lwn.net header.i=@lwn.net header.b=H6jT2K0w; arc=none smtp.client-ip=45.79.88.28 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lwn.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lwn.net DKIM-Filter: OpenDKIM Filter v2.11.0 ms.lwn.net BAAAB41A47 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lwn.net; s=20201203; t=1706648347; bh=vRKu2O/0VPzoBZOtxNzJJj2/lV4jOxX7B02gcKXYkV8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=H6jT2K0wd4Q1sbqGP0dO9KBXWHIMmBwpf1ZLGQbfFE0jLFDSam3yYaMKU9C4OFAlB mTFTOSYbDUyHYSd7ERV+KYeCcY8/j0RbgkreeIe874YqiERc0/UWTXno2oLxBRCwD7 9Y5+RHU6QGPpencdsfLbRcAfM67F2XftD8SxFpm0U06JreMmMeWsj4xAmxIn6jsA7K /SdaIqOU1K/YBAwbX9BN2d3heZ9GJP4mh+Vkw5dk+Yw7dScwdygEPm/EfauGuvYiQS yBzhuncio/SVDkruYfLtlV7V5NtKGV/MOWb+MmLeYyqWqDo1IZX7EzsmjcnIoQR0tu qba1bKL6JhGEg== Received: from localhost (unknown [IPv6:2601:280:5e00:7e19::646]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ms.lwn.net (Postfix) with ESMTPSA id BAAAB41A47; Tue, 30 Jan 2024 20:59:07 +0000 (UTC) From: Jonathan Corbet To: Leo Yan , Arnaldo Carvalho de Melo , Ian Rogers , Thomas Richter , Peter Zijlstra , Adrian Hunter , Jiri Olsa , Ingo Molnar , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: Leo Yan Subject: Re: [PATCH v8] Documentation: userspace-api: Document perf ring buffer mechanism In-Reply-To: <20240102085001.228815-1-leo.yan@linaro.org> References: <20240102085001.228815-1-leo.yan@linaro.org> Date: Tue, 30 Jan 2024 13:59:06 -0700 Message-ID: <87sf2ea679.fsf@meer.lwn.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Leo Yan writes: > 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 explains > the implementation of both the regular 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 > --- Applied, thanks. jon