public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Lin Ming <ming.m.lin@intel.com>
Cc: mingo@elte.hu, Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Paul Mackerras <paulus@samba.org>,
	Stephane Eranian <eranian@google.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>,
	Corey Ashford <cjashfor@linux.vnet.ibm.com>,
	Matt Fleming <matt@console-pimps.org>
Subject: Re: [RFC] perf: EBNF for event syntax
Date: Fri, 25 Mar 2011 12:07:57 +0100	[thread overview]
Message-ID: <1301051277.2250.195.camel@laptop> (raw)
In-Reply-To: <1300851416.31224.58.camel@minggr.sh.intel.com>

On Wed, 2011-03-23 at 11:36 +0800, Lin Ming wrote:
> Hi, all
> 
> On Thu, Mar 17, 2011 at 2:02 AM, Peter Zijlstra <a.p.zijlstra@chello.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]

There was a suggestion a while back to make:

 -e ev1,ev2,ev3

create an event group with ev2 and ev3 siblings of ev1, and have
multiple -e instances create separate counters.

The problem is that its not backwards compatible, but something like
that would still be very nice to have.

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

Otherwise, very nice. Eventually we'll be able to use a parser generator
for this.


  reply	other threads:[~2011-03-25 11:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-23  3:36 [RFC] perf: EBNF for event syntax Lin Ming
2011-03-25 11:07 ` Peter Zijlstra [this message]
2011-03-25 13:35   ` Lin Ming
2011-03-25 14:17     ` Peter Zijlstra
2011-03-26 20:48       ` Ulrich Drepper
2011-03-28  5:40   ` Masami Hiramatsu
2011-03-28  7:58     ` Peter Zijlstra
2011-03-28  8:52       ` Matt Fleming
2011-03-28 10:12       ` Masami Hiramatsu

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=1301051277.2250.195.camel@laptop \
    --to=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=cjashfor@linux.vnet.ibm.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=matt@console-pimps.org \
    --cc=ming.m.lin@intel.com \
    --cc=mingo@elte.hu \
    --cc=mitake@dcl.info.waseda.ac.jp \
    --cc=paulus@samba.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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