Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp427438lqs; Tue, 5 Mar 2024 06:17:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVKu1CCwj7jIfbKTr4xlHNjt+u+9zbiDuyTmRDJS1LbFCzu5gn9krk5LCG2iMZtPnaaFOj9CGEJTetmAlcIVzJmyJa0RawBfrhvkuIgaQ== X-Google-Smtp-Source: AGHT+IHKTLRuccogi0YuI2bVPQj4PMqMKHv/jF5bhx8dQc7jkWOlLn8RLhFwu+7U5vviqf4mPm+H X-Received: by 2002:ad4:4391:0:b0:690:8f36:7c0 with SMTP id s17-20020ad44391000000b006908f3607c0mr589296qvr.21.1709648263783; Tue, 05 Mar 2024 06:17:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709648263; cv=pass; d=google.com; s=arc-20160816; b=f/8FtxKMlFO0Q0K1KxAEm1GvFwjz84MzUWyW8x95rfPffcoh7fHS46iWpYS3p2Jc7c zcqAsum+EsHjdLIs+m9SMihtJLyCzAuRFIv8mPol5iO2F+JWFOMxvvT+RrUqluQmxB/f 9WrcetvMnO9Dkm71axYe21OGsa6BKe1nYxBrxgBB6uhNxkt8zb0xGq1DDw7UvAahXfUz bZU+c78KZcNOzjH2g7YUE/BD8XIMFfLKdSiy0E0B9Xdhf3lQ0ddmYIFcOgHp6n8Fa+sD Qnlrhezbq6UPrT8B908XappvEEkFUoqR+abUsaxDabVTa0U61sR5OH8VLkKw3Fab0u6p hFFg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:in-reply-to:from:references :cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=xdgJ9F0RgLJwUJcHzE4T9iGwZ+MjZxy0ntiV1D3KzPk=; fh=HiKMW4iimiQ6IAXEDAv5lyyu//2SfK9fKZyqytKI/zo=; b=MY99blB00WMO+I7edGPtd9Cxw1JFXjuZEL2oH0BcBtVdonw+mCaAnR8AW6Mh9a9Fia iG+3kbLB0rXdDnV/bzxGP08xWuS9WHn6F/cRcHYBPT+GxbvGCQZbtdcPz69c7QJbk3gN czkRsGz49cDKl8Ehsopc9LHlbZW1pMcLQC2lxxeBzyL+yR+oSmi99zF2Gzv0YHksR1XV jlAO2D7th9riJXwln5uQHSOEQ85OigPMTZxSoR0vlPLv6WyZoB1c54ygB8dIy99a/Zeh 69ocD+Cc5BMpg65kHFsnudCrWPqhy0ANbfHQtlwk31KHCzVWXoZU4Bv+VBkYz5TJE/Wz stgw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=shingroup.cn dmarc=pass fromdomain=shingroup.cn); spf=pass (google.com: domain of linux-kernel+bounces-92506-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92506-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=shingroup.cn Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id p10-20020ad45f4a000000b006901a3b7869si11915038qvg.297.2024.03.05.06.17.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 06:17:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-92506-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=shingroup.cn dmarc=pass fromdomain=shingroup.cn); spf=pass (google.com: domain of linux-kernel+bounces-92506-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92506-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=shingroup.cn 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 8210F1C22723 for ; Tue, 5 Mar 2024 14:17:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6CBD986634; Tue, 5 Mar 2024 14:17:11 +0000 (UTC) Received: from smtpbgau1.qq.com (smtpbgau1.qq.com [54.206.16.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5FA2D86AE2; Tue, 5 Mar 2024 14:17:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=54.206.16.166 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709648230; cv=none; b=JYFnPmCAH7wGmbWlexgdCdzMP7zIHAt0EjW6GaM9kkTaFSp7GmgYtOkCUr8mfsHULfkD8zKmHEPJTUZVpF0sFgDj0DSHQhWwmCWDIMSN0bdY5U+p2uBh7lLo61/flq8kHfOxpOp+YMz3ULXsWCdmzSQT5ONvgnmtwR5AnI3rCFE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709648230; c=relaxed/simple; bh=xdgJ9F0RgLJwUJcHzE4T9iGwZ+MjZxy0ntiV1D3KzPk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=WpNFxTLMR+6fR9SqcYDJZtcHVGaM3GfJadzz6BYlnXaU0Ubr8I20E8EMbKTIgI75L1u1auszHlzGrlyZDg3c3E6kwPJ60qCrgpv1d0wiFz7g33b90cplJCu6+Emp5h1E/TRcPMKjVgOxZTdfi0nXmbrd40SrE/+z427XyEeUmZ8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shingroup.cn; spf=pass smtp.mailfrom=shingroup.cn; arc=none smtp.client-ip=54.206.16.166 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shingroup.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shingroup.cn X-QQ-mid: bizesmtpipv601t1709648175tbrp X-QQ-Originating-IP: IxHRVeKC2DXxxEzD41W84GxArjINfZ7NsUKKWFqZL8M= Received: from [IPV6:2409:8a20:4c7e:d580:7d3e: ( [255.60.145.1]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 05 Mar 2024 22:16:14 +0800 (CST) X-QQ-SSF: 00400000000000B0B000000A0000000 X-QQ-FEAT: 5q30pvLz2ieD1BXimzetlg/X9OUaHwAyX7KTsn77LnG4/z95p50VPgubGk+5F 2tMN+NEyRVscQKADQvL7xK9CqtDBV/ooigKYQ1Ic880MI/rtoRlNFeN0iieYzSG/ocVad47 xMJ8QJZGW1EDPMraDTHwKKuzVG4zt+syw1OtUKvOMBYv7vG/+Qofy422cKNn/NtyUnEqKS9 GH5bik3IoVwEsWS7kltTZn2DbbAXJVTVzr9ADZ+O4leGf/Ns7BSyvH/93oxmiRkJcQq50n3 UPbphRskeBRV5y/OkwOWGDhr8JIruXokjGb5oE/dr8Ap4XwI6azKpf7LC1h5BiehL+kkRUR Aml0I0aaoFFMgfLfu48rYzH8+ot4ZC7iUh5um//k3aOwbLXmLjway4QJZUuY0zBZVsl+tlu X-QQ-GoodBg: 2 X-BIZMAIL-ID: 18177786939764390676 Message-ID: Date: Tue, 5 Mar 2024 22:16:13 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] arch/s390/perf: Register cpumf_pmu with type = PERF_TYPE_RAW To: Mark Rutland Cc: Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240304022701.7362-1-jialong.yang@shingroup.cn> From: Jialong Yang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtpipv:shingroup.cn:qybglogicsvrgz:qybglogicsvrgz6a-1 在 2024/3/5 20:40, Mark Rutland 写道: > 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. OK. Thanks for guiding. > > Mark. >