diff options
author | Jiri Olsa <jolsa@redhat.com> | 2012-04-25 12:24:57 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-05-18 11:15:32 -0400 |
commit | 16fa7e8200fb9066b77a3f27cbed8e4a9fc71998 (patch) | |
tree | d1454e844fe5b40389970995830f6eaabbe51c86 /tools/perf/util/parse-events.h | |
parent | a0187060f4ab68cf1aa533446b906cae5b14eb48 (diff) |
perf tools: Split term type into value type and term type
Introducing type_val and type_term for term instead of a single type
value. Currently the term type marked out the value type as well.
With this change we can have future string term values being specified
by user and translated into proper number along the processing.
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Robert Richter <robert.richter@amd.com>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1335371102-11358-2-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/parse-events.h')
-rw-r--r-- | tools/perf/util/parse-events.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h index 5cb002894a17..3fddd610d350 100644 --- a/tools/perf/util/parse-events.h +++ b/tools/perf/util/parse-events.h | |||
@@ -36,16 +36,17 @@ extern int parse_filter(const struct option *opt, const char *str, int unset); | |||
36 | #define EVENTS_HELP_MAX (128*1024) | 36 | #define EVENTS_HELP_MAX (128*1024) |
37 | 37 | ||
38 | enum { | 38 | enum { |
39 | PARSE_EVENTS__TERM_TYPE_NUM, | ||
40 | PARSE_EVENTS__TERM_TYPE_STR, | ||
41 | }; | ||
42 | |||
43 | enum { | ||
44 | PARSE_EVENTS__TERM_TYPE_USER, | ||
39 | PARSE_EVENTS__TERM_TYPE_CONFIG, | 45 | PARSE_EVENTS__TERM_TYPE_CONFIG, |
40 | PARSE_EVENTS__TERM_TYPE_CONFIG1, | 46 | PARSE_EVENTS__TERM_TYPE_CONFIG1, |
41 | PARSE_EVENTS__TERM_TYPE_CONFIG2, | 47 | PARSE_EVENTS__TERM_TYPE_CONFIG2, |
42 | PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD, | 48 | PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD, |
43 | PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE, | 49 | PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE, |
44 | PARSE_EVENTS__TERM_TYPE_NUM, | ||
45 | PARSE_EVENTS__TERM_TYPE_STR, | ||
46 | |||
47 | PARSE_EVENTS__TERM_TYPE_HARDCODED_MAX = | ||
48 | PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE, | ||
49 | }; | 50 | }; |
50 | 51 | ||
51 | struct parse_events__term { | 52 | struct parse_events__term { |
@@ -54,14 +55,16 @@ struct parse_events__term { | |||
54 | char *str; | 55 | char *str; |
55 | long num; | 56 | long num; |
56 | } val; | 57 | } val; |
57 | int type; | 58 | int type_val; |
58 | 59 | int type_term; | |
59 | struct list_head list; | 60 | struct list_head list; |
60 | }; | 61 | }; |
61 | 62 | ||
62 | int parse_events__is_hardcoded_term(struct parse_events__term *term); | 63 | int parse_events__is_hardcoded_term(struct parse_events__term *term); |
63 | int parse_events__new_term(struct parse_events__term **term, int type, | 64 | int parse_events__term_num(struct parse_events__term **_term, |
64 | char *config, char *str, long num); | 65 | int type_term, char *config, long num); |
66 | int parse_events__term_str(struct parse_events__term **_term, | ||
67 | int type_term, char *config, char *str); | ||
65 | void parse_events__free_terms(struct list_head *terms); | 68 | void parse_events__free_terms(struct list_head *terms); |
66 | int parse_events_modifier(struct list_head *list __used, char *str __used); | 69 | int parse_events_modifier(struct list_head *list __used, char *str __used); |
67 | int parse_events_add_tracepoint(struct list_head *list, int *idx, | 70 | int parse_events_add_tracepoint(struct list_head *list, int *idx, |