linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Kajol Jain <kjain@linux.ibm.com>, linuxppc-dev@lists.ozlabs.org
Cc: Nageswara R Sastry <nasastry@in.ibm.com>,
	kjain@linux.ibm.com, anju@linux.vnet.ibm.com,
	maddy@linux.vnet.ibm.com
Subject: Re: [RESEND PATCH v2] powerpc/kernel/sysfs: Add PMU_SYSFS config option to enable PMU SPRs sysfs file creation
Date: Mon, 09 Dec 2019 21:01:44 +1100	[thread overview]
Message-ID: <87d0cxrf5j.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <20191205052558.2091-1-kjain@linux.ibm.com>

Kajol Jain <kjain@linux.ibm.com> writes:
> Many of the performance moniroting unit (PMU) SPRs are
> exposed in the sysfs. "perf" API is the primary interface to program
> PMU and collect counter data in the system. So expose these
> PMU SPRs in the absence of CONFIG_PERF_EVENTS.
>
> Patch adds a new CONFIG option 'CONFIG_PMU_SYSFS'. The new config
> option used in kernel/sysfs.c for PMU SPRs sysfs file creation and
> this new option is enabled only if 'CONFIG_PERF_EVENTS' option is
> disabled.
...
> diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
> index 12543e53fa96..f3ad579c559f 100644
> --- a/arch/powerpc/platforms/Kconfig.cputype
> +++ b/arch/powerpc/platforms/Kconfig.cputype
> @@ -417,6 +417,14 @@ config PPC_MM_SLICES
>  config PPC_HAVE_PMU_SUPPORT
>         bool
>  
> +config PMU_SYSFS
> +	bool
> +	default y if !PERF_EVENTS
> +	help
> +	  This option enables PMU SPR sysfs file creation. Since PMU SPRs are
> +	  intended to be used via "perf" interface, config option is enabled
> +	  only when CONFIG_PERF_EVENTS is disabled.

This could break existing users that expect the sysfs files to exist.

The situation we have is that all these registers are currently exposed
in sysfs, but we don't *think* anything/anyone is using them.

But we're not sure, so we can't just remove them entirely. And we also
can't make them incompatible with perf, because then a user has to
choose the sysfs files OR perf, which could break someone's setup.

So the option must be user selectable, it should not depend on
PERF_EVENTS, and it should be 'default n' (which is the default).

That way it's off by default, unless someone turns it on deliberately.

cheers

      parent reply	other threads:[~2019-12-09 10:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05  5:25 [RESEND PATCH v2] powerpc/kernel/sysfs: Add PMU_SYSFS config option to enable PMU SPRs sysfs file creation Kajol Jain
2019-12-05  5:58 ` Christophe Leroy
2019-12-09  8:21   ` kajoljain
2019-12-09 10:01 ` Michael Ellerman [this message]

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=87d0cxrf5j.fsf@mpe.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=anju@linux.vnet.ibm.com \
    --cc=kjain@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.vnet.ibm.com \
    --cc=nasastry@in.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).