Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp365494lqs; Tue, 5 Mar 2024 04:40:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWJgtA2wtWkaz4tyd3NMIWfnyTxQPceSiyMmkdEz2CeKTfOh0itGKLciwLohacx+fg06AOGnsI5CgyLlvy+o9YQMZIRVX8C5MPzCV+6WA== X-Google-Smtp-Source: AGHT+IFtJVUqsbx+QZBOgFtQQwsPv4kYhuZ5qTZ6xYTzQ8wTpGTwhHp/pmH4DtdfJPBVZTSLm2WR X-Received: by 2002:a17:906:a18d:b0:a44:30f8:ff45 with SMTP id s13-20020a170906a18d00b00a4430f8ff45mr8341694ejy.52.1709642458495; Tue, 05 Mar 2024 04:40:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709642458; cv=pass; d=google.com; s=arc-20160816; b=DK6VHE/vTU0l6SqLgmQebJ4t7sZAv2mXVxBJm5QE/6oMjs/OkOaBpD6iwJVhSpl7h3 AqrUfOh6EPsaPrw0FKI9W0xNRxJvX0G6ibufFfjfx5/RgaR1MursbTaqykAIFYN++vI8 og3YLYH+R08XBVG9FPWdc4ArOWFJK9QiPbj+dLwEpEs/FD5l6iqp2FDEs2CnBzPfnlRz 9R2/0jpRoFEfAXBbVJEmTXdH6m0fto/henMUa3jXe10MWyDkdQuBisKv8CS2Wr42oo8J 67jRsFwJYTiXDO2bcyY4/pS9peP+Sg1wFLhDsgjlFVBYyt42AE7q46aY6kL1HmbPZGrt /Gmg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date; bh=EUG2hG2peFCet4Kwh8k+eryEmNqIWXgaUp4yzoiZHhg=; fh=pMDv8RH8f8ApJ67gHxq661o1oxTqwAtcoMzVWdwYl/s=; b=XcGy14PM/j0Ux26YOXXDv1LCX7YJXrEx2qmNtzRLNcno9aOwdtktHEtjSFBpotaftH lwGaRRYsDKfZvJKjDdqe7jBu8+2A1+P+3J3T8Slu1Nv0L/PsWYc85gqxRaJirwHVyeCr IIpKa+0Ob3U8Ti+w+DN0m/bQLQ25wRQkHLUQPqFASChBhhXTl8csSOdDwvDhtMJ6Ta3H PhYuYGXENC+bY29+txn6Lu4fk0l/lbMaMnSqGOEnf9YTY4Zv2egWc95HH33Yg++zbqYF d4XUgqcREu16HQ586KCE2um+EUo52OUxCCpY1v3N5R/WRcQBByzfYLm+7NlzwmDCcw6R l8MQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-92390-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92390-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id hp22-20020a1709073e1600b00a3eabd8fc4csi5023610ejc.1028.2024.03.05.04.40.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 04:40:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-92390-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-92390-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92390-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 0BD9C1F25CFA for ; Tue, 5 Mar 2024 12:40:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 840148592E; Tue, 5 Mar 2024 12:40:29 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA12485640; Tue, 5 Mar 2024 12:40:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709642429; cv=none; b=DswLCgxUWMhFlBETX84Vg1SxMfS9wB9yV7RBc4jot5WyoTbAH4j6S7pCh5Sjw77LwjHV1ud2+5tJdnqHIOt+C0hDv/6Sno6yGo4Oi6gKbPapLOWDdRyl+6+UFVIRHVaA99JJ18cY75TOYVxnY7nWb+Ct30vJbEE6kPlFmexkxZs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709642429; c=relaxed/simple; bh=0nCnavvNQviHwSY+c1UlWiFdurAhvuqMgaFxZ6NBAZI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=P6+1S9moEtS19wJDSoQCpipZxwrsKzCmwwlnpC1DOsxR+CQMheZKHe+A600oegJZnkDLkRD5mZyLHbbbb47gL4JMAnxfqH2yto1vgWc0mkQQJKgbgvEijDgPYFlfyN56WVHCwqY60OcXbSUMu/ZPB73ES/FuoXMUljN1ubUlm3A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5DE291FB; Tue, 5 Mar 2024 04:41:02 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.69.116]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 15EF33F73F; Tue, 5 Mar 2024 04:40:23 -0800 (PST) Date: Tue, 5 Mar 2024 12:40:20 +0000 From: Mark Rutland To: Yang Jialong =?utf-8?B?5p2o5L2z6b6Z?= Cc: Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arch/s390/perf: Register cpumf_pmu with type = PERF_TYPE_RAW Message-ID: References: <20240304022701.7362-1-jialong.yang@shingroup.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Tue, Mar 05, 2024 at 09:43:16AM +0800, Yang Jialong 杨佳龙 wrote: > 在 2024/3/4 17:34, Mark Rutland 写道: > > On Mon, Mar 04, 2024 at 10:27:01AM +0800, JiaLong.Yang wrote: > > > The struct pmu cpumf_pmu has handled generic events. So it need some > > > flags to tell core this thing. > > > > It's not necessary to register as PERF_TYPE_RAW in order to handle raw events, > > and PERF_TYPE_RAW is not a flag. > > > > Have you encountered a functional problem, or was this found by inspection? > > As you expected, I'm trying to confirm which one pmu has the capability to > handle generic events in registering pmus instead of test generic events in > each pmus when opening. If we want to do that, then we need a new flag on struct pmu to restrict which events we try to open on a PMU. If you want to do that, you need to Cc the perf maintainers and discuss that rather than point-hacking individual drivers. > We can confirm that before using. We have pay more in handling them when > opening. > So most driver developers use PERF_TYPE_RAW. x86 and arm use > PERF_PMU_CAP_EXTENDED_HW_TYPE. Others use struct pmu::task_ctx_nr = > perf_hw_context. > I think PERF_TYPE_RAW will be a easily accepted way. So ... No, this is a hack, and it doesn't solve the problem you describe above. If we want to remove the need for most PMUs to look at perf_event_attr::type, then we should have a new PERF_PMU_CAP_ flag on the PMU to say "this PMU supports generic events" (or separate flags for the generic RAW/HW/CACHE types), and update all relevant PMUs accordingly. Please do not try to overload pmu::type with additional semantics; it's messy enough as-is. Mark.