Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3330413imm; Mon, 13 Aug 2018 09:46:07 -0700 (PDT) X-Google-Smtp-Source: AA+uWPz0m2nXRbDHzMhQX33gmm5tUpRGBJXwebonr7py1L2ofdchzyWWRDQ1EqzprEscGf3AGIUj X-Received: by 2002:a62:3856:: with SMTP id f83-v6mr19928833pfa.48.1534178766967; Mon, 13 Aug 2018 09:46:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534178766; cv=none; d=google.com; s=arc-20160816; b=MCCspIJYl5SY3w3vX77SBNxsrHu1wTxG2QSUT8xYOhYrqCBx0B2LaePqkPPfB0i5ep /UMb+GmWSjr/W22AE/DMlxk1N7XaItniPrP4hdg2EZ4ttJxb58fa7oaeS/LrgZAqUJCb tSURVFnn8l5Xo44sMqHW1gzvaG6//EzvRVNEbVGzvuR4T3UlzA+V9vAPWaLeews6YtE0 TFpcwqmBQztpdaSnW68Nnj9XR3bc3XVV8sz3tY2s/v/Ce60BJIHE47Mwbk75e6EXdzxK NNfYBaTooaJQPYdjOJlLYm/8b5jWsjcGTkMgILUPVOt69KJRSYmF0YoU3839aO/vGufX QVzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:cc:dkim-signature :arc-authentication-results; bh=tOR25S/KdaplFdfBegsBk3nfA7DK7sEOd0coNwIZGZM=; b=Uz7TgCRIOXOslfroXW2JYd7okmSme8Yms0h6idrMv5sx+L8QRF6+mC8b9yUoOATdDR ozLJpJ8PotFX7P+0lXLAbdMhBspV3WAo3PAX0kszsXpCK5tL5MovJCrvXOq69320DbI7 7kyd7QnP7EfNot8I6TQOcIGhfnduhvX9Gja2JnhMStJgJ3uWGl0GODoZG/bHxJJBED9F TCDDcbkR1thm0ZQa9CtugYdjIp2Neo5jPoeUrZJypUzmqj3sXMQSi0D1WRamuqWp3AZp /3SgXgX/b4790NHEKah63VysL4eMgomBFNRrttCfeKNEmolb92a3Kkd3nXqQymPB6GzF xs+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gaeVpror; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2-v6si14110664plp.233.2018.08.13.09.45.48; Mon, 13 Aug 2018 09:46:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gaeVpror; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729887AbeHMTWu (ORCPT + 99 others); Mon, 13 Aug 2018 15:22:50 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:36649 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729087AbeHMTWu (ORCPT ); Mon, 13 Aug 2018 15:22:50 -0400 Received: by mail-wr1-f68.google.com with SMTP id h9-v6so14847352wro.3; Mon, 13 Aug 2018 09:39:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=cc:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=tOR25S/KdaplFdfBegsBk3nfA7DK7sEOd0coNwIZGZM=; b=gaeVprorMLjDUgppwG74BIez/sMe35LBOoxGvZb/6D0c8qFmp1b9mxRSDJ9NdRpNqb JzfJ6l1K3BoizyU2s+zAweJAlpG/IPaLmTjbxxNkK8m8J9rG9avznUMbHz+7ktKoB7i3 /MO1xqLubVGOADCLV0GG1Pg90U4oijQWws2uaVbAZRtkkl6TzlMtsKv8c2rv6uZe1p4L kfGYQlJ4GfBhwlpn06ozwjzFXDNMmDCnFYu+V3YJVa7QTC33Bee+68UXKcHpii+qiHFs 2Ighj/iyld4Q5lwojN6Z7cNqNhiBLbCrKdoSkSIh13vj9zqeS2vWSIv3LPrfNU+5+ImF 1H8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:cc:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=tOR25S/KdaplFdfBegsBk3nfA7DK7sEOd0coNwIZGZM=; b=tepyVPkzFVuOLiWK3UegWGneSp5dJ1roolyoTgLsCrBGd/GV5dI0/l132aSfKphwMF h40iBnwymgOp1XJymr4yv2evHwG3TkC7/1VinS+M2BdZ7PogOOCx2qZatC+stwMHxHSa /mvW6EKUvX/tt2qf8SHBPZRlRdT44uAgJTpjgouEfWGw1FxCgwxye+Pv/Ngtu0nHFqU6 832u+5THcUBDdwmew+6QgLMDmbDfqJoV/xp+CeNmQwEikhf86cECQUudj8/hybnXXOBb HWovO3SEW6wVj49A5QZkEl/MVVzqjH9B05ccjosB3+Iypee/rzRFbfDqOHM1zX5PvZ48 aj4g== X-Gm-Message-State: AOUpUlE2KMFzq0GWSOUBEShhs1zwUdmq1G9zWyKdFDSc+tb3wXCH3glk BUcg0hFDKQFJgXwuofgALC7Dalt3U/s= X-Received: by 2002:adf:8405:: with SMTP id 5-v6mr10885755wrf.41.1534178390601; Mon, 13 Aug 2018 09:39:50 -0700 (PDT) Received: from ?IPv6:2001:a61:25e2:700:4f0c:c4f8:e531:4a0d? ([2001:a61:25e2:700:4f0c:c4f8:e531:4a0d]) by smtp.gmail.com with ESMTPSA id s2-v6sm16998603wrn.83.2018.08.13.09.39.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Aug 2018 09:39:49 -0700 (PDT) Cc: mtk.manpages@gmail.com, pi3orama@163.com, linux-kernel@vger.kernel.org, lizefan@huawei.com, linux-man@vger.kernel.org Subject: Re: [PATCH v3][manpages 1/2] perf_event_open.2: Document PERF_EVENT_IOC_PAUSE_OUTPUT To: Wang Nan , vincent.weaver@maine.edu References: <20161024065256.160703-1-wangnan0@huawei.com> <20161024065256.160703-2-wangnan0@huawei.com> From: "Michael Kerrisk (man-opages)" Message-ID: <7bb03d5d-fbfb-f4e4-d505-de012535f844@gmail.com> Date: Mon, 13 Aug 2018 18:39:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20161024065256.160703-2-wangnan0@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Wangnan, On 10/24/2016 08:52 AM, Wang Nan wrote: > Linux 4.7 (86e7972f690c1017fd086cdfe53d8524e68c661c) introduces > PERF_EVENT_IOC_PAUSE_OUTPUT feature. Document it. Just to confirm, I presume this patch has been superseded by the one from Vince that I just applied. Cheers, Michael > Signed-off-by: Wang Nan > Reviewed-by: Vince Weaver > Cc: Michael Kerrisk > --- > man2/perf_event_open.2 | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) > > diff --git a/man2/perf_event_open.2 b/man2/perf_event_open.2 > index fade28c..561331c 100644 > --- a/man2/perf_event_open.2 > +++ b/man2/perf_event_open.2 > @@ -1687,6 +1687,15 @@ the > .I data_tail > value should be written by user space to reflect the last read data. > In this case, the kernel will not overwrite unread data. > + > +When the mapping is read only (without > +.BR PROT_WRITE ), > +setting .I data_tail is not allowed. > +In this case, the kernel will overwrite data when sample coming, unless > +the ring buffer is paused by a > +.BR PERF_EVENT_IOC_PAUSE_OUTPUT > +.BR ioctl (2) > +system call before reading. > .TP > .IR data_offset " (since Linux 4.1)" > .\" commit e8c6deac69629c0cb97c3d3272f8631ef17f8f0f > @@ -2865,6 +2874,21 @@ The argument is a BPF program file descriptor that was created by > a previous > .BR bpf (2) > system call. > +.TP > +.BR PERF_EVENT_IOC_PAUSE_OUTPUT " (since Linux 4.7)" > +.\" commit 86e7972f690c1017fd086cdfe53d8524e68c661c > +This allows pausing and resuming the event's ring-buffer. A > +paused ring-buffer does not prevent generation of samples, but simply > +discards the samples. The discarded samples are considered lost, > +causing > +.BR PERF_RECORD_LOST > +to be generated when possible. > + > +The argument is an integer. A nonzero value pauses the ring-buffer, > +zero resumes the ring-buffer. > + > +Pausing a read only ring buffer before reading from it without having > +to worry about data being overwritten. > .SS Using prctl(2) > A process can enable or disable all the event groups that are > attached to it using the >