perf: Adding sysfs group format attribute for pmu device
authorJiri Olsa <jolsa@redhat.com>
Thu, 15 Mar 2012 19:09:14 +0000 (20:09 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 16 Mar 2012 17:06:06 +0000 (14:06 -0300)
commit641cc938815dfd09f8fa1ec72deb814f0938ac33
tree8ced57a6b2d427bd34dcc30d3aebba3e0af45bb3
parent4a3d2d9bfb3b594b6e1f2b7eabfaf4e820a18c0e
perf: Adding sysfs group format attribute for pmu device

Adding sysfs group 'format' attribute for pmu device that
contains a syntax description on how to construct raw events.

The event configuration is described in following
struct pefr_event_attr attributes:

  config
  config1
  config2

Each sysfs attribute within the format attribute group,
describes mapping of name and bitfield definition within
one of above attributes.

eg:
  "/sys/...<dev>/format/event" contains "config:0-7"
  "/sys/...<dev>/format/umask" contains "config:8-15"
  "/sys/...<dev>/format/usr"   contains "config:16"

the attribute value syntax is:

  line:      config ':' bits
  config:    'config' | 'config1' | 'config2"
  bits:      bits ',' bit_term | bit_term
  bit_term:  VALUE '-' VALUE | VALUE

Adding format attribute definitions for x86 cpu pmus.

Acked-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/n/tip-vhdk5y2hyype9j63prymty36@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Documentation/ABI/testing/sysfs-bus-event_source-devices-format [new file with mode: 0644]
arch/x86/kernel/cpu/perf_event.c
arch/x86/kernel/cpu/perf_event.h
arch/x86/kernel/cpu/perf_event_amd.c
arch/x86/kernel/cpu/perf_event_intel.c
arch/x86/kernel/cpu/perf_event_p6.c
include/linux/perf_event.h