From: Madhavan Srinivasan <maddy@linux.ibm.com>
To: Kajol Jain <kjain@linux.ibm.com>,
mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org
Cc: suka@us.ibm.com, maddy@linux.vnet.ibm.com, atrajeev@linux.vnet.ibm.com
Subject: Re: [PATCH] powerpc/perf/hv-24x7: Dont create sysfs event files for dummy events
Date: Thu, 17 Dec 2020 17:10:43 +0530 [thread overview]
Message-ID: <d61d619b-3557-f4ff-a363-3a8f12b3a9ed@linux.ibm.com> (raw)
In-Reply-To: <20201217113230.1069882-1-kjain@linux.ibm.com>
On 12/17/20 5:02 PM, Kajol Jain wrote:
> hv_24x7 performance monitoring unit creates list of supported events
> from the event catalog obtained via HCALL. hv_24x7 catalog could also
> contain invalid or dummy events (with names like FREE_ or CPM_FREE_ so
Can you also include " RESERVED_NEST*" as part of the check.
# ls /sys/devices/hv_24x7/events | grep RESERVED
RESERVED_NEST1
RESERVED_NEST10
RESERVED_NEST11
RESERVED_NEST12
...
Maddy
> on). These events does not have any hardware counters backing them.
> So patch adds a check to string compare the event names to filter
> out them.
>
> Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
> ---
> arch/powerpc/perf/hv-24x7.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c
> index 6e7e820508df..c3252d8a7818 100644
> --- a/arch/powerpc/perf/hv-24x7.c
> +++ b/arch/powerpc/perf/hv-24x7.c
> @@ -894,6 +894,11 @@ static int create_events_from_catalog(struct attribute ***events_,
>
> name = event_name(event, &nl);
>
> + if (strstr(name, "FREE_")) {
> + pr_info("invalid event %zu (%.*s)\n", event_idx, nl, name);
> + junk_events++;
> + continue;
> + }
> if (event->event_group_record_len == 0) {
> pr_devel("invalid event %zu (%.*s): group_record_len == 0, skipping\n",
> event_idx, nl, name);
> @@ -955,6 +960,9 @@ static int create_events_from_catalog(struct attribute ***events_,
> continue;
>
> name = event_name(event, &nl);
> + if (strstr(name, "FREE_"))
> + continue;
> +
> nonce = event_uniq_add(&ev_uniq, name, nl, event->domain);
> ct = event_data_to_attrs(event_idx, events + event_attr_ct,
> event, nonce);
next prev parent reply other threads:[~2020-12-17 11:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-17 11:32 [PATCH] powerpc/perf/hv-24x7: Dont create sysfs event files for dummy events Kajol Jain
2020-12-17 11:40 ` Madhavan Srinivasan [this message]
2020-12-17 11:51 ` kajoljain
2020-12-18 0:56 ` Michael Ellerman
2020-12-18 7:51 ` kajoljain
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=d61d619b-3557-f4ff-a363-3a8f12b3a9ed@linux.ibm.com \
--to=maddy@linux.ibm.com \
--cc=atrajeev@linux.vnet.ibm.com \
--cc=kjain@linux.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.vnet.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=suka@us.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).