Merge branch 'for-2.6.32' into mxc
[pandora-kernel.git] / tools / perf / builtin-top.c
index be1698f..5352b5e 100644 (file)
@@ -54,7 +54,7 @@ static int                    system_wide                     =  0;
 
 static int                     default_interval                = 100000;
 
-static __u64                   count_filter                    =  5;
+static u64                     count_filter                    =  5;
 static int                     print_entries                   = 15;
 
 static int                     target_pid                      = -1;
@@ -79,8 +79,8 @@ static int                    dump_symtab;
  * Symbols
  */
 
-static uint64_t                        min_ip;
-static uint64_t                        max_ip = -1ll;
+static u64                     min_ip;
+static u64                     max_ip = -1ll;
 
 struct sym_entry {
        struct rb_node          rb_node;
@@ -194,7 +194,7 @@ static void print_sym_table(void)
                100.0 - (100.0*((samples_per_sec-ksamples_per_sec)/samples_per_sec)));
 
        if (nr_counters == 1) {
-               printf("%Ld", attrs[0].sample_period);
+               printf("%Ld", (u64)attrs[0].sample_period);
                if (freq)
                        printf("Hz ");
                else
@@ -248,13 +248,16 @@ static void print_sym_table(void)
                                         sum_ksamples));
 
                /*
-                * We color high-overhead entries in red, low-overhead
-                * entries in green - and keep the middle ground normal:
+                * We color high-overhead entries in red, mid-overhead
+                * entries in green - and keep the low overhead places
+                * normal:
                 */
-               if (pcnt >= 5.0)
+               if (pcnt >= 5.0) {
                        color = PERF_COLOR_RED;
-               if (pcnt < 0.5)
-                       color = PERF_COLOR_GREEN;
+               } else {
+                       if (pcnt >= 0.5)
+                               color = PERF_COLOR_GREEN;
+               }
 
                if (nr_counters == 1)
                        printf("%20.2f - ", syme->weight);
@@ -369,7 +372,7 @@ out_delete_dso:
 /*
  * Binary search in the histogram table and record the hit:
  */
-static void record_ip(uint64_t ip, int counter)
+static void record_ip(u64 ip, int counter)
 {
        struct symbol *sym = dso__find_symbol(kernel_dso, ip);
 
@@ -389,7 +392,7 @@ static void record_ip(uint64_t ip, int counter)
        samples--;
 }
 
-static void process_event(uint64_t ip, int counter)
+static void process_event(u64 ip, int counter)
 {
        samples++;
 
@@ -460,15 +463,15 @@ static void mmap_read_counter(struct mmap_data *md)
        for (; old != head;) {
                struct ip_event {
                        struct perf_event_header header;
-                       __u64 ip;
-                       __u32 pid, target_pid;
+                       u64 ip;
+                       u32 pid, target_pid;
                };
                struct mmap_event {
                        struct perf_event_header header;
-                       __u32 pid, target_pid;
-                       __u64 start;
-                       __u64 len;
-                       __u64 pgoff;
+                       u32 pid, target_pid;
+                       u64 start;
+                       u64 len;
+                       u64 pgoff;
                        char filename[PATH_MAX];
                };
 
@@ -559,13 +562,13 @@ try_again:
                 * is always available even if no PMU support:
                 */
                if (attr->type == PERF_TYPE_HARDWARE
-                       && attr->config == PERF_COUNT_CPU_CYCLES) {
+                       && attr->config == PERF_COUNT_HW_CPU_CYCLES) {
 
                        if (verbose)
                                warning(" ... trying to fall back to cpu-clock-ticks\n");
 
                        attr->type = PERF_TYPE_SOFTWARE;
-                       attr->config = PERF_COUNT_CPU_CLOCK;
+                       attr->config = PERF_COUNT_SW_CPU_CLOCK;
                        goto try_again;
                }
                printf("\n");