From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>,
Vince Weaver <vincent.weaver@maine.edu>,
jim mauro <jim.mauro@gmail.com>,
"linux-perf-use." <linux-perf-users@vger.kernel.org>
Subject: Re: Getting PEBS to work
Date: Tue, 24 May 2016 09:19:57 -0300 [thread overview]
Message-ID: <20160524121957.GO8897@kernel.org> (raw)
In-Reply-To: <20160524101726.GS3193@twins.programming.kicks-ass.net>
Em Tue, May 24, 2016 at 12:17:26PM +0200, Peter Zijlstra escreveu:
> On Mon, May 23, 2016 at 11:05:39AM -0300, Arnaldo Carvalho de Melo wrote:
> > > # dmesg | egrep -i 'pmu|pmc|pebs'
> > > [ 0.381095] Performance Events: PEBS fmt1+, 16-deep LBR,
> > > SandyBridge events, full-width counters, Intel PMU driver.
> > > [ 0.381101] perf_event_intel: PEBS disabled due to CPU errata,
> > > please upgrade microcode
> > > [ 0.395348] NMI watchdog: enabled on all CPUs, permanently consumes
> > > one hw-PMU counter.
> > > [ 1.231836] nouveau [ PMC][0000:01:00.0] MSI interrupts enabled
> > >
> > > Gah, it was there all along!
> >
> > Wish this was exported by the kernel somehow, then tooling could emit a
> > sensible message :-\
>
> You mean something like so?
Probably, I'll try prototyping the tooling part later.
Thanks!
- Arnaldo
> --- a/arch/x86/events/core.c
> +++ b/arch/x86/events/core.c
> @@ -1716,6 +1716,8 @@ ssize_t x86_event_sysfs_show(char *page,
> return ret;
> }
>
> +static struct attribute *x86_pmu_attrs[];
> +
> static int __init init_hw_perf_events(void)
> {
> struct x86_pmu_quirk *quirk;
> @@ -1779,6 +1781,9 @@ static int __init init_hw_perf_events(vo
> x86_pmu_events_group.attrs = tmp;
> }
>
> + if (!x86_pmu.pebs)
> + x86_pmu_attrs[1] = NULL;
> +
> pr_info("... version: %d\n", x86_pmu.version);
> pr_info("... bit width: %d\n", x86_pmu.cntval_bits);
> pr_info("... generic registers: %d\n", x86_pmu.num_counters);
> @@ -2120,10 +2125,20 @@ static ssize_t set_attr_rdpmc(struct dev
> return count;
> }
>
> +static ssize_t pebs_show(struct device *cdev,
> + struct device_attribute *attr,
> + char *buf)
> +{
> + return snprintf(buf, 40, "%d\n",
> + !!(x86_pmu.pebs_active && !x86_pmu.pebs_broken));
> +}
> +
> static DEVICE_ATTR(rdpmc, S_IRUSR | S_IWUSR, get_attr_rdpmc, set_attr_rdpmc);
> +static DEVICE_ATTR_RO(pebs);
>
> static struct attribute *x86_pmu_attrs[] = {
> &dev_attr_rdpmc.attr,
> + &dev_attr_pebs.attr,
> NULL,
> };
>
next prev parent reply other threads:[~2016-05-24 12:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-19 22:29 Getting PEBS to work Brendan Gregg
[not found] ` <CAPAnC4PsdkN=9NQ6D_n2p6NX64yB0ASXhTqQRsGw5N3Jvr3d2A@mail.gmail.com>
2016-05-19 23:13 ` Brendan Gregg
[not found] ` <CAPAnC4PGktN_QYu9T6f5=p0cJ1wV59TWNcPYpskYDck=O=7faw@mail.gmail.com>
2016-05-20 0:09 ` Brendan Gregg
[not found] ` <CAPAnC4NObR7Fe-fZr9z5tdD0cyyVhd6WojN-aWst2Z2rtxQ6SQ@mail.gmail.com>
2016-05-20 0:19 ` Brendan Gregg
2016-05-20 0:47 ` Vince Weaver
2016-05-20 1:06 ` Brendan Gregg
2016-05-23 14:05 ` Arnaldo Carvalho de Melo
2016-05-24 10:17 ` Peter Zijlstra
2016-05-24 12:19 ` Arnaldo Carvalho de Melo [this message]
2016-05-24 14:02 ` Andi Kleen
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=20160524121957.GO8897@kernel.org \
--to=acme@kernel.org \
--cc=brendan.d.gregg@gmail.com \
--cc=jim.mauro@gmail.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=vincent.weaver@maine.edu \
/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).