libperf: Add nr_entries to struct perf_evlist
Move nr_entries count from 'struct perf' to into perf_evlist struct. Committer notes: Fix tools/perf/arch/s390/util/auxtrace.c case. And also the comment in tools/perf/util/annotate.h. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Alexey Budankov <alexey.budankov@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20190721112506.12306-42-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:

committed by
Arnaldo Carvalho de Melo

parent
52e22fb8af
commit
6484d2f9dc
@@ -129,7 +129,7 @@ static int perf_top__parse_source(struct perf_top *top, struct hist_entry *he)
|
||||
notes = symbol__annotation(sym);
|
||||
pthread_mutex_lock(¬es->lock);
|
||||
|
||||
if (!symbol__hists(sym, top->evlist->nr_entries)) {
|
||||
if (!symbol__hists(sym, top->evlist->core.nr_entries)) {
|
||||
pthread_mutex_unlock(¬es->lock);
|
||||
pr_err("Not enough memory for annotating '%s' symbol!\n",
|
||||
sym->name);
|
||||
@@ -404,7 +404,7 @@ static void perf_top__print_mapped_keys(struct perf_top *top)
|
||||
fprintf(stdout, "\t[d] display refresh delay. \t(%d)\n", top->delay_secs);
|
||||
fprintf(stdout, "\t[e] display entries (lines). \t(%d)\n", top->print_entries);
|
||||
|
||||
if (top->evlist->nr_entries > 1)
|
||||
if (top->evlist->core.nr_entries > 1)
|
||||
fprintf(stdout, "\t[E] active event counter. \t(%s)\n", perf_evsel__name(top->sym_evsel));
|
||||
|
||||
fprintf(stdout, "\t[f] profile display filter (count). \t(%d)\n", top->count_filter);
|
||||
@@ -439,7 +439,7 @@ static int perf_top__key_mapped(struct perf_top *top, int c)
|
||||
case 'S':
|
||||
return 1;
|
||||
case 'E':
|
||||
return top->evlist->nr_entries > 1 ? 1 : 0;
|
||||
return top->evlist->core.nr_entries > 1 ? 1 : 0;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -485,7 +485,7 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c)
|
||||
}
|
||||
break;
|
||||
case 'E':
|
||||
if (top->evlist->nr_entries > 1) {
|
||||
if (top->evlist->core.nr_entries > 1) {
|
||||
/* Select 0 as the default event: */
|
||||
int counter = 0;
|
||||
|
||||
@@ -496,7 +496,7 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c)
|
||||
|
||||
prompt_integer(&counter, "Enter details event counter");
|
||||
|
||||
if (counter >= top->evlist->nr_entries) {
|
||||
if (counter >= top->evlist->core.nr_entries) {
|
||||
top->sym_evsel = perf_evlist__first(top->evlist);
|
||||
fprintf(stderr, "Sorry, no such event, using %s.\n", perf_evsel__name(top->sym_evsel));
|
||||
sleep(1);
|
||||
@@ -1536,7 +1536,7 @@ int cmd_top(int argc, const char **argv)
|
||||
if (argc)
|
||||
usage_with_options(top_usage, options);
|
||||
|
||||
if (!top.evlist->nr_entries &&
|
||||
if (!top.evlist->core.nr_entries &&
|
||||
perf_evlist__add_default(top.evlist) < 0) {
|
||||
pr_err("Not enough memory for event selector list\n");
|
||||
goto out_delete_evlist;
|
||||
|
Reference in New Issue
Block a user