From: Ingo Molnar <mingo@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "Andi Kleen" <andi@firstfloor.org>,
"Vince Weaver" <vince@deater.net>,
"Andi Kleen" <ak@linux.intel.com>,
acme@infradead.org, linux-kernel@vger.kernel.org,
"Stephane Eranian" <eranian@google.com>,
torvalds@linux-foundation.org, trinity@vger.kernel.org,
"Thomas Gleixner" <tglx@linutronix.de>,
"Frédéric Weisbecker" <fweisbec@gmail.com>,
"Jiri Olsa" <jolsa@redhat.com>,
"Namhyung Kim" <namhyung@gmail.com>
Subject: Re: [PATCH 1/2] tools, perf: Add a precise event qualifier v2
Date: Fri, 13 Sep 2013 11:50:57 +0200 [thread overview]
Message-ID: <20130913095057.GB11611@gmail.com> (raw)
In-Reply-To: <20130913085654.GI31370@twins.programming.kicks-ass.net>
* Peter Zijlstra <peterz@infradead.org> wrote:
> On Thu, Sep 12, 2013 at 07:36:17PM +0200, Andi Kleen wrote:
> > > Your feature to export 'precise' requirements on events looks useful to
> > > me. We could implement it not by special casing it implicitly but by
> > > saying that if ../format/precise contains something like:
> > >
> > > attr:240-241
>
> Since we currently have the pattern $name:bits to mean
> perf_event_attr::$name the above would imply and create a possible
> collision with perf_event_attr::attr.
>
> If we're going to do this I'd propose using something like _:240-241,
> for while '_' is a valid name in C its not something we're ever going to
> allow in perf_event_attr.
Ok - and I'm not against adding individual 'names' one by one as well,
that allows us to expose only the fields that relate to event
configuration.
For example if we added 'type' as well we could expose the generic,
hardware-independent events via sysfs as well.
( Eventually this scheme would be fit to expose more advanced events as
well: such as composite groups of events with simple arithmetic
operations between them. That would allow the exposure of E1+E2-E3 type
of simple calculations. )
> > Wouldn't we need different bits for each architecture then?
> > 32bit/64bit, some archs with weird alignment rules, maybe different
> > for BE/LE too?
>
> Typically PMU drivers are per arch and all the format stuff is per pmu
> driver so I'd not worry about that just yet.
ok.
> But yes, while the perf_event_attr thing is ABI its not identical across
> archs.
Yeah, like syscalls - it's not an on-disk format.
> > Ok I suppose it could be somehow auto generated in asm-offsets.c,
> > although I'm not sure how to get a bitfield offset there.
>
> Yes, that is an unfortunate situation. I (and either Acme or Jolsa)
> tried wrapping the bitfield in an anonymous union to create a named
> variable for the entire u64 but older GCC completely fails with that.
We could be careful with bitfields and enumerate their offsets explicitly,
with a build time testcase that makes sure that the offsets match reality.
Thanks,
Ingo
next prev parent reply other threads:[~2013-09-13 9:50 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1374501138-13496-1-git-send-email-andi@firstfloor.org>
[not found] ` <alpine.DEB.2.02.1307230137160.18617@pianoman.cluster.toy>
[not found] ` <20130723060108.GA18396@tassilo.jf.intel.com>
2013-07-23 21:27 ` [PATCH 1/2] tools, perf: Add a precise event qualifier v2 Vince Weaver
2013-07-23 22:51 ` Andi Kleen
2013-07-24 0:39 ` Sasha Levin
2013-07-24 1:33 ` Andi Kleen
2013-07-24 18:31 ` Vince Weaver
2013-07-24 18:54 ` Vince Weaver
2013-07-24 18:47 ` Vince Weaver
2013-07-24 19:05 ` Andi Kleen
2013-07-26 3:58 ` Vince Weaver
2013-09-12 16:57 ` Ingo Molnar
2013-09-12 17:36 ` Andi Kleen
2013-09-12 17:59 ` Ingo Molnar
2013-09-13 8:56 ` Peter Zijlstra
2013-09-13 9:50 ` Ingo Molnar [this message]
2013-09-13 11:29 ` Peter Zijlstra
2013-09-13 14:31 ` Vince Weaver
2013-09-13 17:48 ` Andi Kleen
2013-09-12 19:35 ` Vince Weaver
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=20130913095057.GB11611@gmail.com \
--to=mingo@kernel.org \
--cc=acme@infradead.org \
--cc=ak@linux.intel.com \
--cc=andi@firstfloor.org \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=namhyung@gmail.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=trinity@vger.kernel.org \
--cc=vince@deater.net \
/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