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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 23 Mar 2011 11:36:56 +0800
From:	Lin Ming <ming.m.lin@...el.com>
To:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc:	mingo@...e.hu, Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	LKML <linux-kernel@...r.kernel.org>,
	Paul Mackerras <paulus@...ba.org>,
	Stephane Eranian <eranian@...gle.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Hitoshi Mitake <mitake@....info.waseda.ac.jp>
Subject: [RFC] perf: EBNF for event syntax

Hi, all

On Thu, Mar 17, 2011 at 2:02 AM, Peter Zijlstra <a.p.zijlstra@...llo.nl> wrote:
> How about we start writing proper EBNF syntax rules for this stuff, its
> getting seriously out of hand.
http://marc.info/?l=linux-kernel&m=130029871318866&w=2

As Peter suggested, I wrote a simple EBNF for event syntax, as below.
My first plan is to pass in extra config value for some events,
for example, offcore response and load latency.

perf record -e r100b(0004):p

As above, the extra config value 0004 is passed in the parentheses.

The EBNF
========

EventList		:=	Event [',' EventList]
Event			:= 	HardwareEvent 		|
				RawEvent		|
				SoftwareEvent		|
				TracepointEvent		|
				HardwareBreakpointEvent

HardwareEvent		:=	HardwareEventName [ExtraConfig] [Modifer]
HardwareEventName	:=	'cpu-cycles' | 'cycles' | 'instructions' /* and so on ...*/
ExtraConfig		:=	'(' ConfigValue [',' ConfigValue] ')'
ConfigValue		:=	HexNumber

RawEvent		:=	RawSeperator RawCode [ExtraConfig] [Modifer]
RawSeperator		:=	'r'
RawCode			:=	HexNumber

SoftwareEvent		:=	SoftwareEventName
SoftwareEventName	:=	'cpu-clock' | 'task-clock' | 'faults' /* and so on ...*/

TracepointEvent		:=	SubsystemName ':' TracepointName
SubsystemName		:=	/* All AsciiString except the pre-defined hardware/software/cache events name and BreakpointSeparator */
TracepointName		:=	'*' | AsciiString

HardwareBreakpointEvent	:=	BreakpointSeparator BreakpointAddress [':' AccessType]
BreakpointSeparator	:=	'mem:'
BreakpointAddress	:=	HexNumber
AccessType		:=	'r' | 'w' | 'x'

Modifier		:= 	ModifierSperator ModifierList
ModifierSperator	:= 	':'
ModifierList		:= 	ModifierItem ModifierList
ModifierItem		:= 	{PreciseModifer} | kernelModifer | UserModifer | HypervisorModifer
PreciseModifer		:= 	'p' /* Can be multiple PreciseModifers */
kernelModifer		:= 	'k'
UserModifer		:= 	'u'
HypervisorModifer	:= 	'h'


Some valid examples
===================
Hardware events with modifiers,
cycles:pk,instructions:u

Raw event with extra config values and/or modifiers,
r0110(40A0):pu
r0110(40A0,40A1):k

Software event,
cpu-clock,faults

Hardware breakpoint events:
mem:400346
mem:800A03:w

Some invalid examples
=====================
r0110(40A0,40A1,40A2), invalid, only 2 extra config values are allowed
cpu-clock:p, invalid, software event does not have precise modifier


Any comments?

Thanks,
Lin Ming


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