perf_counter tools: Reuse event_name() in kerneltop
authorWu Fengguang <fengguang.wu@intel.com>
Fri, 20 Mar 2009 02:08:05 +0000 (10:08 +0800)
committerIngo Molnar <mingo@elte.hu>
Mon, 6 Apr 2009 07:30:21 +0000 (09:30 +0200)
- can handle sw counters now
- the outputs will look slightly different

Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Documentation/perf_counter/kerneltop.c

index edc5b09fb586f9231cd04d8d8669e5c02ee3279e..cba5cb0a97f977b7e3566fc083332406ed3216dd 100644 (file)
 
 #include "perfcounters.h"
 
-const char *event_types [] = {
-       "CPU cycles",
-       "instructions",
-       "cache-refs",
-       "cache-misses",
-       "branches",
-       "branch-misses",
-       "bus cycles"
-};
-
 const unsigned int default_count[] = {
        1000000,
        1000000,
@@ -304,10 +294,7 @@ static void print_sym_table(void)
                if (counter)
                        printf("/");
 
-               if (event_id[counter] < PERF_HW_EVENTS_MAX)
-                       printf( "%s", event_types[event_id[counter]]);
-               else
-                       printf( "raw:%04lx", event_id[counter]);
+               printf("%s", event_name(counter));
        }
 
        printf( "], ");