All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: "Yang Jialong 杨佳龙" <jialong.yang@shingroup.cn>
Cc: Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arch/s390/perf: Register cpumf_pmu with type = PERF_TYPE_RAW
Date: Tue, 5 Mar 2024 12:40:20 +0000	[thread overview]
Message-ID: <ZecStMBA4YgQaBEZ@FVFF77S0Q05N> (raw)
In-Reply-To: <ACE696AA8DB8D91B+458ebdd8-6951-4f72-a188-b21dc9863b90@shingroup.cn>

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. 

  reply	other threads:[~2024-03-05 12:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-04  2:27 [PATCH] arch/s390/perf: Register cpumf_pmu with type = PERF_TYPE_RAW JiaLong.Yang
2024-03-04  9:34 ` Mark Rutland
2024-03-05  1:43   ` Yang Jialong 杨佳龙
2024-03-05 12:40     ` Mark Rutland [this message]
2024-03-05 14:16       ` Jialong Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZecStMBA4YgQaBEZ@FVFF77S0Q05N \
    --to=mark.rutland@arm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=jialong.yang@shingroup.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=svens@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.