mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-17 01:34:00 +08:00
perf evlist: Remove perf_evlist__(enable|disable)_event functions
Replacing them with perf_evsel__(enable|disable). Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Noel Grandin <noelgrandin@gmail.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1452158050-28061-2-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
23df7f7984
commit
d2190a8091
@ -327,7 +327,7 @@ static int intel_bts_snapshot_start(struct auxtrace_record *itr)
|
||||
|
||||
evlist__for_each(btsr->evlist, evsel) {
|
||||
if (evsel->attr.type == btsr->intel_bts_pmu->type)
|
||||
return perf_evlist__disable_event(btsr->evlist, evsel);
|
||||
return perf_evsel__disable(evsel);
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
@ -340,7 +340,7 @@ static int intel_bts_snapshot_finish(struct auxtrace_record *itr)
|
||||
|
||||
evlist__for_each(btsr->evlist, evsel) {
|
||||
if (evsel->attr.type == btsr->intel_bts_pmu->type)
|
||||
return perf_evlist__enable_event(btsr->evlist, evsel);
|
||||
return perf_evsel__enable(evsel);
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -725,7 +725,7 @@ static int intel_pt_snapshot_start(struct auxtrace_record *itr)
|
||||
|
||||
evlist__for_each(ptr->evlist, evsel) {
|
||||
if (evsel->attr.type == ptr->intel_pt_pmu->type)
|
||||
return perf_evlist__disable_event(ptr->evlist, evsel);
|
||||
return perf_evsel__disable(evsel);
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
@ -738,7 +738,7 @@ static int intel_pt_snapshot_finish(struct auxtrace_record *itr)
|
||||
|
||||
evlist__for_each(ptr->evlist, evsel) {
|
||||
if (evsel->attr.type == ptr->intel_pt_pmu->type)
|
||||
return perf_evlist__enable_event(ptr->evlist, evsel);
|
||||
return perf_evsel__enable(evsel);
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ int test__keep_tracking(int subtest __maybe_unused)
|
||||
|
||||
evsel = perf_evlist__last(evlist);
|
||||
|
||||
CHECK__(perf_evlist__disable_event(evlist, evsel));
|
||||
CHECK__(perf_evsel__disable(evsel));
|
||||
|
||||
comm = "Test COMM 2";
|
||||
CHECK__(prctl(PR_SET_NAME, (unsigned long)comm, 0, 0, 0));
|
||||
|
@ -455,7 +455,7 @@ int test__switch_tracking(int subtest __maybe_unused)
|
||||
|
||||
perf_evlist__enable(evlist);
|
||||
|
||||
err = perf_evlist__disable_event(evlist, cpu_clocks_evsel);
|
||||
err = perf_evsel__disable(cpu_clocks_evsel);
|
||||
if (err) {
|
||||
pr_debug("perf_evlist__disable_event failed!\n");
|
||||
goto out_err;
|
||||
@ -474,7 +474,7 @@ int test__switch_tracking(int subtest __maybe_unused)
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
err = perf_evlist__disable_event(evlist, cycles_evsel);
|
||||
err = perf_evsel__disable(cycles_evsel);
|
||||
if (err) {
|
||||
pr_debug("perf_evlist__disable_event failed!\n");
|
||||
goto out_err;
|
||||
@ -500,7 +500,7 @@ int test__switch_tracking(int subtest __maybe_unused)
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
err = perf_evlist__enable_event(evlist, cycles_evsel);
|
||||
err = perf_evsel__enable(cycles_evsel);
|
||||
if (err) {
|
||||
pr_debug("perf_evlist__disable_event failed!\n");
|
||||
goto out_err;
|
||||
|
@ -393,48 +393,6 @@ void perf_evlist__toggle_enable(struct perf_evlist *evlist)
|
||||
(evlist->enabled ? perf_evlist__disable : perf_evlist__enable)(evlist);
|
||||
}
|
||||
|
||||
int perf_evlist__disable_event(struct perf_evlist *evlist,
|
||||
struct perf_evsel *evsel)
|
||||
{
|
||||
int cpu, thread, err;
|
||||
int nr_cpus = cpu_map__nr(evlist->cpus);
|
||||
int nr_threads = perf_evlist__nr_threads(evlist, evsel);
|
||||
|
||||
if (!evsel->fd)
|
||||
return 0;
|
||||
|
||||
for (cpu = 0; cpu < nr_cpus; cpu++) {
|
||||
for (thread = 0; thread < nr_threads; thread++) {
|
||||
err = ioctl(FD(evsel, cpu, thread),
|
||||
PERF_EVENT_IOC_DISABLE, 0);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int perf_evlist__enable_event(struct perf_evlist *evlist,
|
||||
struct perf_evsel *evsel)
|
||||
{
|
||||
int cpu, thread, err;
|
||||
int nr_cpus = cpu_map__nr(evlist->cpus);
|
||||
int nr_threads = perf_evlist__nr_threads(evlist, evsel);
|
||||
|
||||
if (!evsel->fd)
|
||||
return -EINVAL;
|
||||
|
||||
for (cpu = 0; cpu < nr_cpus; cpu++) {
|
||||
for (thread = 0; thread < nr_threads; thread++) {
|
||||
err = ioctl(FD(evsel, cpu, thread),
|
||||
PERF_EVENT_IOC_ENABLE, 0);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int perf_evlist__enable_event_cpu(struct perf_evlist *evlist,
|
||||
struct perf_evsel *evsel, int cpu)
|
||||
{
|
||||
|
@ -155,10 +155,6 @@ void perf_evlist__disable(struct perf_evlist *evlist);
|
||||
void perf_evlist__enable(struct perf_evlist *evlist);
|
||||
void perf_evlist__toggle_enable(struct perf_evlist *evlist);
|
||||
|
||||
int perf_evlist__disable_event(struct perf_evlist *evlist,
|
||||
struct perf_evsel *evsel);
|
||||
int perf_evlist__enable_event(struct perf_evlist *evlist,
|
||||
struct perf_evsel *evsel);
|
||||
int perf_evlist__enable_event_idx(struct perf_evlist *evlist,
|
||||
struct perf_evsel *evsel, int idx);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user