All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] perf tools: unify event type description
@ 2009-12-29  8:37 Liming Wang
  2009-12-29  8:37 ` [PATCH 2/3] perf tools: remove pid option from stat Liming Wang
  2009-12-30 12:22 ` [tip:perf/core] perf tools: Unify event type description tip-bot for Liming Wang
  0 siblings, 2 replies; 11+ messages in thread
From: Liming Wang @ 2009-12-29  8:37 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Frederic Weisbecker, Masami Hiramatsu, Paul Mackerras,
	Thomas Gleixner, Peter Zijlstra, linux-kernel, Liming Wang

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>
---
 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 e5bc0fb..dc585a8 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,
 }
 
 static const char * const event_type_descriptors[] = {
-	"",
 	"Hardware event",
 	"Software event",
 	"Tracepoint event",
 	"Hardware cache event",
+	"Raw hardware event descriptor",
+	"Hardware breakpoint",
 };
 
 /*
@@ -872,7 +873,7 @@ static void print_tracepoint_events(void)
 			snprintf(evt_path, MAXPATHLEN, "%s:%s",
 				 sys_dirent.d_name, evt_dirent.d_name);
 			printf("  %-42s [%s]\n", evt_path,
-				event_type_descriptors[PERF_TYPE_TRACEPOINT+1]);
+				event_type_descriptors[PERF_TYPE_TRACEPOINT]);
 		}
 		closedir(evt_dir);
 	}
@@ -892,9 +893,7 @@ void print_events(void)
 	printf("List of pre-defined events (to be used in -e):\n");
 
 	for (i = 0; i < ARRAY_SIZE(event_symbols); i++, syms++) {
-		type = syms->type + 1;
-		if (type >= ARRAY_SIZE(event_type_descriptors))
-			type = 0;
+		type = syms->type;
 
 		if (type != prev_type)
 			printf("\n");
@@ -919,17 +918,19 @@ void print_events(void)
 			for (i = 0; i < PERF_COUNT_HW_CACHE_RESULT_MAX; i++) {
 				printf("  %-42s [%s]\n",
 					event_cache_name(type, op, i),
-					event_type_descriptors[4]);
+					event_type_descriptors[PERF_TYPE_HW_CACHE]);
 			}
 		}
 	}
 
 	printf("\n");
-	printf("  %-42s [raw hardware event descriptor]\n",
-		"rNNN");
+	printf("  %-42s [%s]\n",
+		"rNNN", event_type_descriptors[PERF_TYPE_RAW]);
 	printf("\n");
 
-	printf("  %-42s [hardware breakpoint]\n", "mem:<addr>[:access]");
+	printf("  %-42s [%s]\n",
+			"mem:<addr>[:access]",
+			event_type_descriptors[PERF_TYPE_BREAKPOINT]);
 	printf("\n");
 
 	print_tracepoint_events();
-- 
1.6.0.3


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-01-13 10:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-29  8:37 [PATCH 1/3] perf tools: unify event type description Liming Wang
2009-12-29  8:37 ` [PATCH 2/3] perf tools: remove pid option from stat Liming Wang
2009-12-29  8:37   ` [PATCH 3/3] perf probe: change CONFIG_KPROBE_TRACER to CONFIG_KPROBE_EVENT Liming Wang
2009-12-30  2:32     ` Masami Hiramatsu
2009-12-30 12:23     ` [tip:perf/core] perf probe: Change " tip-bot for Liming Wang
2009-12-29 12:04   ` [PATCH 2/3] perf tools: remove pid option from stat Peter Zijlstra
2009-12-30  9:23     ` Ingo Molnar
2009-12-30  9:29       ` Wang Liming
2009-12-31  8:05       ` [PATCH 1/1] perf tools: fix pid option for stat Liming Wang
2010-01-13 10:31         ` [tip:perf/core] perf tools: Fix --pid " tip-bot for Liming Wang
2009-12-30 12:22 ` [tip:perf/core] perf tools: Unify event type description tip-bot for Liming Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.