aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-06-11 08:16:15 -0400
committerIngo Molnar <mingo@elte.hu>2009-06-11 10:48:38 -0400
commit729ff5e2aaf181f5d3ab849337fce406cd19b1d9 (patch)
tree49591d8103f05bd157c083b9392ed7f4a8b3ae17 /tools/perf/builtin-report.c
parentdf58ab24bf26b166874bfb18b3b5a2e0a8e63179 (diff)
perf_counter tools: Clean up u64 usage
A build error slipped in: builtin-report.c: In function ‘hist_entry__fprintf’: builtin-report.c:711: error: format ‘%12d’ expects type ‘int’, but argument 3 has type ‘uint64_t’ Because we got a bit sloppy with those types. uint64_t really sucks, because there's no printf format for it. So standardize on __u64 instead - for all types that go to or come from the ABI (which is __u64), or for values that need to be large enough even on 32-bit. Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index f57fd5c5531a..82fa93b4db99 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -146,7 +146,7 @@ static void dsos__fprintf(FILE *fp)
146 dso__fprintf(pos, fp); 146 dso__fprintf(pos, fp);
147} 147}
148 148
149static struct symbol *vdso__find_symbol(struct dso *dso, uint64_t ip) 149static struct symbol *vdso__find_symbol(struct dso *dso, __u64 ip)
150{ 150{
151 return dso__find_symbol(kernel_dso, ip); 151 return dso__find_symbol(kernel_dso, ip);
152} 152}
@@ -193,19 +193,19 @@ static int strcommon(const char *pathname)
193 193
194struct map { 194struct map {
195 struct list_head node; 195 struct list_head node;
196 uint64_t start; 196 __u64 start;
197 uint64_t end; 197 __u64 end;
198 uint64_t pgoff; 198 __u64 pgoff;
199 uint64_t (*map_ip)(struct map *, uint64_t); 199 __u64 (*map_ip)(struct map *, __u64);
200 struct dso *dso; 200 struct dso *dso;
201}; 201};
202 202
203static uint64_t map__map_ip(struct map *map, uint64_t ip) 203static __u64 map__map_ip(struct map *map, __u64 ip)
204{ 204{
205 return ip - map->start + map->pgoff; 205 return ip - map->start + map->pgoff;
206} 206}
207 207
208static uint64_t vdso__map_ip(struct map *map, uint64_t ip) 208static __u64 vdso__map_ip(struct map *map, __u64 ip)
209{ 209{
210 return ip; 210 return ip;
211} 211}
@@ -288,7 +288,7 @@ static int map__overlap(struct map *l, struct map *r)
288 288
289static size_t map__fprintf(struct map *self, FILE *fp) 289static size_t map__fprintf(struct map *self, FILE *fp)
290{ 290{
291 return fprintf(fp, " %"PRIx64"-%"PRIx64" %"PRIx64" %s\n", 291 return fprintf(fp, " %Lx-%Lx %Lx %s\n",
292 self->start, self->end, self->pgoff, self->dso->name); 292 self->start, self->end, self->pgoff, self->dso->name);
293} 293}
294 294
@@ -412,7 +412,7 @@ static int thread__fork(struct thread *self, struct thread *parent)
412 return 0; 412 return 0;
413} 413}
414 414
415static struct map *thread__find_map(struct thread *self, uint64_t ip) 415static struct map *thread__find_map(struct thread *self, __u64 ip)
416{ 416{
417 struct map *pos; 417 struct map *pos;
418 418
@@ -453,10 +453,10 @@ struct hist_entry {
453 struct map *map; 453 struct map *map;
454 struct dso *dso; 454 struct dso *dso;
455 struct symbol *sym; 455 struct symbol *sym;
456 uint64_t ip; 456 __u64 ip;
457 char level; 457 char level;
458 458
459 uint64_t count; 459 __u64 count;
460}; 460};
461 461
462/* 462/*
@@ -572,7 +572,7 @@ static struct sort_entry sort_dso = {
572static int64_t 572static int64_t
573sort__sym_cmp(struct hist_entry *left, struct hist_entry *right) 573sort__sym_cmp(struct hist_entry *left, struct hist_entry *right)
574{ 574{
575 uint64_t ip_l, ip_r; 575 __u64 ip_l, ip_r;
576 576
577 if (left->sym == right->sym) 577 if (left->sym == right->sym)
578 return 0; 578 return 0;
@@ -684,7 +684,7 @@ hist_entry__collapse(struct hist_entry *left, struct hist_entry *right)
684} 684}
685 685
686static size_t 686static size_t
687hist_entry__fprintf(FILE *fp, struct hist_entry *self, uint64_t total_samples) 687hist_entry__fprintf(FILE *fp, struct hist_entry *self, __u64 total_samples)
688{ 688{
689 struct sort_entry *se; 689 struct sort_entry *se;
690 size_t ret; 690 size_t ret;
@@ -708,7 +708,7 @@ hist_entry__fprintf(FILE *fp, struct hist_entry *self, uint64_t total_samples)
708 ret = color_fprintf(fp, color, " %6.2f%%", 708 ret = color_fprintf(fp, color, " %6.2f%%",
709 (self->count * 100.0) / total_samples); 709 (self->count * 100.0) / total_samples);
710 } else 710 } else
711 ret = fprintf(fp, "%12d ", self->count); 711 ret = fprintf(fp, "%12Ld ", self->count);
712 712
713 list_for_each_entry(se, &hist_entry__sort_list, list) { 713 list_for_each_entry(se, &hist_entry__sort_list, list) {
714 fprintf(fp, " "); 714 fprintf(fp, " ");
@@ -726,7 +726,7 @@ hist_entry__fprintf(FILE *fp, struct hist_entry *self, uint64_t total_samples)
726 726
727static int 727static int
728hist_entry__add(struct thread *thread, struct map *map, struct dso *dso, 728hist_entry__add(struct thread *thread, struct map *map, struct dso *dso,
729 struct symbol *sym, uint64_t ip, char level, uint64_t count) 729 struct symbol *sym, __u64 ip, char level, __u64 count)
730{ 730{
731 struct rb_node **p = &hist.rb_node; 731 struct rb_node **p = &hist.rb_node;
732 struct rb_node *parent = NULL; 732 struct rb_node *parent = NULL;
@@ -873,7 +873,7 @@ static void output__resort(void)
873 } 873 }
874} 874}
875 875
876static size_t output__fprintf(FILE *fp, uint64_t total_samples) 876static size_t output__fprintf(FILE *fp, __u64 total_samples)
877{ 877{
878 struct hist_entry *pos; 878 struct hist_entry *pos;
879 struct sort_entry *se; 879 struct sort_entry *se;
@@ -941,8 +941,8 @@ process_overflow_event(event_t *event, unsigned long offset, unsigned long head)
941 int show = 0; 941 int show = 0;
942 struct dso *dso = NULL; 942 struct dso *dso = NULL;
943 struct thread *thread = threads__findnew(event->ip.pid); 943 struct thread *thread = threads__findnew(event->ip.pid);
944 uint64_t ip = event->ip.ip; 944 __u64 ip = event->ip.ip;
945 uint64_t period = 1; 945 __u64 period = 1;
946 struct map *map = NULL; 946 struct map *map = NULL;
947 947
948 if (event->header.type & PERF_SAMPLE_PERIOD) 948 if (event->header.type & PERF_SAMPLE_PERIOD)