Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4072802rwd; Tue, 23 May 2023 02:43:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5dnHKO+miw40w3PYcqpp1vI6kncGuaZtKcZIESLRZum+5tvKSx5rUZEdr4H7aEJzikmMa9 X-Received: by 2002:a17:902:7785:b0:1a1:dd2a:fe6c with SMTP id o5-20020a170902778500b001a1dd2afe6cmr12540135pll.53.1684834980162; Tue, 23 May 2023 02:43:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684834980; cv=none; d=google.com; s=arc-20160816; b=qxIR8a8GN9DJ46ACP30bFrUqZQ1c8eXCxu0MHz/JH36z8myTMalpPWm9IpePSUC6fV coNWBNeh758+mppAN4wp2f6w1NsWAPE/aPTpdRN0IVe83/QYGGY9csKmTjAiVPJW1x+a ozR8dbwR1Kr4CQM3aYVMwD0pS5a8buPkTzsEu1/w/xs7fxmS1MMw4OS7U4uDOYAVaFRr vhOkuddDNy8hZLBWisBeKwwVNGU1T5csRMkAYPNGtPoOOsClLxtwJNhTHZ2QRzKO+y1P yZq2cLjscNUyGNV6/MPs/pcTU/ZoE3fQh9YlRq/zNB6EEfTKB7EZiXHWxN09rsfkgLTb hiTg== 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=2USaM7dLpUIPDW7mms5Ni/sqZBsjQCt4MCe280ctGRU=; b=CK8reMad2suwqEvd3dBRryZzVqyBiiN8VjGKOu5CmsogT4fuWmdjrfCG+VdMAzAgct Ra/q6B4IOLuBV0NxlnUwLiA4sdab6Otm1rWposuqhgJQHGVD5FkqXXW6l6GM8RkRAkDb pbSznMMJCBah/VCdJ6GqDSNCP0CIHtpPUb4CZVXqK4gBDMEbm8MF9+61R2oDVHBhNsbK f8I5ianeEJJpFcacy+DBvAzS82Ihw0kHHon9twvSQJC+mclZwZNkpKqmmCgwgJ1T8L0h /q5OWqpAmR+DUmemfJVs8WXo3Z2KRboQQ0vSABtkcmbCFOIpGx+BxbFH6NtZteYIY8Fn iYIg== 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 h3-20020a170902f7c300b001a229e52c19si6126879plw.91.2023.05.23.02.42.47; Tue, 23 May 2023 02:43:00 -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 S236129AbjEWJeB (ORCPT + 99 others); Tue, 23 May 2023 05:34:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235522AbjEWJd4 (ORCPT ); Tue, 23 May 2023 05:33:56 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CB2E1A6; Tue, 23 May 2023 02:33:48 -0700 (PDT) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4QQTXt3WR8z18Lfn; Tue, 23 May 2023 17:29:18 +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.23; Tue, 23 May 2023 17:33:46 +0800 From: Yicong Yang To: , , , , , CC: , , , , Subject: [PATCH v3 0/4] Improve PTT filter interface Date: Tue, 23 May 2023 17:32:24 +0800 Message-ID: <20230523093228.48149-1-yangyicong@huawei.com> X-Mailer: git-send-email 2.31.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.50.163.32] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) 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,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 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. In order to support above function, this series also includes a patch 1/4 to factor out the allocation and release function of PTT filters. Also includes an improvement. Patch 4 tends to set proper PMU capability to avoid collecting unnecessary data to save the storage. Change since v2: - Fix one possible issue for dereferencing a NULL pointer Link: https://lore.kernel.org/linux-pci/20230331070310.5465-1-yangyicong@huawei.com/ Change since v1: - Drop the patch for handling the cpumask since it seems to be redundant - Refine of the codes per Jonathan - Add Patch 1/4 for refactor the filters allocation and release - Thanks the review of Jonathan. Link: https://lore.kernel.org/linux-pci/d496ee4f-641a-a726-ab3f-62b587422b61@huawei.com/T/#m47e4de552d69920035214b3e91080cdc185f61f5 Yicong Yang (4): hwtracing: hisi_ptt: Factor out filter allocation and release operation 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 | 426 ++++++++++++++++-- drivers/hwtracing/ptt/hisi_ptt.h | 53 +++ 4 files changed, 512 insertions(+), 29 deletions(-) -- 2.24.0