lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130913085654.GI31370@twins.programming.kicks-ass.net>
Date:	Fri, 13 Sep 2013 10:56:54 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Andi Kleen <andi@...stfloor.org>
Cc:	Ingo Molnar <mingo@...nel.org>, Vince Weaver <vince@...ter.net>,
	Andi Kleen <ak@...ux.intel.com>, acme@...radead.org,
	linux-kernel@...r.kernel.org,
	Stephane Eranian <eranian@...gle.com>,
	torvalds@...ux-foundation.org, trinity@...r.kernel.org,
	Thomas Gleixner <tglx@...utronix.de>,
	Frédéric Weisbecker <fweisbec@...il.com>,
	Jiri Olsa <jolsa@...hat.com>, Namhyung Kim <namhyung@...il.com>
Subject: Re: [PATCH 1/2] tools, perf: Add a precise event qualifier v2

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.

> > then that's a natural extension of the config:X-Y format and should be 
> > interpreted to mean mean 2 bits in the perf attr field. I.e. we could go 
> > beyond the config bitfield.
> > 
> > Basically the whole perf_event_attr can be thought of as a 'giant 
> > bitfield', in which we can specify values to export an enumerated list of 
> > events from the kernel to tooling.
> > 
> > (Using attr:X-Y the config and config1 variants can be expressed as well, 
> > as the config fields are inside the attr structure.)
> > 
> > The positions within the perf_attr are an ABI, so this would work pretty 
> > well.
> 
> 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.

But yes, while the perf_event_attr thing is ABI its not identical across
archs.

> 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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