All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>, acme@redhat.com
Cc: mingo@elte.hu, paulus@samba.org, cjashfor@linux.vnet.ibm.com,
	linux-kernel@vger.kernel.org
Subject: new syntax for perf event
Date: Wed, 21 Dec 2011 17:16:13 +0100	[thread overview]
Message-ID: <20111221161613.GA1659@m.brq.redhat.com> (raw)
In-Reply-To: <1324381161.24621.53.camel@twins>

On Tue, Dec 20, 2011 at 12:39:21PM +0100, Peter Zijlstra wrote:
> On Tue, 2011-12-20 at 12:30 +0100, Peter Zijlstra wrote:
> > event   config-0:7
> > umask   config-8:15
> > usr     config-16
> > os      config-17
> > edge    config-18
> > any     config-21
> > inv     config-23
> > cmask   config-24:31
> > 
> > nhm-dmnd_data_rd        config1-0
> > nhm-dmnd_rfo            config1-1
> > nhm-dmnd_ifetch         config1-2
> > ...
> > 
> > (the real syntax will likely be a little more complex in order to be
> > able to express the various other architectures their raw input format). 
> 
> for instance AMD would need:
> 
> event	config-0:7,32-35
> guest	config-40
> host	config-41
> 
> (assuming you read that as a mask from LSB to MSB)
> 
> And I still haven't actually read how the P4 works so I can't help out
> there.


ok first try ;) description + grammar attached

- event has a general format:
        pmu/event_def[:modifier] [ ',' pmu/event_def[:modifier] ] ...

  where event_def depends on the chosen pmu:
        'cpu' 'tracepoint' 'breakpoint'


- to keep some of the old interface, symbolic and cache events stays,
  since they are recognizable by keywords (event_symbol, event_cache)


- raw events are defined with the help of event keywords like:
        cpu/raw,config=1,config1=0,config2=0
        cpu/hw,config=1,config1=0

  * first symbol after '/' defines the type: raw/hw/cache
    which match PERF_TYPE_RAW/PERF_TYPE_HARDWARE/PERF_TYPE_HW_CACHE

  * the rest consists assignments for 'config/config1/config1' keywords
    that match with the perf_event_attr:config/config1/config values
    (possibly extended once we have sysfs events representation)


- tracepoint events are defined like:
        tracepoint/system:tracepoint

  where tracepoint could contain '*?'


- breakpoint events are defined like:
        breakpoint/addr:type


- each event could be followed by modifier definition


- I think pmu names should match registered pmu names,
  but we could make some shortcuts so we dont need to type 'tracepoint/',
  but just 'tp/' or smth..


- as for tracepoints it looks like the old format does not clash with the new one
  and we could add shortcut (omit the 'tracepoint/') like:
      event: event_tracepoint


- not sure I should include 'software' pmu, as it seems to covered by
  event_symbol events


thanks for comments,
jirka



grammar
-------
events:
                event_mod ',' event_mod | event_mod

event_mod:
                event | event ':' modifier

event:
                event_symbol |
                event_cache |
                'cpu' '/' event_cpu |
                'tracepoint' '/' event_tracepoint
                'breakpoint' '/' event_breakpoint

event_symbol:
                cpu-cycles|cycles
                stalled-cycles-frontend|idle-cycles-frontend
                stalled-cycles-backend|idle-cycles-backend
                instructions
                cache-references
                cache-misses
                branch-instructions|branches
                branch-misses
                bus-cycles
                cpu-clock
                task-clock
                page-faults|faults
                minor-faults
                major-faults
                context-switches|cs
                cpu-migrations|migrations
                alignment-faults
                emulation-faults

event_cache:
                cache_type
                cache_type '-' cache_result_op
                cache_type '-' cache_result_op '-' cache_result_op

cache_type:
                L1-dcache|l1-d|l1d|L1-data
                L1-icache|l1-i|l1i|L1-instruction
                LLC|L2
                dTLB|d-tlb|Data-TLB
                iTLB|i-tlb|Instruction-TLB
                branch|branches|bpu|btb|bpc
                node

cache_result_op:
                load|loads|read
                store|stores|write
                prefetch|prefetches
                speculative-read|speculative-load
                refs|Reference|ops|access
                misses|miss

