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: <20100709030846.GN7771@brick.ozlabs.ibm.com>
Date:	Fri, 9 Jul 2010 13:08:46 +1000
From:	Paul Mackerras <paulus@...ba.org>
To:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc:	stephane eranian <eranian@...glemail.com>,
	Robert Richter <robert.richter@....com>,
	Will Deacon <will.deacon@....com>,
	Paul Mundt <lethal@...ux-sh.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Cyrill Gorcunov <gorcunov@...il.com>,
	Lin Ming <ming.m.lin@...el.com>,
	Yanmin <yanmin_zhang@...ux.intel.com>,
	Deng-Cheng Zhu <dengcheng.zhu@...il.com>,
	David Miller <davem@...emloft.net>,
	linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCH 05/11] perf: register pmu implementations

On Thu, Jun 24, 2010 at 04:28:09PM +0200, Peter Zijlstra wrote:

> Simple registration interface for struct pmu, this provides the
> infrastructure for removing all the weak functions.

Seems to work on powerpc, but the sh bits don't seem quite right:

> Index: linux-2.6/arch/sh/kernel/perf_event.c
> ===================================================================
> --- linux-2.6.orig/arch/sh/kernel/perf_event.c
> +++ linux-2.6/arch/sh/kernel/perf_event.c
> @@ -257,24 +257,24 @@ static void sh_pmu_read(struct perf_even
>  	sh_perf_event_update(event, &event->hw, event->hw.idx);
>  }
>  
> -static struct pmu pmu = {
> -	.enable		= sh_pmu_enable,
> -	.disable	= sh_pmu_disable,
> -	.read		= sh_pmu_read,
> -};
> -
> -struct pmu *hw_perf_event_init(struct perf_event *event)
> +static in sh_pmu_event_init(struct perf_event *event)

int?

>  {
>  	int err = __hw_perf_event_init(event);

We need a switch on event->attr.type so we return -ENOENT if it's
not PERF_TYPE_{HARDWARE,HW_CACHE,RAW}.  As it is we don't ever return
-ENOENT, which might stop software and tracepoint events from working.

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