From patchwork Wed Mar 15 09:43:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yicong Yang X-Patchwork-Id: 6667 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2234453wrd; Wed, 15 Mar 2023 02:58:53 -0700 (PDT) X-Google-Smtp-Source: AK7set/N7iqQF9toowtyOKmlAqx1JmjNKl7ibo2R8UNgW9pda2OXgXP60osdtjDEryehIvUYw8yz X-Received: by 2002:a17:902:e883:b0:1a1:595a:8e25 with SMTP id w3-20020a170902e88300b001a1595a8e25mr1930209plg.20.1678874333047; Wed, 15 Mar 2023 02:58:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678874333; cv=none; d=google.com; s=arc-20160816; b=nS2PwIh2Ua6KRUQny5nqFIvI5G73En51OQ7+ElyDSHa6vVJpNjyzKk7sWrxBhp9JFe hM9ABBvYxoUimMqYTjU6vA+rk38xkbQOPZ5YiXqifKu5gwuX6D2tHQrNTgFeqYy88L3l R+Oexd/ufZSC/nxNcXdxZi/25+X8Jq5C9+HtQobn1pGvpUn59+Zy2FPxGNXp75nAtCdl fSnS8jE6iO4iyd2fCv16wy1udPNN1lGi5gE3NjCkMXRP03+1ezTOegWPq/1hYk1h2zjE 0K39gVvF9tEyWvqZdujMi27BmkyLoehT/Zeg3dLpiuTW67fJQlpUlqBTO+zlh1rZgyaz zI5A== 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=/0lNUkC4BUxvmR7tAyN/xy7e2SLCVrxWxgaa/dT9UPc=; b=Zp8jx0gt7BesbeDpPUYs9qecyAXiP+XB8OF5vMH+aQnjDPYbrYipMeYtFzjEtR7VE5 c524I7HmOLAVaQhWx6k0lf8/VPfi0FZDaCwTLQoiyIlh7Be+FIJLoo5M2oggKjeSOnk+ HgGCQauBOSZOSndoIUdtYZh50LhcRggpmZTSZLLndnb/pYnA62TzoNJz4u4A6h6lPKSj cBC06v4miCGXiNODW0gKfxL3B2ru0z3ftErDngCkeaM4lH71usg7aCWSQQkJd9OTGeEU 1FmSDQ0r9ytLIl6OvVxx38kOc/k/e9dTSPWVEje4hIMpvB4NWPUewyHGH4vj+EMu2T2i PEkQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kw8-20020a170902f90800b0019e8d4cb8d3si4508439plb.614.2023.03.15.02.58.37; Wed, 15 Mar 2023 02:58:53 -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 S232109AbjCOJoG (ORCPT + 99 others); Wed, 15 Mar 2023 05:44:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232094AbjCOJn7 (ORCPT ); Wed, 15 Mar 2023 05:43:59 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2ADE5F6ED; Wed, 15 Mar 2023 02:43:46 -0700 (PDT) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Pc53z5wT4z17KqX; Wed, 15 Mar 2023 17:40:47 +0800 (CST) Received: from localhost.localdomain (10.50.163.32) by canpemm500009.china.huawei.com (7.192.105.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Wed, 15 Mar 2023 17:43:44 +0800 From: Yicong Yang To: , , , , , CC: , , , , Subject: [PATCH 0/4] Improve PTT filter interface and some fixes Date: Wed, 15 Mar 2023 17:43:12 +0800 Message-ID: <20230315094316.26772-1-yangyicong@huawei.com> X-Mailer: git-send-email 2.31.0 MIME-Version: 1.0 X-Originating-IP: [10.50.163.32] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500009.china.huawei.com (7.192.105.203) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760427332554515891?= X-GMAIL-MSGID: =?utf-8?q?1760427332554515891?= From: Yicong Yang This series tends to improve the PTT's filter interface in 2 aspects (Patch 2&3): - Support dynamically filter updating to response to hotplug Previous the supported filter list is settled down once the driver probed and it maybe out-of-date if hotplug events happen later. User need to reload the driver to update list. Patch 1/2 enable the driver to update the list by registering a PCI bus notifier and the filter list will always be the latest. - Export the available filters through sysfs Previous user needs to calculate the filters and filter value using device's BDF number, which requires the user to know the hardware well. Patch 3/3 tends to export the available filter information through sysfs attributes, the filter value will be gotten by reading the file. This will be more user friendly. Also includes a fix and an improve. Patch 1 tends to only export the online CPUs supported by the PTT, this will make perf work properly when there's offline CPUs within the node PTT locates. Patch 4 tends to set proper PMU capability to avoid collecting unnecessary data to save the storage. Yicong Yang (4): hwtracing: hisi_ptt: Make cpumask only present online CPUs hwtracing: hisi_ptt: Add support for dynamically updating the filter list hwtracing: hisi_ptt: Export available filters through sysfs hwtracing: hisi_ptt: Advertise PERF_PMU_CAP_NO_EXCLUDE for PTT PMU .../ABI/testing/sysfs-devices-hisi_ptt | 50 +++ Documentation/trace/hisi-ptt.rst | 12 +- drivers/hwtracing/ptt/hisi_ptt.c | 396 +++++++++++++++++- drivers/hwtracing/ptt/hisi_ptt.h | 51 +++ 4 files changed, 498 insertions(+), 11 deletions(-)