aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-top.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-11-11 19:17:32 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-11-28 07:37:11 -0500
commitd04b35f8085f0d4c5c874515b8f65e7664357148 (patch)
tree8115d7e30c274756097ce27742338438a14fabd5 /tools/perf/builtin-top.c
parent18b552350515188a732db6ccdb81e9cefb8b58c9 (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/builtin-top.c')
-rw-r--r--tools/perf/builtin-top.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index c9cdedb58134..04288ee223ed 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -170,7 +170,7 @@ static int parse_source(struct hist_entry *he)
170 170
171 pthread_mutex_lock(&notes->lock); 171 pthread_mutex_lock(&notes->lock);
172 172
173 if (symbol__alloc_hist(sym, top.evlist->nr_entries) < 0) { 173 if (symbol__alloc_hist(sym) < 0) {
174 pthread_mutex_unlock(&notes->lock); 174 pthread_mutex_unlock(&notes->lock);
175 pr_err("Not enough memory for annotating '%s' symbol!\n", 175 pr_err("Not enough memory for annotating '%s' symbol!\n",
176 sym->name); 176 sym->name);
@@ -210,8 +210,7 @@ static void record_precise_ip(struct hist_entry *he, int counter, u64 ip)
210 if (pthread_mutex_trylock(&notes->lock)) 210 if (pthread_mutex_trylock(&notes->lock))
211 return; 211 return;
212 212
213 if (notes->src == NULL && 213 if (notes->src == NULL && symbol__alloc_hist(sym) < 0) {
214 symbol__alloc_hist(sym, top.evlist->nr_entries) < 0) {
215 pthread_mutex_unlock(&notes->lock); 214 pthread_mutex_unlock(&notes->lock);
216 pr_err("Not enough memory for annotating '%s' symbol!\n", 215 pr_err("Not enough memory for annotating '%s' symbol!\n",
217 sym->name); 216 sym->name);
@@ -1215,6 +1214,8 @@ int cmd_top(int argc, const char **argv, const char *prefix __used)
1215 return -ENOMEM; 1214 return -ENOMEM;
1216 } 1215 }
1217 1216
1217 symbol_conf.nr_events = top.evlist->nr_entries;
1218
1218 if (top.delay_secs < 1) 1219 if (top.delay_secs < 1)
1219 top.delay_secs = 1; 1220 top.delay_secs = 1;
1220 1221