Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4970485rwd; Sun, 11 Jun 2023 20:02:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7sFbLIXfHpq3/nzSWkesgox+u4xyaRGkuKPq6SSTHk/iO8lKN02R1v9Wk2lg7JySUkCits X-Received: by 2002:a17:906:ee83:b0:974:62bc:33d5 with SMTP id wt3-20020a170906ee8300b0097462bc33d5mr9807449ejb.20.1686538977396; Sun, 11 Jun 2023 20:02:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686538977; cv=none; d=google.com; s=arc-20160816; b=F8vE/D0NcDvtuCzZAce+0JZ/OzEdf+AAJaNUcxOg3S24uZb1zXdbAgmeSa3udQCEZE XY15aMYzCII50zqXFOuJGJ0/0fqLumF4LNwg/+Fi2nZFBGRT5tjXalCcgoOgUfRkA/Hz RMD9cW9ldJlLc6uPksD7JI/YY+6RZcZqPHgMPklXHI65rEYB7su48bDMYyG1Avai3qFj beFUmd0oKHKH3tCIj7Y5oisGIxVWlNLcsfjRhJClrhVBM7EsL0BbFYWeA1l9wmylWAh1 +OFFHSfRApStAlryFDLP0MkK1zjant6+Ds8nYWtbwSJklBnpz1yBJqdGHaNHnOyfMNkY 9U+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=MhVXBfUls4/14U9L9OhdHpMeBzQ3HYPa8b5yM3fjWQw=; b=DLCJEL9MmwB97fZkUQeX7yXCpBjEus3Xe1daBRwYU1Atm83ufeVtxbN4Eslpqx5Fkc 563ZKebiRGoA62dhjA9uXhWglH1DgWQBTTIsnsT8NtZSZb2Bu2GQ9wCD0e6jSrUi3sgv 6EMYsyYqpiDcnTstgcmhbRykOxQnYYbABIxWYQWZG9Jma/AoC0IMW2oeMgY/6EHuq67V MtlzRTg6QhylQKxOMyWS9f0sXvOZH3aweRHXiiUDOUB4juxzJkWJlnKW2i/Kbc0VxS7i uXsz6g+/kmF17zzauhHkKxD6l1PLSDZy7L81sjLpO7TOdZohUTZ56To+PJyRFGhMf9rZ Rhsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p8-20020a170906498800b00965a83df636si4291320eju.1024.2023.06.11.20.02.33; Sun, 11 Jun 2023 20:02:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233695AbjFLCfx (ORCPT + 99 others); Sun, 11 Jun 2023 22:35:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229902AbjFLCfv (ORCPT ); Sun, 11 Jun 2023 22:35:51 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7855B19A; Sun, 11 Jun 2023 19:35:49 -0700 (PDT) Received: from kwepemi500013.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4QfbJr4gx3zqTm2; Mon, 12 Jun 2023 10:30:52 +0800 (CST) Received: from M910t.huawei.com (10.110.54.157) by kwepemi500013.china.huawei.com (7.221.188.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Mon, 12 Jun 2023 10:35:46 +0800 From: Changbin Du To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo CC: Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , , , , Changbin Du Subject: [PATCH] perf/doc: revise the description about PR_TASK_PERF_EVENTS_{ENABLE,DISABLE} Date: Mon, 12 Jun 2023 10:35:23 +0800 Message-ID: <20230612023523.3918618-1-changbin.du@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.110.54.157] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemi500013.china.huawei.com (7.221.188.120) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 The behavior of PR_TASK_PERF_EVENTS_{ENABLE,DISABLE} has been changed since v2.6.30, commit 082ff5a2767a ("perf_counter: Change pctrl() behaviour"). This patch revises the documentation about these two prctl options to match the real behavior. The linux man pages should also be updated. Cc: Ingo Molnar Cc: Peter Zijlstra Signed-off-by: Changbin Du --- tools/perf/design.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/perf/design.txt b/tools/perf/design.txt index aa8cfeabb743..cc9a2716d5ec 100644 --- a/tools/perf/design.txt +++ b/tools/perf/design.txt @@ -439,16 +439,15 @@ Additionally, non-inherited overflow counters can use to enable a counter for 'nr' events, after which it gets disabled again. -A process can enable or disable all the counter groups that are -attached to it, using prctl: +A thread can enable or disable all the counter groups that are +created by itself, using prctl: prctl(PR_TASK_PERF_EVENTS_ENABLE); prctl(PR_TASK_PERF_EVENTS_DISABLE); -This applies to all counters on the current process, whether created -by this process or by another, and doesn't affect any counters that -this process has created on other processes. It only enables or +This applies to all counters created by this thread, and doesn't affect any +counters that created by other processes or threads. It only enables or disables the group leaders, not any other members in the groups. -- 2.25.1