Commit 6484d2f9 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

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: default avatarJiri 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.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 52e22fb8
...@@ -90,7 +90,7 @@ struct auxtrace_record *auxtrace_record__init(struct evlist *evlist, ...@@ -90,7 +90,7 @@ struct auxtrace_record *auxtrace_record__init(struct evlist *evlist,
int diagnose = 0; int diagnose = 0;
*err = 0; *err = 0;
if (evlist->nr_entries == 0) if (evlist->core.nr_entries == 0)
return NULL; return NULL;
evlist__for_each_entry(evlist, pos) { evlist__for_each_entry(evlist, pos) {
......
...@@ -1375,7 +1375,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) ...@@ -1375,7 +1375,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
* because we synthesize event name through the pipe * because we synthesize event name through the pipe
* and need the id for that. * and need the id for that.
*/ */
if (data->is_pipe && rec->evlist->nr_entries == 1) if (data->is_pipe && rec->evlist->core.nr_entries == 1)
rec->opts.sample_id = true; rec->opts.sample_id = true;
if (record__open(rec) != 0) { if (record__open(rec) != 0) {
...@@ -2386,7 +2386,7 @@ int cmd_record(int argc, const char **argv) ...@@ -2386,7 +2386,7 @@ int cmd_record(int argc, const char **argv)
if (record.opts.overwrite) if (record.opts.overwrite)
record.opts.tail_synthesize = true; record.opts.tail_synthesize = true;
if (rec->evlist->nr_entries == 0 && if (rec->evlist->core.nr_entries == 0 &&
__perf_evlist__add_default(rec->evlist, !record.opts.no_samples) < 0) { __perf_evlist__add_default(rec->evlist, !record.opts.no_samples) < 0) {
pr_err("Not enough memory for event selector list\n"); pr_err("Not enough memory for event selector list\n");
goto out; goto out;
......
...@@ -1366,7 +1366,7 @@ static int add_default_attributes(void) ...@@ -1366,7 +1366,7 @@ static int add_default_attributes(void)
free(str); free(str);
} }
if (!evsel_list->nr_entries) { if (!evsel_list->core.nr_entries) {
if (target__has_cpu(&target)) if (target__has_cpu(&target))
default_attrs0[0].config = PERF_COUNT_SW_CPU_CLOCK; default_attrs0[0].config = PERF_COUNT_SW_CPU_CLOCK;
...@@ -1683,7 +1683,7 @@ static void setup_system_wide(int forks) ...@@ -1683,7 +1683,7 @@ static void setup_system_wide(int forks)
return; return;
} }
if (evsel_list->nr_entries) if (evsel_list->core.nr_entries)
target.system_wide = true; target.system_wide = true;
} }
} }
......
...@@ -129,7 +129,7 @@ static int perf_top__parse_source(struct perf_top *top, struct hist_entry *he) ...@@ -129,7 +129,7 @@ static int perf_top__parse_source(struct perf_top *top, struct hist_entry *he)
notes = symbol__annotation(sym); notes = symbol__annotation(sym);
pthread_mutex_lock(&notes->lock); pthread_mutex_lock(&notes->lock);
if (!symbol__hists(sym, top->evlist->nr_entries)) { if (!symbol__hists(sym, top->evlist->core.nr_entries)) {
pthread_mutex_unlock(&notes->lock); pthread_mutex_unlock(&notes->lock);
pr_err("Not enough memory for annotating '%s' symbol!\n", pr_err("Not enough memory for annotating '%s' symbol!\n",
sym->name); sym->name);
...@@ -404,7 +404,7 @@ static void perf_top__print_mapped_keys(struct perf_top *top) ...@@ -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[d] display refresh delay. \t(%d)\n", top->delay_secs);
fprintf(stdout, "\t[e] display entries (lines). \t(%d)\n", top->print_entries); 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[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); 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) ...@@ -439,7 +439,7 @@ static int perf_top__key_mapped(struct perf_top *top, int c)
case 'S': case 'S':
return 1; return 1;
case 'E': case 'E':
return top->evlist->nr_entries > 1 ? 1 : 0; return top->evlist->core.nr_entries > 1 ? 1 : 0;
default: default:
break; break;
} }
...@@ -485,7 +485,7 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c) ...@@ -485,7 +485,7 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c)
} }
break; break;
case 'E': case 'E':
if (top->evlist->nr_entries > 1) { if (top->evlist->core.nr_entries > 1) {
/* Select 0 as the default event: */ /* Select 0 as the default event: */
int counter = 0; int counter = 0;
...@@ -496,7 +496,7 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c) ...@@ -496,7 +496,7 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c)
prompt_integer(&counter, "Enter details event counter"); 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); top->sym_evsel = perf_evlist__first(top->evlist);
fprintf(stderr, "Sorry, no such event, using %s.\n", perf_evsel__name(top->sym_evsel)); fprintf(stderr, "Sorry, no such event, using %s.\n", perf_evsel__name(top->sym_evsel));
sleep(1); sleep(1);
...@@ -1536,7 +1536,7 @@ int cmd_top(int argc, const char **argv) ...@@ -1536,7 +1536,7 @@ int cmd_top(int argc, const char **argv)
if (argc) if (argc)
usage_with_options(top_usage, options); usage_with_options(top_usage, options);
if (!top.evlist->nr_entries && if (!top.evlist->core.nr_entries &&
perf_evlist__add_default(top.evlist) < 0) { perf_evlist__add_default(top.evlist) < 0) {
pr_err("Not enough memory for event selector list\n"); pr_err("Not enough memory for event selector list\n");
goto out_delete_evlist; goto out_delete_evlist;
......
...@@ -4270,7 +4270,7 @@ int cmd_trace(int argc, const char **argv) ...@@ -4270,7 +4270,7 @@ int cmd_trace(int argc, const char **argv)
symbol_conf.use_callchain = true; symbol_conf.use_callchain = true;
} }
if (trace.evlist->nr_entries > 0) { if (trace.evlist->core.nr_entries > 0) {
evlist__set_evsel_handler(trace.evlist, trace__event_handler); evlist__set_evsel_handler(trace.evlist, trace__event_handler);
if (evlist__set_syscall_tp_fields(trace.evlist)) { if (evlist__set_syscall_tp_fields(trace.evlist)) {
perror("failed to set syscalls:* tracepoint fields"); perror("failed to set syscalls:* tracepoint fields");
...@@ -4368,7 +4368,7 @@ int cmd_trace(int argc, const char **argv) ...@@ -4368,7 +4368,7 @@ int cmd_trace(int argc, const char **argv)
trace.summary = trace.summary_only; trace.summary = trace.summary_only;
if (!trace.trace_syscalls && !trace.trace_pgfaults && if (!trace.trace_syscalls && !trace.trace_pgfaults &&
trace.evlist->nr_entries == 0 /* Was --events used? */) { trace.evlist->core.nr_entries == 0 /* Was --events used? */) {
trace.trace_syscalls = true; trace.trace_syscalls = true;
} }
......
...@@ -7,16 +7,19 @@ ...@@ -7,16 +7,19 @@
void perf_evlist__init(struct perf_evlist *evlist) void perf_evlist__init(struct perf_evlist *evlist)
{ {
INIT_LIST_HEAD(&evlist->entries); INIT_LIST_HEAD(&evlist->entries);
evlist->nr_entries = 0;
} }
void perf_evlist__add(struct perf_evlist *evlist, void perf_evlist__add(struct perf_evlist *evlist,
struct perf_evsel *evsel) struct perf_evsel *evsel)
{ {
list_add_tail(&evsel->node, &evlist->entries); list_add_tail(&evsel->node, &evlist->entries);
evlist->nr_entries += 1;
} }
void perf_evlist__remove(struct perf_evlist *evlist, void perf_evlist__remove(struct perf_evlist *evlist,
struct perf_evsel *evsel) struct perf_evsel *evsel)
{ {
list_del_init(&evsel->node); list_del_init(&evsel->node);
evlist->nr_entries -= 1;
} }
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
struct perf_evlist { struct perf_evlist {
struct list_head entries; struct list_head entries;
int nr_entries;
}; };
#endif /* __LIBPERF_INTERNAL_EVLIST_H */ #endif /* __LIBPERF_INTERNAL_EVLIST_H */
This diff is collapsed.
...@@ -422,7 +422,7 @@ static bool annotate_browser__callq(struct annotate_browser *browser, ...@@ -422,7 +422,7 @@ static bool annotate_browser__callq(struct annotate_browser *browser,
notes = symbol__annotation(dl->ops.target.sym); notes = symbol__annotation(dl->ops.target.sym);
pthread_mutex_lock(&notes->lock); pthread_mutex_lock(&notes->lock);
if (!symbol__hists(dl->ops.target.sym, evsel->evlist->nr_entries)) { if (!symbol__hists(dl->ops.target.sym, evsel->evlist->core.nr_entries)) {
pthread_mutex_unlock(&notes->lock); pthread_mutex_unlock(&notes->lock);
ui__warning("Not enough memory for annotating '%s' symbol!\n", ui__warning("Not enough memory for annotating '%s' symbol!\n",
dl->ops.target.sym->name); dl->ops.target.sym->name);
......
...@@ -3404,7 +3404,7 @@ int perf_evlist__tui_browse_hists(struct evlist *evlist, const char *help, ...@@ -3404,7 +3404,7 @@ int perf_evlist__tui_browse_hists(struct evlist *evlist, const char *help,
bool warn_lost_event, bool warn_lost_event,
struct annotation_options *annotation_opts) struct annotation_options *annotation_opts)
{ {
int nr_entries = evlist->nr_entries; int nr_entries = evlist->core.nr_entries;
single_entry: single_entry:
if (nr_entries == 1) { if (nr_entries == 1) {
......
...@@ -936,7 +936,7 @@ static int symbol__inc_addr_samples(struct symbol *sym, struct map *map, ...@@ -936,7 +936,7 @@ static int symbol__inc_addr_samples(struct symbol *sym, struct map *map,
if (sym == NULL) if (sym == NULL)
return 0; return 0;
src = symbol__hists(sym, evsel->evlist->nr_entries); src = symbol__hists(sym, evsel->evlist->core.nr_entries);
return (src) ? __symbol__inc_addr_samples(sym, map, src, evsel->idx, return (src) ? __symbol__inc_addr_samples(sym, map, src, evsel->idx,
addr, sample) : 0; addr, sample) : 0;
} }
......
...@@ -245,7 +245,7 @@ struct cyc_hist { ...@@ -245,7 +245,7 @@ struct cyc_hist {
/** struct annotated_source - symbols with hits have this attached as in sannotation /** struct annotated_source - symbols with hits have this attached as in sannotation
* *
* @histograms: Array of addr hit histograms per event being monitored * @histograms: Array of addr hit histograms per event being monitored
* nr_histograms: This may not be the same as evsel->evlist->nr_entries if * nr_histograms: This may not be the same as evsel->evlist->core.nr_entries if
* we have more than a group in a evlist, where we will want * we have more than a group in a evlist, where we will want
* to see each group separately, that is why symbol__annotate2() * to see each group separately, that is why symbol__annotate2()
* sets src->nr_histograms to evsel->nr_members. * sets src->nr_histograms to evsel->nr_members.
......
...@@ -125,7 +125,7 @@ static void perf_evlist__purge(struct evlist *evlist) ...@@ -125,7 +125,7 @@ static void perf_evlist__purge(struct evlist *evlist)
evsel__delete(pos); evsel__delete(pos);
} }
evlist->nr_entries = 0; evlist->core.nr_entries = 0;
} }
void perf_evlist__exit(struct evlist *evlist) void perf_evlist__exit(struct evlist *evlist)
...@@ -180,12 +180,13 @@ static void perf_evlist__propagate_maps(struct evlist *evlist) ...@@ -180,12 +180,13 @@ static void perf_evlist__propagate_maps(struct evlist *evlist)
void evlist__add(struct evlist *evlist, struct evsel *entry) void evlist__add(struct evlist *evlist, struct evsel *entry)
{ {
perf_evlist__add(&evlist->core, &entry->core);
entry->evlist = evlist; entry->evlist = evlist;
entry->idx = evlist->nr_entries; entry->idx = evlist->core.nr_entries;
entry->tracking = !entry->idx; entry->tracking = !entry->idx;
if (!evlist->nr_entries++) perf_evlist__add(&evlist->core, &entry->core);
if (evlist->core.nr_entries == 1)
perf_evlist__set_id_pos(evlist); perf_evlist__set_id_pos(evlist);
__perf_evlist__propagate_maps(evlist, entry); __perf_evlist__propagate_maps(evlist, entry);
...@@ -195,7 +196,6 @@ void evlist__remove(struct evlist *evlist, struct evsel *evsel) ...@@ -195,7 +196,6 @@ void evlist__remove(struct evlist *evlist, struct evsel *evsel)
{ {
evsel->evlist = NULL; evsel->evlist = NULL;
perf_evlist__remove(&evlist->core, &evsel->core); perf_evlist__remove(&evlist->core, &evsel->core);
evlist->nr_entries -= 1;
} }
void perf_evlist__splice_list_tail(struct evlist *evlist, void perf_evlist__splice_list_tail(struct evlist *evlist,
...@@ -225,8 +225,8 @@ void __perf_evlist__set_leader(struct list_head *list) ...@@ -225,8 +225,8 @@ void __perf_evlist__set_leader(struct list_head *list)
void perf_evlist__set_leader(struct evlist *evlist) void perf_evlist__set_leader(struct evlist *evlist)
{ {
if (evlist->nr_entries) { if (evlist->core.nr_entries) {
evlist->nr_groups = evlist->nr_entries > 1 ? 1 : 0; evlist->nr_groups = evlist->core.nr_entries > 1 ? 1 : 0;
__perf_evlist__set_leader(&evlist->core.entries); __perf_evlist__set_leader(&evlist->core.entries);
} }
} }
...@@ -249,7 +249,7 @@ int perf_evlist__add_dummy(struct evlist *evlist) ...@@ -249,7 +249,7 @@ int perf_evlist__add_dummy(struct evlist *evlist)
.config = PERF_COUNT_SW_DUMMY, .config = PERF_COUNT_SW_DUMMY,
.size = sizeof(attr), /* to capture ABI version */ .size = sizeof(attr), /* to capture ABI version */
}; };
struct evsel *evsel = perf_evsel__new_idx(&attr, evlist->nr_entries); struct evsel *evsel = perf_evsel__new_idx(&attr, evlist->core.nr_entries);
if (evsel == NULL) if (evsel == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -266,7 +266,7 @@ static int evlist__add_attrs(struct evlist *evlist, ...@@ -266,7 +266,7 @@ static int evlist__add_attrs(struct evlist *evlist,
size_t i; size_t i;
for (i = 0; i < nr_attrs; i++) { for (i = 0; i < nr_attrs; i++) {
evsel = perf_evsel__new_idx(attrs + i, evlist->nr_entries + i); evsel = perf_evsel__new_idx(attrs + i, evlist->core.nr_entries + i);
if (evsel == NULL) if (evsel == NULL)
goto out_delete_partial_list; goto out_delete_partial_list;
list_add_tail(&evsel->core.node, &head); list_add_tail(&evsel->core.node, &head);
...@@ -581,7 +581,7 @@ struct evsel *perf_evlist__id2evsel(struct evlist *evlist, u64 id) ...@@ -581,7 +581,7 @@ struct evsel *perf_evlist__id2evsel(struct evlist *evlist, u64 id)
{ {
struct perf_sample_id *sid; struct perf_sample_id *sid;
if (evlist->nr_entries == 1 || !id) if (evlist->core.nr_entries == 1 || !id)
return perf_evlist__first(evlist); return perf_evlist__first(evlist);
sid = perf_evlist__id2sid(evlist, id); sid = perf_evlist__id2sid(evlist, id);
...@@ -639,7 +639,7 @@ struct evsel *perf_evlist__event2evsel(struct evlist *evlist, ...@@ -639,7 +639,7 @@ struct evsel *perf_evlist__event2evsel(struct evlist *evlist,
int hash; int hash;
u64 id; u64 id;
if (evlist->nr_entries == 1) if (evlist->core.nr_entries == 1)
return first; return first;
if (!first->attr.sample_id_all && if (!first->attr.sample_id_all &&
...@@ -1222,7 +1222,7 @@ bool perf_evlist__valid_sample_type(struct evlist *evlist) ...@@ -1222,7 +1222,7 @@ bool perf_evlist__valid_sample_type(struct evlist *evlist)
{ {
struct evsel *pos; struct evsel *pos;
if (evlist->nr_entries == 1) if (evlist->core.nr_entries == 1)
return true; return true;
if (evlist->id_pos < 0 || evlist->is_pos < 0) if (evlist->id_pos < 0 || evlist->is_pos < 0)
...@@ -1849,7 +1849,7 @@ int perf_evlist__add_sb_event(struct evlist **evlist, ...@@ -1849,7 +1849,7 @@ int perf_evlist__add_sb_event(struct evlist **evlist,
attr->sample_id_all = 1; attr->sample_id_all = 1;
} }
evsel = perf_evsel__new_idx(attr, (*evlist)->nr_entries); evsel = perf_evsel__new_idx(attr, (*evlist)->core.nr_entries);
if (!evsel) if (!evsel)
goto out_err; goto out_err;
......
...@@ -28,7 +28,6 @@ struct record_opts; ...@@ -28,7 +28,6 @@ struct record_opts;
struct evlist { struct evlist {
struct perf_evlist core; struct perf_evlist core;
struct hlist_head heads[PERF_EVLIST__HLIST_SIZE]; struct hlist_head heads[PERF_EVLIST__HLIST_SIZE];
int nr_entries;
int nr_groups; int nr_groups;
int nr_mmaps; int nr_mmaps;
bool enabled; bool enabled;
......
...@@ -476,7 +476,7 @@ static int write_event_desc(struct feat_fd *ff, ...@@ -476,7 +476,7 @@ static int write_event_desc(struct feat_fd *ff,
u32 nre, nri, sz; u32 nre, nri, sz;
int ret; int ret;
nre = evlist->nr_entries; nre = evlist->core.nr_entries;
/* /*
* write number of events * write number of events
...@@ -3100,7 +3100,7 @@ int perf_session__write_header(struct perf_session *session, ...@@ -3100,7 +3100,7 @@ int perf_session__write_header(struct perf_session *session,
.attr_size = sizeof(f_attr), .attr_size = sizeof(f_attr),
.attrs = { .attrs = {
.offset = attr_offset, .offset = attr_offset,
.size = evlist->nr_entries * sizeof(f_attr), .size = evlist->core.nr_entries * sizeof(f_attr),
}, },
.data = { .data = {
.offset = header->data_offset, .offset = header->data_offset,
......
...@@ -1909,7 +1909,7 @@ int parse_events(struct evlist *evlist, const char *str, ...@@ -1909,7 +1909,7 @@ int parse_events(struct evlist *evlist, const char *str,
{ {
struct parse_events_state parse_state = { struct parse_events_state parse_state = {
.list = LIST_HEAD_INIT(parse_state.list), .list = LIST_HEAD_INIT(parse_state.list),
.idx = evlist->nr_entries, .idx = evlist->core.nr_entries,
.error = err, .error = err,
.evlist = evlist, .evlist = evlist,
}; };
...@@ -2040,7 +2040,7 @@ foreach_evsel_in_last_glob(struct evlist *evlist, ...@@ -2040,7 +2040,7 @@ foreach_evsel_in_last_glob(struct evlist *evlist,
* *
* So no need to WARN here, let *func do this. * So no need to WARN here, let *func do this.
*/ */
if (evlist->nr_entries > 0) if (evlist->core.nr_entries > 0)
last = perf_evlist__last(evlist); last = perf_evlist__last(evlist);
do { do {
......
...@@ -973,10 +973,10 @@ static PyObject *pyrf_evlist__add(struct pyrf_evlist *pevlist, ...@@ -973,10 +973,10 @@ static PyObject *pyrf_evlist__add(struct pyrf_evlist *pevlist,
Py_INCREF(pevsel); Py_INCREF(pevsel);
evsel = &((struct pyrf_evsel *)pevsel)->evsel; evsel = &((struct pyrf_evsel *)pevsel)->evsel;
evsel->idx = evlist->nr_entries; evsel->idx = evlist->core.nr_entries;
evlist__add(evlist, evsel); evlist__add(evlist, evsel);
return Py_BuildValue("i", evlist->nr_entries); return Py_BuildValue("i", evlist->core.nr_entries);
} }
static struct perf_mmap *get_md(struct evlist *evlist, int cpu) static struct perf_mmap *get_md(struct evlist *evlist, int cpu)
...@@ -1112,7 +1112,7 @@ static Py_ssize_t pyrf_evlist__length(PyObject *obj) ...@@ -1112,7 +1112,7 @@ static Py_ssize_t pyrf_evlist__length(PyObject *obj)
{ {
struct pyrf_evlist *pevlist = (void *)obj; struct pyrf_evlist *pevlist = (void *)obj;
return pevlist->evlist.nr_entries; return pevlist->evlist.core.nr_entries;
} }
static PyObject *pyrf_evlist__item(PyObject *obj, Py_ssize_t i) static PyObject *pyrf_evlist__item(PyObject *obj, Py_ssize_t i)
...@@ -1120,7 +1120,7 @@ static PyObject *pyrf_evlist__item(PyObject *obj, Py_ssize_t i) ...@@ -1120,7 +1120,7 @@ static PyObject *pyrf_evlist__item(PyObject *obj, Py_ssize_t i)
struct pyrf_evlist *pevlist = (void *)obj; struct pyrf_evlist *pevlist = (void *)obj;
struct evsel *pos; struct evsel *pos;
if (i >= pevlist->evlist.nr_entries) if (i >= pevlist->evlist.core.nr_entries)
return NULL; return NULL;
evlist__for_each_entry(&pevlist->evlist, pos) { evlist__for_each_entry(&pevlist->evlist, pos) {
......
...@@ -166,7 +166,7 @@ void perf_evlist__config(struct evlist *evlist, struct record_opts *opts, ...@@ -166,7 +166,7 @@ void perf_evlist__config(struct evlist *evlist, struct record_opts *opts,
*/ */
use_sample_identifier = perf_can_sample_identifier(); use_sample_identifier = perf_can_sample_identifier();
sample_id = true; sample_id = true;
} else if (evlist->nr_entries > 1) { } else if (evlist->core.nr_entries > 1) {
struct evsel *first = perf_evlist__first(evlist); struct evsel *first = perf_evlist__first(evlist);
evlist__for_each_entry(evlist, evsel) { evlist__for_each_entry(evlist, evsel) {
......
...@@ -2323,7 +2323,7 @@ static struct evsel *find_evsel(struct evlist *evlist, char *event_name) ...@@ -2323,7 +2323,7 @@ static struct evsel *find_evsel(struct evlist *evlist, char *event_name)
if (event_name[0] == '%') { if (event_name[0] == '%') {
int nr = strtol(event_name+1, NULL, 0); int nr = strtol(event_name+1, NULL, 0);
if (nr > evlist->nr_entries) if (nr > evlist->core.nr_entries)
return NULL; return NULL;
evsel = perf_evlist__first(evlist); evsel = perf_evlist__first(evlist);
......
...@@ -70,7 +70,7 @@ size_t perf_top__header_snprintf(struct perf_top *top, char *bf, size_t size) ...@@ -70,7 +70,7 @@ size_t perf_top__header_snprintf(struct perf_top *top, char *bf, size_t size)
esamples_percent); esamples_percent);
} }
if (top->evlist->nr_entries == 1) { if (top->evlist->core.nr_entries == 1) {
struct evsel *first = perf_evlist__first(top->evlist); struct evsel *first = perf_evlist__first(top->evlist);
ret += SNPRINTF(bf + ret, size - ret, "%" PRIu64 "%s ", ret += SNPRINTF(bf + ret, size - ret, "%" PRIu64 "%s ",
(uint64_t)first->attr.sample_period, (uint64_t)first->attr.sample_period,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment