forked from luck/tmp_suning_uos_patched
perf evlist: Fix the class prefix for 'struct evlist' 'add' evsel methods
To differentiate from libperf's 'struct perf_evlist' methods. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
ce0dc7d222
commit
e251abee87
|
@ -1319,7 +1319,7 @@ static struct evlist *kvm_live_event_list(void)
|
|||
*name = '\0';
|
||||
name++;
|
||||
|
||||
if (perf_evlist__add_newtp(evlist, sys, name, NULL)) {
|
||||
if (evlist__add_newtp(evlist, sys, name, NULL)) {
|
||||
pr_err("Failed to add %s tracepoint to the list\n", *events_tp);
|
||||
free(tp);
|
||||
goto out;
|
||||
|
|
|
@ -852,7 +852,7 @@ static int record__open(struct record *rec)
|
|||
* event synthesis.
|
||||
*/
|
||||
if (opts->initial_delay || target__has_cpu(&opts->target)) {
|
||||
if (perf_evlist__add_dummy(evlist))
|
||||
if (evlist__add_dummy(evlist))
|
||||
return -ENOMEM;
|
||||
|
||||
/* Disable tracking of mmaps on lead event. */
|
||||
|
@ -2722,7 +2722,7 @@ int cmd_record(int argc, const char **argv)
|
|||
record.opts.tail_synthesize = true;
|
||||
|
||||
if (rec->evlist->core.nr_entries == 0 &&
|
||||
__perf_evlist__add_default(rec->evlist, !record.opts.no_samples) < 0) {
|
||||
__evlist__add_default(rec->evlist, !record.opts.no_samples) < 0) {
|
||||
pr_err("Not enough memory for event selector list\n");
|
||||
goto out;
|
||||
}
|
||||
|
|
|
@ -1679,19 +1679,17 @@ static int add_default_attributes(void)
|
|||
if (target__has_cpu(&target))
|
||||
default_attrs0[0].config = PERF_COUNT_SW_CPU_CLOCK;
|
||||
|
||||
if (perf_evlist__add_default_attrs(evsel_list, default_attrs0) < 0)
|
||||
if (evlist__add_default_attrs(evsel_list, default_attrs0) < 0)
|
||||
return -1;
|
||||
if (pmu_have_event("cpu", "stalled-cycles-frontend")) {
|
||||
if (perf_evlist__add_default_attrs(evsel_list,
|
||||
frontend_attrs) < 0)
|
||||
if (evlist__add_default_attrs(evsel_list, frontend_attrs) < 0)
|
||||
return -1;
|
||||
}
|
||||
if (pmu_have_event("cpu", "stalled-cycles-backend")) {
|
||||
if (perf_evlist__add_default_attrs(evsel_list,
|
||||
backend_attrs) < 0)
|
||||
if (evlist__add_default_attrs(evsel_list, backend_attrs) < 0)
|
||||
return -1;
|
||||
}
|
||||
if (perf_evlist__add_default_attrs(evsel_list, default_attrs1) < 0)
|
||||
if (evlist__add_default_attrs(evsel_list, default_attrs1) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1701,21 +1699,21 @@ static int add_default_attributes(void)
|
|||
return 0;
|
||||
|
||||
/* Append detailed run extra attributes: */
|
||||
if (perf_evlist__add_default_attrs(evsel_list, detailed_attrs) < 0)
|
||||
if (evlist__add_default_attrs(evsel_list, detailed_attrs) < 0)
|
||||
return -1;
|
||||
|
||||
if (detailed_run < 2)
|
||||
return 0;
|
||||
|
||||
/* Append very detailed run extra attributes: */
|
||||
if (perf_evlist__add_default_attrs(evsel_list, very_detailed_attrs) < 0)
|
||||
if (evlist__add_default_attrs(evsel_list, very_detailed_attrs) < 0)
|
||||
return -1;
|
||||
|
||||
if (detailed_run < 3)
|
||||
return 0;
|
||||
|
||||
/* Append very, very detailed run extra attributes: */
|
||||
return perf_evlist__add_default_attrs(evsel_list, very_very_detailed_attrs);
|
||||
return evlist__add_default_attrs(evsel_list, very_very_detailed_attrs);
|
||||
}
|
||||
|
||||
static const char * const stat_record_usage[] = {
|
||||
|
|
|
@ -1627,7 +1627,7 @@ int cmd_top(int argc, const char **argv)
|
|||
goto out_delete_evlist;
|
||||
|
||||
if (!top.evlist->core.nr_entries &&
|
||||
perf_evlist__add_default(top.evlist) < 0) {
|
||||
evlist__add_default(top.evlist) < 0) {
|
||||
pr_err("Not enough memory for event selector list\n");
|
||||
goto out_delete_evlist;
|
||||
}
|
||||
|
|
|
@ -3917,8 +3917,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
|
|||
}
|
||||
|
||||
if (trace->sched &&
|
||||
perf_evlist__add_newtp(evlist, "sched", "sched_stat_runtime",
|
||||
trace__sched_stat_runtime))
|
||||
evlist__add_newtp(evlist, "sched", "sched_stat_runtime", trace__sched_stat_runtime))
|
||||
goto out_error_sched_stat_runtime;
|
||||
/*
|
||||
* If a global cgroup was set, apply it to all the events without an
|
||||
|
|
|
@ -79,7 +79,7 @@ struct evlist *perf_evlist__new_default(void)
|
|||
{
|
||||
struct evlist *evlist = evlist__new();
|
||||
|
||||
if (evlist && perf_evlist__add_default(evlist)) {
|
||||
if (evlist && evlist__add_default(evlist)) {
|
||||
evlist__delete(evlist);
|
||||
evlist = NULL;
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ struct evlist *perf_evlist__new_dummy(void)
|
|||
{
|
||||
struct evlist *evlist = evlist__new();
|
||||
|
||||
if (evlist && perf_evlist__add_dummy(evlist)) {
|
||||
if (evlist && evlist__add_dummy(evlist)) {
|
||||
evlist__delete(evlist);
|
||||
evlist = NULL;
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ void perf_evlist__set_leader(struct evlist *evlist)
|
|||
}
|
||||
}
|
||||
|
||||
int __perf_evlist__add_default(struct evlist *evlist, bool precise)
|
||||
int __evlist__add_default(struct evlist *evlist, bool precise)
|
||||
{
|
||||
struct evsel *evsel = evsel__new_cycles(precise);
|
||||
|
||||
|
@ -242,7 +242,7 @@ int __perf_evlist__add_default(struct evlist *evlist, bool precise)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int perf_evlist__add_dummy(struct evlist *evlist)
|
||||
int evlist__add_dummy(struct evlist *evlist)
|
||||
{
|
||||
struct perf_event_attr attr = {
|
||||
.type = PERF_TYPE_SOFTWARE,
|
||||
|
@ -258,8 +258,7 @@ int perf_evlist__add_dummy(struct evlist *evlist)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int evlist__add_attrs(struct evlist *evlist,
|
||||
struct perf_event_attr *attrs, size_t nr_attrs)
|
||||
static int evlist__add_attrs(struct evlist *evlist, struct perf_event_attr *attrs, size_t nr_attrs)
|
||||
{
|
||||
struct evsel *evsel, *n;
|
||||
LIST_HEAD(head);
|
||||
|
@ -282,8 +281,7 @@ static int evlist__add_attrs(struct evlist *evlist,
|
|||
return -1;
|
||||
}
|
||||
|
||||
int __perf_evlist__add_default_attrs(struct evlist *evlist,
|
||||
struct perf_event_attr *attrs, size_t nr_attrs)
|
||||
int __evlist__add_default_attrs(struct evlist *evlist, struct perf_event_attr *attrs, size_t nr_attrs)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
|
@ -322,8 +320,7 @@ perf_evlist__find_tracepoint_by_name(struct evlist *evlist,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
int perf_evlist__add_newtp(struct evlist *evlist,
|
||||
const char *sys, const char *name, void *handler)
|
||||
int evlist__add_newtp(struct evlist *evlist, const char *sys, const char *name, void *handler)
|
||||
{
|
||||
struct evsel *evsel = evsel__newtp(sys, name);
|
||||
|
||||
|
|
|
@ -92,20 +92,20 @@ void evlist__delete(struct evlist *evlist);
|
|||
void evlist__add(struct evlist *evlist, struct evsel *entry);
|
||||
void evlist__remove(struct evlist *evlist, struct evsel *evsel);
|
||||
|
||||
int __perf_evlist__add_default(struct evlist *evlist, bool precise);
|
||||
int __evlist__add_default(struct evlist *evlist, bool precise);
|
||||
|
||||
static inline int perf_evlist__add_default(struct evlist *evlist)
|
||||
static inline int evlist__add_default(struct evlist *evlist)
|
||||
{
|
||||
return __perf_evlist__add_default(evlist, true);
|
||||
return __evlist__add_default(evlist, true);
|
||||
}
|
||||
|
||||
int __perf_evlist__add_default_attrs(struct evlist *evlist,
|
||||
int __evlist__add_default_attrs(struct evlist *evlist,
|
||||
struct perf_event_attr *attrs, size_t nr_attrs);
|
||||
|
||||
#define perf_evlist__add_default_attrs(evlist, array) \
|
||||
__perf_evlist__add_default_attrs(evlist, array, ARRAY_SIZE(array))
|
||||
#define evlist__add_default_attrs(evlist, array) \
|
||||
__evlist__add_default_attrs(evlist, array, ARRAY_SIZE(array))
|
||||
|
||||
int perf_evlist__add_dummy(struct evlist *evlist);
|
||||
int evlist__add_dummy(struct evlist *evlist);
|
||||
|
||||
int perf_evlist__add_sb_event(struct evlist *evlist,
|
||||
struct perf_event_attr *attr,
|
||||
|
@ -116,8 +116,7 @@ int perf_evlist__start_sb_thread(struct evlist *evlist,
|
|||
struct target *target);
|
||||
void perf_evlist__stop_sb_thread(struct evlist *evlist);
|
||||
|
||||
int perf_evlist__add_newtp(struct evlist *evlist,
|
||||
const char *sys, const char *name, void *handler);
|
||||
int evlist__add_newtp(struct evlist *evlist, const char *sys, const char *name, void *handler);
|
||||
|
||||
int __evlist__set_tracepoints_handlers(struct evlist *evlist,
|
||||
const struct evsel_str_handler *assocs,
|
||||
|
|
Loading…
Reference in New Issue
Block a user