aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/callchain.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-07-01 06:37:06 -0400
committerIngo Molnar <mingo@elte.hu>2009-07-01 06:49:48 -0400
commitf37a291c527c954df4da568de718ebb36b8261c0 (patch)
treebb4863fbd185fbfef5f7d28cb4001d59d4123a2d /tools/perf/util/callchain.c
parent88a69dfbc6ab1e3b51bba8c9103055e21089ebb9 (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/util/callchain.c')
-rw-r--r--tools/perf/util/callchain.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c
index 440db12c6359..3dceabd9b5ef 100644
--- a/tools/perf/util/callchain.c
+++ b/tools/perf/util/callchain.c
@@ -92,7 +92,7 @@ static void
92fill_node(struct callchain_node *node, struct ip_callchain *chain, 92fill_node(struct callchain_node *node, struct ip_callchain *chain,
93 int start, struct symbol **syms) 93 int start, struct symbol **syms)
94{ 94{
95 int i; 95 unsigned int i;
96 96
97 for (i = start; i < chain->nr; i++) { 97 for (i = start; i < chain->nr; i++) {
98 struct callchain_list *call; 98 struct callchain_list *call;
@@ -135,7 +135,7 @@ split_add_child(struct callchain_node *parent, struct ip_callchain *chain,
135{ 135{
136 struct callchain_node *new; 136 struct callchain_node *new;
137 struct list_head *old_tail; 137 struct list_head *old_tail;
138 int idx_total = idx_parents + idx_local; 138 unsigned int idx_total = idx_parents + idx_local;
139 139
140 /* split */ 140 /* split */
141 new = create_child(parent, true); 141 new = create_child(parent, true);
@@ -164,17 +164,18 @@ split_add_child(struct callchain_node *parent, struct ip_callchain *chain,
164 164
165static int 165static int
166__append_chain(struct callchain_node *root, struct ip_callchain *chain, 166__append_chain(struct callchain_node *root, struct ip_callchain *chain,
167 int start, struct symbol **syms); 167 unsigned int start, struct symbol **syms);
168 168
169static void 169static void
170__append_chain_children(struct callchain_node *root, struct ip_callchain *chain, 170__append_chain_children(struct callchain_node *root, struct ip_callchain *chain,
171 struct symbol **syms, int start) 171 struct symbol **syms, unsigned int start)
172{ 172{
173 struct callchain_node *rnode; 173 struct callchain_node *rnode;
174 174
175 /* lookup in childrens */ 175 /* lookup in childrens */
176 list_for_each_entry(rnode, &root->children, brothers) { 176 list_for_each_entry(rnode, &root->children, brothers) {
177 int ret = __append_chain(rnode, chain, start, syms); 177 unsigned int ret = __append_chain(rnode, chain, start, syms);
178
178 if (!ret) 179 if (!ret)
179 return; 180 return;
180 } 181 }
@@ -184,10 +185,10 @@ __append_chain_children(struct callchain_node *root, struct ip_callchain *chain,
184 185
185static int 186static int
186__append_chain(struct callchain_node *root, struct ip_callchain *chain, 187__append_chain(struct callchain_node *root, struct ip_callchain *chain,
187 int start, struct symbol **syms) 188 unsigned int start, struct symbol **syms)
188{ 189{
189 struct callchain_list *cnode; 190 struct callchain_list *cnode;
190 int i = start; 191 unsigned int i = start;
191 bool found = false; 192 bool found = false;
192 193
193 /* 194 /*