perf evsel: Rename perf_evsel__open_per_*() to evsel__open_per_*()

As those are not 'struct evsel' methods, not part of tools/lib/perf/,
aka libperf, to whom the perf_ prefix belongs.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent ad681adf
...@@ -72,7 +72,7 @@ static int attach__current_disabled(struct evlist *evlist) ...@@ -72,7 +72,7 @@ static int attach__current_disabled(struct evlist *evlist)
evsel->core.attr.disabled = 1; evsel->core.attr.disabled = 1;
err = perf_evsel__open_per_thread(evsel, threads); err = evsel__open_per_thread(evsel, threads);
if (err) { if (err) {
pr_debug("Failed to open event cpu-clock:u\n"); pr_debug("Failed to open event cpu-clock:u\n");
return err; return err;
...@@ -96,7 +96,7 @@ static int attach__current_enabled(struct evlist *evlist) ...@@ -96,7 +96,7 @@ static int attach__current_enabled(struct evlist *evlist)
return -1; return -1;
} }
err = perf_evsel__open_per_thread(evsel, threads); err = evsel__open_per_thread(evsel, threads);
perf_thread_map__put(threads); perf_thread_map__put(threads);
return err == 0 ? TEST_OK : TEST_FAIL; return err == 0 ? TEST_OK : TEST_FAIL;
...@@ -125,7 +125,7 @@ static int attach__cpu_disabled(struct evlist *evlist) ...@@ -125,7 +125,7 @@ static int attach__cpu_disabled(struct evlist *evlist)
evsel->core.attr.disabled = 1; evsel->core.attr.disabled = 1;
err = perf_evsel__open_per_cpu(evsel, cpus, -1); err = evsel__open_per_cpu(evsel, cpus, -1);
if (err) { if (err) {
if (err == -EACCES) if (err == -EACCES)
return TEST_SKIP; return TEST_SKIP;
...@@ -152,7 +152,7 @@ static int attach__cpu_enabled(struct evlist *evlist) ...@@ -152,7 +152,7 @@ static int attach__cpu_enabled(struct evlist *evlist)
return -1; return -1;
} }
err = perf_evsel__open_per_cpu(evsel, cpus, -1); err = evsel__open_per_cpu(evsel, cpus, -1);
if (err == -EACCES) if (err == -EACCES)
return TEST_SKIP; return TEST_SKIP;
......
...@@ -34,7 +34,7 @@ int test__openat_syscall_event(struct test *test __maybe_unused, int subtest __m ...@@ -34,7 +34,7 @@ int test__openat_syscall_event(struct test *test __maybe_unused, int subtest __m
goto out_thread_map_delete; goto out_thread_map_delete;
} }
if (perf_evsel__open_per_thread(evsel, threads) < 0) { if (evsel__open_per_thread(evsel, threads) < 0) {
pr_debug("failed to open counter: %s, " pr_debug("failed to open counter: %s, "
"tweak /proc/sys/kernel/perf_event_paranoid?\n", "tweak /proc/sys/kernel/perf_event_paranoid?\n",
str_error_r(errno, sbuf, sizeof(sbuf))); str_error_r(errno, sbuf, sizeof(sbuf)));
......
...@@ -1863,9 +1863,7 @@ void evsel__close(struct evsel *evsel) ...@@ -1863,9 +1863,7 @@ void evsel__close(struct evsel *evsel)
perf_evsel__free_id(&evsel->core); perf_evsel__free_id(&evsel->core);
} }
int perf_evsel__open_per_cpu(struct evsel *evsel, int evsel__open_per_cpu(struct evsel *evsel, struct perf_cpu_map *cpus, int cpu)
struct perf_cpu_map *cpus,
int cpu)
{ {
if (cpu == -1) if (cpu == -1)
return evsel__open_cpu(evsel, cpus, NULL, 0, return evsel__open_cpu(evsel, cpus, NULL, 0,
...@@ -1874,8 +1872,7 @@ int perf_evsel__open_per_cpu(struct evsel *evsel, ...@@ -1874,8 +1872,7 @@ int perf_evsel__open_per_cpu(struct evsel *evsel,
return evsel__open_cpu(evsel, cpus, NULL, cpu, cpu + 1); return evsel__open_cpu(evsel, cpus, NULL, cpu, cpu + 1);
} }
int perf_evsel__open_per_thread(struct evsel *evsel, int evsel__open_per_thread(struct evsel *evsel, struct perf_thread_map *threads)
struct perf_thread_map *threads)
{ {
return evsel__open(evsel, NULL, threads); return evsel__open(evsel, NULL, threads);
} }
......
...@@ -233,11 +233,8 @@ int evsel__enable(struct evsel *evsel); ...@@ -233,11 +233,8 @@ int evsel__enable(struct evsel *evsel);
int evsel__disable(struct evsel *evsel); int evsel__disable(struct evsel *evsel);
int evsel__disable_cpu(struct evsel *evsel, int cpu); int evsel__disable_cpu(struct evsel *evsel, int cpu);
int perf_evsel__open_per_cpu(struct evsel *evsel, int evsel__open_per_cpu(struct evsel *evsel, struct perf_cpu_map *cpus, int cpu);
struct perf_cpu_map *cpus, int evsel__open_per_thread(struct evsel *evsel, struct perf_thread_map *threads);
int cpu);
int perf_evsel__open_per_thread(struct evsel *evsel,
struct perf_thread_map *threads);
int evsel__open(struct evsel *evsel, struct perf_cpu_map *cpus, int evsel__open(struct evsel *evsel, struct perf_cpu_map *cpus,
struct perf_thread_map *threads); struct perf_thread_map *threads);
void evsel__close(struct evsel *evsel); void evsel__close(struct evsel *evsel);
......
...@@ -521,7 +521,7 @@ int create_perf_stat_counter(struct evsel *evsel, ...@@ -521,7 +521,7 @@ int create_perf_stat_counter(struct evsel *evsel,
} }
if (target__has_cpu(target) && !target__has_per_thread(target)) if (target__has_cpu(target) && !target__has_per_thread(target))
return perf_evsel__open_per_cpu(evsel, evsel__cpus(evsel), cpu); return evsel__open_per_cpu(evsel, evsel__cpus(evsel), cpu);
return perf_evsel__open_per_thread(evsel, evsel->core.threads); return evsel__open_per_thread(evsel, evsel->core.threads);
} }
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