diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-11-11 19:17:32 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-11-28 07:37:11 -0500 |
commit | d04b35f8085f0d4c5c874515b8f65e7664357148 (patch) | |
tree | 8115d7e30c274756097ce27742338438a14fabd5 /tools/perf/util/ui | |
parent | 18b552350515188a732db6ccdb81e9cefb8b58c9 (diff) |
perf symbols: Add nr_events to symbol_conf
Since symbol__alloc_hists need it, to avoid passing it around in many
functions have it in the symbol_conf struct.
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-cwv8ysvpywzjq4v3xtbd4zwv@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/ui')
-rw-r--r-- | tools/perf/util/ui/browsers/annotate.c | 16 | ||||
-rw-r--r-- | tools/perf/util/ui/browsers/hists.c | 2 |
2 files changed, 8 insertions, 10 deletions
diff --git a/tools/perf/util/ui/browsers/annotate.c b/tools/perf/util/ui/browsers/annotate.c index 0575905d1205..295a9c93f945 100644 --- a/tools/perf/util/ui/browsers/annotate.c +++ b/tools/perf/util/ui/browsers/annotate.c | |||
@@ -224,7 +224,7 @@ static bool annotate_browser__toggle_source(struct annotate_browser *browser) | |||
224 | } | 224 | } |
225 | 225 | ||
226 | static int annotate_browser__run(struct annotate_browser *self, int evidx, | 226 | static int annotate_browser__run(struct annotate_browser *self, int evidx, |
227 | int nr_events, void(*timer)(void *arg), | 227 | void(*timer)(void *arg), |
228 | void *arg, int delay_secs) | 228 | void *arg, int delay_secs) |
229 | { | 229 | { |
230 | struct rb_node *nd = NULL; | 230 | struct rb_node *nd = NULL; |
@@ -328,8 +328,7 @@ static int annotate_browser__run(struct annotate_browser *self, int evidx, | |||
328 | notes = symbol__annotation(target); | 328 | notes = symbol__annotation(target); |
329 | pthread_mutex_lock(¬es->lock); | 329 | pthread_mutex_lock(¬es->lock); |
330 | 330 | ||
331 | if (notes->src == NULL && | 331 | if (notes->src == NULL && symbol__alloc_hist(target) < 0) { |
332 | symbol__alloc_hist(target, nr_events) < 0) { | ||
333 | pthread_mutex_unlock(¬es->lock); | 332 | pthread_mutex_unlock(¬es->lock); |
334 | ui__warning("Not enough memory for annotating '%s' symbol!\n", | 333 | ui__warning("Not enough memory for annotating '%s' symbol!\n", |
335 | target->name); | 334 | target->name); |
@@ -337,7 +336,7 @@ static int annotate_browser__run(struct annotate_browser *self, int evidx, | |||
337 | } | 336 | } |
338 | 337 | ||
339 | pthread_mutex_unlock(¬es->lock); | 338 | pthread_mutex_unlock(¬es->lock); |
340 | symbol__tui_annotate(target, ms->map, evidx, nr_events, | 339 | symbol__tui_annotate(target, ms->map, evidx, |
341 | timer, arg, delay_secs); | 340 | timer, arg, delay_secs); |
342 | } | 341 | } |
343 | continue; | 342 | continue; |
@@ -358,15 +357,15 @@ out: | |||
358 | return key; | 357 | return key; |
359 | } | 358 | } |
360 | 359 | ||
361 | int hist_entry__tui_annotate(struct hist_entry *he, int evidx, int nr_events, | 360 | int hist_entry__tui_annotate(struct hist_entry *he, int evidx, |
362 | void(*timer)(void *arg), void *arg, int delay_secs) | 361 | void(*timer)(void *arg), void *arg, int delay_secs) |
363 | { | 362 | { |
364 | return symbol__tui_annotate(he->ms.sym, he->ms.map, evidx, nr_events, | 363 | return symbol__tui_annotate(he->ms.sym, he->ms.map, evidx, |
365 | timer, arg, delay_secs); | 364 | timer, arg, delay_secs); |
366 | } | 365 | } |
367 | 366 | ||
368 | int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx, | 367 | int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx, |
369 | int nr_events, void(*timer)(void *arg), void *arg, | 368 | void(*timer)(void *arg), void *arg, |
370 | int delay_secs) | 369 | int delay_secs) |
371 | { | 370 | { |
372 | struct objdump_line *pos, *n; | 371 | struct objdump_line *pos, *n; |
@@ -419,8 +418,7 @@ int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx, | |||
419 | browser.b.nr_entries = browser.nr_entries; | 418 | browser.b.nr_entries = browser.nr_entries; |
420 | browser.b.entries = ¬es->src->source, | 419 | browser.b.entries = ¬es->src->source, |
421 | browser.b.width += 18; /* Percentage */ | 420 | browser.b.width += 18; /* Percentage */ |
422 | ret = annotate_browser__run(&browser, evidx, nr_events, | 421 | ret = annotate_browser__run(&browser, evidx, timer, arg, delay_secs); |
423 | timer, arg, delay_secs); | ||
424 | list_for_each_entry_safe(pos, n, ¬es->src->source, node) { | 422 | list_for_each_entry_safe(pos, n, ¬es->src->source, node) { |
425 | list_del(&pos->node); | 423 | list_del(&pos->node); |
426 | objdump_line__free(pos); | 424 | objdump_line__free(pos); |
diff --git a/tools/perf/util/ui/browsers/hists.c b/tools/perf/util/ui/browsers/hists.c index d0c94b459685..1212a386a033 100644 --- a/tools/perf/util/ui/browsers/hists.c +++ b/tools/perf/util/ui/browsers/hists.c | |||
@@ -1020,7 +1020,7 @@ do_annotate: | |||
1020 | * Don't let this be freed, say, by hists__decay_entry. | 1020 | * Don't let this be freed, say, by hists__decay_entry. |
1021 | */ | 1021 | */ |
1022 | he->used = true; | 1022 | he->used = true; |
1023 | err = hist_entry__tui_annotate(he, evsel->idx, nr_events, | 1023 | err = hist_entry__tui_annotate(he, evsel->idx, |
1024 | timer, arg, delay_secs); | 1024 | timer, arg, delay_secs); |
1025 | he->used = false; | 1025 | he->used = false; |
1026 | ui_browser__update_nr_entries(&browser->b, browser->hists->nr_entries); | 1026 | ui_browser__update_nr_entries(&browser->b, browser->hists->nr_entries); |