diff options
Diffstat (limited to 'tools/perf/util/pmu.l')
-rw-r--r-- | tools/perf/util/pmu.l | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tools/perf/util/pmu.l b/tools/perf/util/pmu.l new file mode 100644 index 00000000000..a15d9fbd7c0 --- /dev/null +++ b/tools/perf/util/pmu.l | |||
@@ -0,0 +1,43 @@ | |||
1 | %option prefix="perf_pmu_" | ||
2 | |||
3 | %{ | ||
4 | #include <stdlib.h> | ||
5 | #include <linux/bitops.h> | ||
6 | #include "pmu.h" | ||
7 | #include "pmu-bison.h" | ||
8 | |||
9 | static int value(int base) | ||
10 | { | ||
11 | long num; | ||
12 | |||
13 | errno = 0; | ||
14 | num = strtoul(perf_pmu_text, NULL, base); | ||
15 | if (errno) | ||
16 | return PP_ERROR; | ||
17 | |||
18 | perf_pmu_lval.num = num; | ||
19 | return PP_VALUE; | ||
20 | } | ||
21 | |||
22 | %} | ||
23 | |||
24 | num_dec [0-9]+ | ||
25 | |||
26 | %% | ||
27 | |||
28 | {num_dec} { return value(10); } | ||
29 | config { return PP_CONFIG; } | ||
30 | config1 { return PP_CONFIG1; } | ||
31 | config2 { return PP_CONFIG2; } | ||
32 | - { return '-'; } | ||
33 | : { return ':'; } | ||
34 | , { return ','; } | ||
35 | . { ; } | ||
36 | \n { ; } | ||
37 | |||
38 | %% | ||
39 | |||
40 | int perf_pmu_wrap(void) | ||
41 | { | ||
42 | return 1; | ||
43 | } | ||