diff options
author | Jiri Olsa <jolsa@kernel.org> | 2014-07-14 17:46:47 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-07-17 10:04:42 -0400 |
commit | acebd408bef17169fbf79079b96f0264b535916c (patch) | |
tree | be8603261bce76e0a6a4466f1f3440206bab393e | |
parent | 418029b7324f8b90ac1dfbc8a44555d6905be761 (diff) |
perf tools: Remove verbose from functions prototypes
And use verbose as an global object in following functions:
__map_groups__fprintf_maps
__map_groups__fprintf_removed_maps
map_groups__fprintf_maps
map_groups__fprintf
Also making map_groups__fprintf_maps static.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1405374411-29012-2-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/ui/stdio/hist.c | 2 | ||||
-rw-r--r-- | tools/perf/util/map.c | 24 | ||||
-rw-r--r-- | tools/perf/util/map.h | 9 | ||||
-rw-r--r-- | tools/perf/util/thread.c | 4 |
4 files changed, 19 insertions, 20 deletions
diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c index 90122abd3721..40af0acb4fe9 100644 --- a/tools/perf/ui/stdio/hist.c +++ b/tools/perf/ui/stdio/hist.c | |||
@@ -479,7 +479,7 @@ print_entries: | |||
479 | 479 | ||
480 | if (h->ms.map == NULL && verbose > 1) { | 480 | if (h->ms.map == NULL && verbose > 1) { |
481 | __map_groups__fprintf_maps(h->thread->mg, | 481 | __map_groups__fprintf_maps(h->thread->mg, |
482 | MAP__FUNCTION, verbose, fp); | 482 | MAP__FUNCTION, fp); |
483 | fprintf(fp, "%.10s end\n", graph_dotted_line); | 483 | fprintf(fp, "%.10s end\n", graph_dotted_line); |
484 | } | 484 | } |
485 | } | 485 | } |
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index 7af14807ee90..845f627e45f4 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include "vdso.h" | 12 | #include "vdso.h" |
13 | #include "build-id.h" | 13 | #include "build-id.h" |
14 | #include "util.h" | 14 | #include "util.h" |
15 | #include "debug.h" | ||
15 | #include <linux/string.h> | 16 | #include <linux/string.h> |
16 | 17 | ||
17 | const char *map_type__name[MAP__NR_TYPES] = { | 18 | const char *map_type__name[MAP__NR_TYPES] = { |
@@ -568,8 +569,8 @@ int map_groups__find_ams(struct addr_map_symbol *ams, symbol_filter_t filter) | |||
568 | return ams->sym ? 0 : -1; | 569 | return ams->sym ? 0 : -1; |
569 | } | 570 | } |
570 | 571 | ||
571 | size_t __map_groups__fprintf_maps(struct map_groups *mg, | 572 | size_t __map_groups__fprintf_maps(struct map_groups *mg, enum map_type type, |
572 | enum map_type type, int verbose, FILE *fp) | 573 | FILE *fp) |
573 | { | 574 | { |
574 | size_t printed = fprintf(fp, "%s:\n", map_type__name[type]); | 575 | size_t printed = fprintf(fp, "%s:\n", map_type__name[type]); |
575 | struct rb_node *nd; | 576 | struct rb_node *nd; |
@@ -587,17 +588,16 @@ size_t __map_groups__fprintf_maps(struct map_groups *mg, | |||
587 | return printed; | 588 | return printed; |
588 | } | 589 | } |
589 | 590 | ||
590 | size_t map_groups__fprintf_maps(struct map_groups *mg, int verbose, FILE *fp) | 591 | static size_t map_groups__fprintf_maps(struct map_groups *mg, FILE *fp) |
591 | { | 592 | { |
592 | size_t printed = 0, i; | 593 | size_t printed = 0, i; |
593 | for (i = 0; i < MAP__NR_TYPES; ++i) | 594 | for (i = 0; i < MAP__NR_TYPES; ++i) |
594 | printed += __map_groups__fprintf_maps(mg, i, verbose, fp); | 595 | printed += __map_groups__fprintf_maps(mg, i, fp); |
595 | return printed; | 596 | return printed; |
596 | } | 597 | } |
597 | 598 | ||
598 | static size_t __map_groups__fprintf_removed_maps(struct map_groups *mg, | 599 | static size_t __map_groups__fprintf_removed_maps(struct map_groups *mg, |
599 | enum map_type type, | 600 | enum map_type type, FILE *fp) |
600 | int verbose, FILE *fp) | ||
601 | { | 601 | { |
602 | struct map *pos; | 602 | struct map *pos; |
603 | size_t printed = 0; | 603 | size_t printed = 0; |
@@ -614,23 +614,23 @@ static size_t __map_groups__fprintf_removed_maps(struct map_groups *mg, | |||
614 | } | 614 | } |
615 | 615 | ||
616 | static size_t map_groups__fprintf_removed_maps(struct map_groups *mg, | 616 | static size_t map_groups__fprintf_removed_maps(struct map_groups *mg, |
617 | int verbose, FILE *fp) | 617 | FILE *fp) |
618 | { | 618 | { |
619 | size_t printed = 0, i; | 619 | size_t printed = 0, i; |
620 | for (i = 0; i < MAP__NR_TYPES; ++i) | 620 | for (i = 0; i < MAP__NR_TYPES; ++i) |
621 | printed += __map_groups__fprintf_removed_maps(mg, i, verbose, fp); | 621 | printed += __map_groups__fprintf_removed_maps(mg, i, fp); |
622 | return printed; | 622 | return printed; |
623 | } | 623 | } |
624 | 624 | ||
625 | size_t map_groups__fprintf(struct map_groups *mg, int verbose, FILE *fp) | 625 | size_t map_groups__fprintf(struct map_groups *mg, FILE *fp) |
626 | { | 626 | { |
627 | size_t printed = map_groups__fprintf_maps(mg, verbose, fp); | 627 | size_t printed = map_groups__fprintf_maps(mg, fp); |
628 | printed += fprintf(fp, "Removed maps:\n"); | 628 | printed += fprintf(fp, "Removed maps:\n"); |
629 | return printed + map_groups__fprintf_removed_maps(mg, verbose, fp); | 629 | return printed + map_groups__fprintf_removed_maps(mg, fp); |
630 | } | 630 | } |
631 | 631 | ||
632 | int map_groups__fixup_overlappings(struct map_groups *mg, struct map *map, | 632 | int map_groups__fixup_overlappings(struct map_groups *mg, struct map *map, |
633 | int verbose, FILE *fp) | 633 | FILE *fp) |
634 | { | 634 | { |
635 | struct rb_root *root = &mg->maps[map->type]; | 635 | struct rb_root *root = &mg->maps[map->type]; |
636 | struct rb_node *next = rb_first(root); | 636 | struct rb_node *next = rb_first(root); |
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h index 5806a906198b..22d13a219590 100644 --- a/tools/perf/util/map.h +++ b/tools/perf/util/map.h | |||
@@ -142,8 +142,8 @@ void map__fixup_end(struct map *map); | |||
142 | 142 | ||
143 | void map__reloc_vmlinux(struct map *map); | 143 | void map__reloc_vmlinux(struct map *map); |
144 | 144 | ||
145 | size_t __map_groups__fprintf_maps(struct map_groups *mg, | 145 | size_t __map_groups__fprintf_maps(struct map_groups *mg, enum map_type type, |
146 | enum map_type type, int verbose, FILE *fp); | 146 | FILE *fp); |
147 | void maps__insert(struct rb_root *maps, struct map *map); | 147 | void maps__insert(struct rb_root *maps, struct map *map); |
148 | void maps__remove(struct rb_root *maps, struct map *map); | 148 | void maps__remove(struct rb_root *maps, struct map *map); |
149 | struct map *maps__find(struct rb_root *maps, u64 addr); | 149 | struct map *maps__find(struct rb_root *maps, u64 addr); |
@@ -153,8 +153,7 @@ void map_groups__init(struct map_groups *mg); | |||
153 | void map_groups__exit(struct map_groups *mg); | 153 | void map_groups__exit(struct map_groups *mg); |
154 | int map_groups__clone(struct map_groups *mg, | 154 | int map_groups__clone(struct map_groups *mg, |
155 | struct map_groups *parent, enum map_type type); | 155 | struct map_groups *parent, enum map_type type); |
156 | size_t map_groups__fprintf(struct map_groups *mg, int verbose, FILE *fp); | 156 | size_t map_groups__fprintf(struct map_groups *mg, FILE *fp); |
157 | size_t map_groups__fprintf_maps(struct map_groups *mg, int verbose, FILE *fp); | ||
158 | 157 | ||
159 | int maps__set_kallsyms_ref_reloc_sym(struct map **maps, const char *symbol_name, | 158 | int maps__set_kallsyms_ref_reloc_sym(struct map **maps, const char *symbol_name, |
160 | u64 addr); | 159 | u64 addr); |
@@ -211,7 +210,7 @@ struct symbol *map_groups__find_function_by_name(struct map_groups *mg, | |||
211 | } | 210 | } |
212 | 211 | ||
213 | int map_groups__fixup_overlappings(struct map_groups *mg, struct map *map, | 212 | int map_groups__fixup_overlappings(struct map_groups *mg, struct map *map, |
214 | int verbose, FILE *fp); | 213 | FILE *fp); |
215 | 214 | ||
216 | struct map *map_groups__find_by_name(struct map_groups *mg, | 215 | struct map *map_groups__find_by_name(struct map_groups *mg, |
217 | enum map_type type, const char *name); | 216 | enum map_type type, const char *name); |
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c index b9c36ef42d2f..9692c06a9e21 100644 --- a/tools/perf/util/thread.c +++ b/tools/perf/util/thread.c | |||
@@ -129,12 +129,12 @@ int thread__comm_len(struct thread *thread) | |||
129 | size_t thread__fprintf(struct thread *thread, FILE *fp) | 129 | size_t thread__fprintf(struct thread *thread, FILE *fp) |
130 | { | 130 | { |
131 | return fprintf(fp, "Thread %d %s\n", thread->tid, thread__comm_str(thread)) + | 131 | return fprintf(fp, "Thread %d %s\n", thread->tid, thread__comm_str(thread)) + |
132 | map_groups__fprintf(thread->mg, verbose, fp); | 132 | map_groups__fprintf(thread->mg, fp); |
133 | } | 133 | } |
134 | 134 | ||
135 | void thread__insert_map(struct thread *thread, struct map *map) | 135 | void thread__insert_map(struct thread *thread, struct map *map) |
136 | { | 136 | { |
137 | map_groups__fixup_overlappings(thread->mg, map, verbose, stderr); | 137 | map_groups__fixup_overlappings(thread->mg, map, stderr); |
138 | map_groups__insert(thread->mg, map); | 138 | map_groups__insert(thread->mg, map); |
139 | } | 139 | } |
140 | 140 | ||