ARM: tegra: trimslice: add gpio-poweroff node to DT
[linux-2.6/btrfs-unstable.git] / tools / perf / util / pmu.y
blobec898047ebb92869a6487405ec0de525b0d4acde
2 %name-prefix "perf_pmu_"
3 %parse-param {struct list_head *format}
4 %parse-param {char *name}
6 %{
8 #include <linux/compiler.h>
9 #include <linux/list.h>
10 #include <linux/bitmap.h>
11 #include <string.h>
12 #include "pmu.h"
14 extern int perf_pmu_lex (void);
16 #define ABORT_ON(val) \
17 do { \
18 if (val) \
19 YYABORT; \
20 } while (0)
24 %token PP_CONFIG PP_CONFIG1 PP_CONFIG2
25 %token PP_VALUE PP_ERROR
26 %type <num> PP_VALUE
27 %type <bits> bit_term
28 %type <bits> bits
30 %union
32 unsigned long num;
33 DECLARE_BITMAP(bits, PERF_PMU_FORMAT_BITS);
38 format:
39 format format_term
41 format_term
43 format_term:
44 PP_CONFIG ':' bits
46 ABORT_ON(perf_pmu__new_format(format, name,
47 PERF_PMU_FORMAT_VALUE_CONFIG,
48 $3));
51 PP_CONFIG1 ':' bits
53 ABORT_ON(perf_pmu__new_format(format, name,
54 PERF_PMU_FORMAT_VALUE_CONFIG1,
55 $3));
58 PP_CONFIG2 ':' bits
60 ABORT_ON(perf_pmu__new_format(format, name,
61 PERF_PMU_FORMAT_VALUE_CONFIG2,
62 $3));
65 bits:
66 bits ',' bit_term
68 bitmap_or($$, $1, $3, 64);
71 bit_term
73 memcpy($$, $1, sizeof($1));
76 bit_term:
77 PP_VALUE '-' PP_VALUE
79 perf_pmu__set_format($$, $1, $3);
82 PP_VALUE
84 perf_pmu__set_format($$, $1, 0);
89 void perf_pmu_error(struct list_head *list __maybe_unused,
90 char *name __maybe_unused,
91 char const *msg __maybe_unused)