diff options
author | Jiri Olsa <jolsa@redhat.com> | 2012-03-15 15:09:14 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-03-16 13:06:06 -0400 |
commit | 641cc938815dfd09f8fa1ec72deb814f0938ac33 (patch) | |
tree | 8ced57a6b2d427bd34dcc30d3aebba3e0af45bb3 /arch/x86/kernel/cpu/perf_event_amd.c | |
parent | 4a3d2d9bfb3b594b6e1f2b7eabfaf4e820a18c0e (diff) |
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>
Diffstat (limited to 'arch/x86/kernel/cpu/perf_event_amd.c')
-rw-r--r-- | arch/x86/kernel/cpu/perf_event_amd.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_amd.c b/arch/x86/kernel/cpu/perf_event_amd.c index dd002faff7a6..95e7fe1c5f0b 100644 --- a/arch/x86/kernel/cpu/perf_event_amd.c +++ b/arch/x86/kernel/cpu/perf_event_amd.c | |||
@@ -404,6 +404,21 @@ static void amd_pmu_cpu_dead(int cpu) | |||
404 | } | 404 | } |
405 | } | 405 | } |
406 | 406 | ||
407 | PMU_FORMAT_ATTR(event, "config:0-7,32-35"); | ||
408 | PMU_FORMAT_ATTR(umask, "config:8-15" ); | ||
409 | PMU_FORMAT_ATTR(edge, "config:18" ); | ||
410 | PMU_FORMAT_ATTR(inv, "config:23" ); | ||
411 | PMU_FORMAT_ATTR(cmask, "config:24-31" ); | ||
412 | |||
413 | static struct attribute *amd_format_attr[] = { | ||
414 | &format_attr_event.attr, | ||
415 | &format_attr_umask.attr, | ||
416 | &format_attr_edge.attr, | ||
417 | &format_attr_inv.attr, | ||
418 | &format_attr_cmask.attr, | ||
419 | NULL, | ||
420 | }; | ||
421 | |||
407 | static __initconst const struct x86_pmu amd_pmu = { | 422 | static __initconst const struct x86_pmu amd_pmu = { |
408 | .name = "AMD", | 423 | .name = "AMD", |
409 | .handle_irq = x86_pmu_handle_irq, | 424 | .handle_irq = x86_pmu_handle_irq, |
@@ -426,6 +441,8 @@ static __initconst const struct x86_pmu amd_pmu = { | |||
426 | .get_event_constraints = amd_get_event_constraints, | 441 | .get_event_constraints = amd_get_event_constraints, |
427 | .put_event_constraints = amd_put_event_constraints, | 442 | .put_event_constraints = amd_put_event_constraints, |
428 | 443 | ||
444 | .format_attrs = amd_format_attr, | ||
445 | |||
429 | .cpu_prepare = amd_pmu_cpu_prepare, | 446 | .cpu_prepare = amd_pmu_cpu_prepare, |
430 | .cpu_starting = amd_pmu_cpu_starting, | 447 | .cpu_starting = amd_pmu_cpu_starting, |
431 | .cpu_dead = amd_pmu_cpu_dead, | 448 | .cpu_dead = amd_pmu_cpu_dead, |
@@ -596,6 +613,7 @@ static __initconst const struct x86_pmu amd_pmu_f15h = { | |||
596 | .cpu_dead = amd_pmu_cpu_dead, | 613 | .cpu_dead = amd_pmu_cpu_dead, |
597 | #endif | 614 | #endif |
598 | .cpu_starting = amd_pmu_cpu_starting, | 615 | .cpu_starting = amd_pmu_cpu_starting, |
616 | .format_attrs = amd_format_attr, | ||
599 | }; | 617 | }; |
600 | 618 | ||
601 | __init int amd_pmu_init(void) | 619 | __init int amd_pmu_init(void) |