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]
Date:	Wed, 10 Nov 2010 15:19:23 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Stephane Eranian <eranian@...gle.com>
Cc:	LKML <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...e.hu>,
	Lin Ming <ming.m.lin@...el.com>,
	"robert.richter" <robert.richter@....com>,
	Corey Ashford <cjashfor@...ux.vnet.ibm.com>,
	fweisbec <fweisbec@...il.com>, paulus <paulus@...ba.org>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	Kay Sievers <kay.sievers@...y.org>,
	"H. Peter Anvin" <hpa@...or.com>
Subject: Re: [RFC][PATCH] perf: sysfs type id

On Wed, 2010-11-10 at 15:10 +0100, Peter Zijlstra wrote:
> On Wed, 2010-11-10 at 14:01 +0100, Stephane Eranian wrote:
> > Peter,
> 
> > > 6
> > 
> > And then, what do you do with 6?
> > I assume you have to pass it in the attr struct.
> 
> perf_event_attr::type, as said in the initial changelog.
> 
> > How do you plan on doing this while keeping what is already there?
> 
> +       if (type < 0) {
> +               err = idr_get_new_above(&pmu_idr, pmu, PERF_TYPE_MAX, &type);
> 
> and
> 
> +       rcu_read_lock();
> +       pmu = idr_find(&pmu_idr, event->attr.type);
> +       rcu_read_unlock();
> +       if (pmu)
> +               goto unlock;
> 
> 
> So we start dynamic IDs at the top of the static range, and only do
> dynamic IDs for those that don't already have a static number.

Also note that I picked:

+       perf_pmu_register(&pmu, "cpu", PERF_TYPE_RAW);

as the CPU type, since we can easily provide the raw values in any
listed events, eg.

# cat /sys/.../cpu/events/cycles
0x003c


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