diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-07-01 06:37:06 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-07-01 06:49:48 -0400 |
commit | f37a291c527c954df4da568de718ebb36b8261c0 (patch) | |
tree | bb4863fbd185fbfef5f7d28cb4001d59d4123a2d /tools/perf/builtin-annotate.c | |
parent | 88a69dfbc6ab1e3b51bba8c9103055e21089ebb9 (diff) |
perf_counter tools: Add more warnings and fix/annotate them
Enable -Wextra. This found a few real bugs plus a number
of signed/unsigned type mismatches/uncleanlinesses. It
also required a few annotations
All things considered it was still worth it so lets try with
this enabled for now.
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>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-annotate.c')
-rw-r--r-- | tools/perf/builtin-annotate.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 722c0f54e549..6cba70daf121 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c | |||
@@ -160,7 +160,7 @@ static void dsos__fprintf(FILE *fp) | |||
160 | 160 | ||
161 | static struct symbol *vdso__find_symbol(struct dso *dso, u64 ip) | 161 | static struct symbol *vdso__find_symbol(struct dso *dso, u64 ip) |
162 | { | 162 | { |
163 | return dso__find_symbol(kernel_dso, ip); | 163 | return dso__find_symbol(dso, ip); |
164 | } | 164 | } |
165 | 165 | ||
166 | static int load_kernel(void) | 166 | static int load_kernel(void) |
@@ -203,7 +203,7 @@ static u64 map__map_ip(struct map *map, u64 ip) | |||
203 | return ip - map->start + map->pgoff; | 203 | return ip - map->start + map->pgoff; |
204 | } | 204 | } |
205 | 205 | ||
206 | static u64 vdso__map_ip(struct map *map, u64 ip) | 206 | static u64 vdso__map_ip(struct map *map __used, u64 ip) |
207 | { | 207 | { |
208 | return ip; | 208 | return ip; |
209 | } | 209 | } |
@@ -600,7 +600,7 @@ static LIST_HEAD(hist_entry__sort_list); | |||
600 | 600 | ||
601 | static int sort_dimension__add(char *tok) | 601 | static int sort_dimension__add(char *tok) |
602 | { | 602 | { |
603 | int i; | 603 | unsigned int i; |
604 | 604 | ||
605 | for (i = 0; i < ARRAY_SIZE(sort_dimensions); i++) { | 605 | for (i = 0; i < ARRAY_SIZE(sort_dimensions); i++) { |
606 | struct sort_dimension *sd = &sort_dimensions[i]; | 606 | struct sort_dimension *sd = &sort_dimensions[i]; |
@@ -1069,7 +1069,7 @@ parse_line(FILE *file, struct symbol *sym, u64 start, u64 len) | |||
1069 | static const char *prev_color; | 1069 | static const char *prev_color; |
1070 | unsigned int offset; | 1070 | unsigned int offset; |
1071 | size_t line_len; | 1071 | size_t line_len; |
1072 | u64 line_ip; | 1072 | s64 line_ip; |
1073 | int ret; | 1073 | int ret; |
1074 | char *c; | 1074 | char *c; |
1075 | 1075 | ||
@@ -1428,7 +1428,7 @@ more: | |||
1428 | 1428 | ||
1429 | head += size; | 1429 | head += size; |
1430 | 1430 | ||
1431 | if (offset + head < stat.st_size) | 1431 | if (offset + head < (unsigned long)stat.st_size) |
1432 | goto more; | 1432 | goto more; |
1433 | 1433 | ||
1434 | rc = EXIT_SUCCESS; | 1434 | rc = EXIT_SUCCESS; |
@@ -1492,7 +1492,7 @@ static void setup_sorting(void) | |||
1492 | free(str); | 1492 | free(str); |
1493 | } | 1493 | } |
1494 | 1494 | ||
1495 | int cmd_annotate(int argc, const char **argv, const char *prefix) | 1495 | int cmd_annotate(int argc, const char **argv, const char *prefix __used) |
1496 | { | 1496 | { |
1497 | symbol__init(); | 1497 | symbol__init(); |
1498 | 1498 | ||