event_cpu:
                'raw'    ',' event_cpu_def
                'hw'     ',' event_cpu_def
                'cache'  ',' event_cpu_def

event_cpu_def:
                event_cpu_ass ',' event_cpu_ass |
                event_cpu_ass

event_cpu_ass:
                event_cpu_elem '=' value

event_cpu_elem:
                'config' | 'config1' | 'config2'

event_tracepoint:
                system ':' tracepoint

event_breakpoint:
                addr ':' type

modifier:
                [ukhp]{1,4}

  reply	other threads:[~2011-12-21 16:16 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-15 15:30 [RFC 0/3] perf tool: Add new event group management Jiri Olsa
2011-12-15 15:30 ` [PATCH 1/3] perf, tool: Add parser generator for events parsing Jiri Olsa
2011-12-16 14:02   ` Peter Zijlstra
2011-12-16 14:03     ` Peter Zijlstra
2011-12-20 10:31       ` Jiri Olsa
2011-12-20 10:47         ` Peter Zijlstra
2011-12-20 11:30           ` Peter Zijlstra
2011-12-20 11:39             ` Peter Zijlstra
2011-12-21 16:16               ` Jiri Olsa [this message]
2012-01-05  9:17                 ` new syntax for perf event Jiri Olsa
2012-01-05 14:10                 ` Peter Zijlstra
2012-01-09 15:28                   ` Jiri Olsa
2012-01-09 15:43                     ` Peter Zijlstra
2012-01-16 12:31                     ` [RFCv3 0/9] perf tool: parser generator for events parsing Jiri Olsa
2012-01-16 12:31                       ` [PATCH 1/9] perf, tool: Make perf_evlist__splice_list_tail global Jiri Olsa
2012-01-16 12:31                       ` [PATCH 2/9] perf, tool: Remove unused functions from debugfs object Jiri Olsa
2012-01-16 12:31                       ` [PATCH 3/9] perf, tool: Add sysfs mountpoint interface Jiri Olsa
2012-01-16 12:31                       ` [PATCH 4/9] perf, tool: Add bitmap_or function into bitmap object Jiri Olsa
2012-01-16 12:31                       ` [PATCH 5/9] perf: Add sysfs format attribute for pmu device Jiri Olsa
2012-01-23 15:13                         ` Eric W. Biederman
2012-01-23 15:33                           ` Jiri Olsa
2012-01-24 15:22                             ` Peter Zijlstra
2012-01-24 19:40                               ` Eric W. Biederman
2012-01-25  8:54                                 ` Jiri Olsa
2012-01-26 16:26                         ` Peter Zijlstra
2012-01-27 12:32                           ` Jiri Olsa
2012-01-16 12:31                       ` [PATCH 6/9] perf, tool: Add parser generator for events parsing Jiri Olsa
2012-01-24 16:02                         ` Peter Zijlstra
2012-01-25  8:42                           ` Jiri Olsa
2012-01-16 12:31                       ` [PATCH 7/9] perf, tool: Add config options support for event parsing Jiri Olsa
2012-01-16 12:31                       ` [PATCH 8/9] perf, tool: Add perf pmu object to access pmu format definition Jiri Olsa
2012-01-16 12:31                       ` [PATCH 9/9] perf, tool: Add support to specify pmu style event Jiri Olsa
2012-01-24 15:22                       ` [RFCv3 0/9] perf tool: parser generator for events parsing Peter Zijlstra
2012-01-24 16:26                       ` Peter Zijlstra
2012-01-25  0:53                         ` Greg KH
2012-01-25 10:49                           ` Peter Zijlstra
2012-01-25 14:37                             ` Jiri Olsa
2012-01-26 16:23                               ` Peter Zijlstra
2012-01-26 16:27                                 ` Greg KH
2012-01-25 17:01                             ` Greg KH
2012-01-27 14:34                       ` [PATCHv4 " Jiri Olsa
2012-01-27 14:34                         ` [PATCH 1/9] perf, tool: Make perf_evlist__splice_list_tail global Jiri Olsa
2012-02-07 19:31                           ` [tip:perf/core] perf evlist: Make splice_list_tail method public tip-bot for Jiri Olsa
2012-01-27 14:34                         ` [PATCH 2/9] perf, tool: Remove unused functions from debugfs object Jiri Olsa
2012-02-17  9:51                           ` [tip:perf/core] perf tools: " tip-bot for Jiri Olsa
2012-01-27 14:34                         ` [PATCH 3/9] perf, tool: Add sysfs mountpoint interface Jiri Olsa
2012-02-17  9:52                           ` [tip:perf/core] perf tools: " tip-bot for Jiri Olsa
2012-01-27 14:34                         ` [PATCH 4/9] perf, tool: Add bitmap_or function into bitmap object Jiri Olsa
2012-02-17  9:53                           ` [tip:perf/core] perf tools: " tip-bot for Jiri Olsa
2012-01-27 14:34                         ` [PATCH 5/9] perf: Adding sysfs group format attribute for pmu device Jiri Olsa
2012-01-27 21:08                           ` Corey Ashford
2012-01-27 21:19                             ` Peter Zijlstra
2012-02-01  0:47                               ` Corey Ashford
2012-01-30  9:52                             ` Jiri Olsa
2012-02-01  1:25                               ` Corey Ashford
2012-02-01 13:13                                 ` Jiri Olsa
2012-02-01 14:18                                   ` Peter Zijlstra
2012-02-01 14:31                                     ` Jiri Olsa
2012-02-01 14:40                                       ` Peter Zijlstra
2012-02-01 13:36                                 ` Peter Zijlstra
2012-02-02  0:33                                   ` Corey Ashford
2012-01-27 14:34                         ` [PATCH 6/9] perf, tool: Add parser generator for events parsing Jiri Olsa
2012-01-27 14:34                         ` [PATCH 7/9] perf, tool: Add config options support for event parsing Jiri Olsa
2012-01-27 14:34                         ` [PATCH 8/9] perf, tool: Add perf pmu object to access pmu format definition Jiri Olsa
2012-01-27 14:34                         ` [PATCH 9/9] perf, tool: Add support to specify pmu style event Jiri Olsa
2012-02-13 13:13                         ` [PATCHv4 0/9] perf tool: parser generator for events parsing Jiri Olsa
2012-02-14 16:28                         ` Peter Zijlstra
2012-02-14 16:43                           ` Peter Zijlstra
2012-02-14 20:20                             ` Peter Zijlstra
2012-02-14 20:57                               ` Peter Zijlstra
2012-02-14 21:03                                 ` Peter Zijlstra
2012-02-15  9:24                                   ` Jiri Olsa
2012-02-15 11:18                                     ` Peter Zijlstra
2012-02-15 13:32                                       ` Jiri Olsa
2012-02-15 13:39                                         ` Peter Zijlstra
2012-02-15  9:04                                 ` Jiri Olsa
2012-02-15 11:03                                   ` Peter Zijlstra
2011-12-22 19:32             ` [PATCH 1/3] perf, tool: Add " Vince Weaver
2011-12-19 14:37     ` Jiri Olsa
2011-12-20 10:29     ` [PATCHv2 0/2] perf tool: " Jiri Olsa
2011-12-20 10:29       ` [PATCHv2 1/2] perf, tool: Add " Jiri Olsa
2011-12-20 10:29       ` [PATCHv2 2/2] perf, tool: Add more automated tests for event parsing Jiri Olsa
2011-12-20 17:37   ` [PATCH 1/3] perf, tool: Add parser generator for events parsing Arnaldo Carvalho de Melo
2011-12-21  9:55     ` Jiri Olsa
2011-12-15 15:30 ` [PATCH 2/3] perf, tool: Add new event group management Jiri Olsa
2011-12-20 17:47   ` Arnaldo Carvalho de Melo
2011-12-20 21:20     ` Peter Zijlstra
2011-12-21 11:54       ` Arnaldo Carvalho de Melo
2011-12-15 15:30 ` [PATCH 3/3] perf, tool: Add more automated tests for event parsing Jiri Olsa
2011-12-20 17:38   ` Arnaldo Carvalho de Melo
2011-12-21  8:47   ` [tip:perf/core] perf test: " tip-bot for Jiri Olsa

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=20111221161613.GA1659@m.brq.redhat.com \
    --to=jolsa@redhat.com \
    --cc=acme@redhat.com \
    --cc=cjashfor@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.