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>
This commit is contained in:
@ -170,7 +170,7 @@ static int parse_source(struct hist_entry *he)
|
||||
|
||||
pthread_mutex_lock(¬es->lock);
|
||||
|
||||
if (symbol__alloc_hist(sym, top.evlist->nr_entries) < 0) {
|
||||
if (symbol__alloc_hist(sym) < 0) {
|
||||
pthread_mutex_unlock(¬es->lock);
|
||||
pr_err("Not enough memory for annotating '%s' symbol!\n",
|
||||
sym->name);
|
||||
@ -210,8 +210,7 @@ static void record_precise_ip(struct hist_entry *he, int counter, u64 ip)
|
||||
if (pthread_mutex_trylock(¬es->lock))
|
||||
return;
|
||||
|
||||
if (notes->src == NULL &&
|
||||
symbol__alloc_hist(sym, top.evlist->nr_entries) < 0) {
|
||||
if (notes->src == NULL && symbol__alloc_hist(sym) < 0) {
|
||||
pthread_mutex_unlock(¬es->lock);
|
||||
pr_err("Not enough memory for annotating '%s' symbol!\n",
|
||||
sym->name);
|
||||
@ -1215,6 +1214,8 @@ int cmd_top(int argc, const char **argv, const char *prefix __used)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
symbol_conf.nr_events = top.evlist->nr_entries;
|
||||
|
||||
if (top.delay_secs < 1)
|
||||
top.delay_secs = 1;
|
||||
|
||||
|
Reference in New Issue
Block a user