diff options
author | Liming Wang <liming.wang@windriver.com> | 2009-12-29 03:37:07 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-30 05:58:53 -0500 |
commit | 41bdcb23dab22bf27361c5f2d89fe895d8904915 (patch) | |
tree | 3fa8a4a152f60b35b339f5ce648dc12223d75410 /tools/perf/util/parse-events.c | |
parent | 9967411e5b324a908e344d6ce66b77bd5d372c3e (diff) |
perf tools: Unify event type description
make event type description to a unified array and
the array index consistent to perf_type_id.
Signed-off-by: Liming Wang <liming.wang@windriver.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <1262075829-16257-1-git-send-email-liming.wang@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/parse-events.c')
-rw-r--r-- | tools/perf/util/parse-events.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index e5bc0fb016b2..dc585a835cab 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
@@ -835,11 +835,12 @@ int parse_filter(const struct option *opt __used, const char *str, | |||
835 | } | 835 | } |
836 | 836 | ||
837 | static const char * const event_type_descriptors[] = { | 837 | static const char * const event_type_descriptors[] = { |
838 | "", | ||
839 | "Hardware event", | 838 | "Hardware event", |
840 | "Software event", | 839 | "Software event", |
841 | "Tracepoint event", | 840 | "Tracepoint event", |
842 | "Hardware cache event", | 841 | "Hardware cache event", |
842 | "Raw hardware event descriptor", | ||
843 | "Hardware breakpoint", | ||
843 | }; | 844 | }; |
844 | 845 | ||
845 | /* | 846 | /* |
@@ -872,7 +873,7 @@ static void print_tracepoint_events(void) | |||
872 | snprintf(evt_path, MAXPATHLEN, "%s:%s", | 873 | snprintf(evt_path, MAXPATHLEN, "%s:%s", |
873 | sys_dirent.d_name, evt_dirent.d_name); | 874 | sys_dirent.d_name, evt_dirent.d_name); |
874 | printf(" %-42s [%s]\n", evt_path, | 875 | printf(" %-42s [%s]\n", evt_path, |
875 | event_type_descriptors[PERF_TYPE_TRACEPOINT+1]); | 876 | event_type_descriptors[PERF_TYPE_TRACEPOINT]); |
876 | } | 877 | } |
877 | closedir(evt_dir); | 878 | closedir(evt_dir); |
878 | } | 879 | } |
@@ -892,9 +893,7 @@ void print_events(void) | |||
892 | printf("List of pre-defined events (to be used in -e):\n"); | 893 | printf("List of pre-defined events (to be used in -e):\n"); |
893 | 894 | ||
894 | for (i = 0; i < ARRAY_SIZE(event_symbols); i++, syms++) { | 895 | for (i = 0; i < ARRAY_SIZE(event_symbols); i++, syms++) { |
895 | type = syms->type + 1; | 896 | type = syms->type; |
896 | if (type >= ARRAY_SIZE(event_type_descriptors)) | ||
897 | type = 0; | ||
898 | 897 | ||
899 | if (type != prev_type) | 898 | if (type != prev_type) |
900 | printf("\n"); | 899 | printf("\n"); |
@@ -919,17 +918,19 @@ void print_events(void) | |||
919 | for (i = 0; i < PERF_COUNT_HW_CACHE_RESULT_MAX; i++) { | 918 | for (i = 0; i < PERF_COUNT_HW_CACHE_RESULT_MAX; i++) { |
920 | printf(" %-42s [%s]\n", | 919 | printf(" %-42s [%s]\n", |
921 | event_cache_name(type, op, i), | 920 | event_cache_name(type, op, i), |
922 | event_type_descriptors[4]); | 921 | event_type_descriptors[PERF_TYPE_HW_CACHE]); |
923 | } | 922 | } |
924 | } | 923 | } |
925 | } | 924 | } |
926 | 925 | ||
927 | printf("\n"); | 926 | printf("\n"); |
928 | printf(" %-42s [raw hardware event descriptor]\n", | 927 | printf(" %-42s [%s]\n", |
929 | "rNNN"); | 928 | "rNNN", event_type_descriptors[PERF_TYPE_RAW]); |
930 | printf("\n"); | 929 | printf("\n"); |
931 | 930 | ||
932 | printf(" %-42s [hardware breakpoint]\n", "mem:<addr>[:access]"); | 931 | printf(" %-42s [%s]\n", |
932 | "mem:<addr>[:access]", | ||
933 | event_type_descriptors[PERF_TYPE_BREAKPOINT]); | ||
933 | printf("\n"); | 934 | printf("\n"); |
934 | 935 | ||
935 | print_tracepoint_events(); | 936 | print_tracepoint_events(); |