OSDN Git Service

perf evlist: Use the right prefix for 'struct evlist' event attribute config methods
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 30 Nov 2020 18:07:49 +0000 (15:07 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 30 Nov 2020 18:15:27 +0000 (15:15 -0300)
perf_evlist__ is for 'struct perf_evlist' methods, in tools/lib/perf/,
go on completing this split.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
17 files changed:
tools/perf/builtin-kvm.c
tools/perf/builtin-record.c
tools/perf/builtin-report.c
tools/perf/builtin-top.c
tools/perf/builtin-trace.c
tools/perf/tests/backward-ring-buffer.c
tools/perf/tests/bpf.c
tools/perf/tests/code-reading.c
tools/perf/tests/keep-tracking.c
tools/perf/tests/parse-events.c
tools/perf/tests/perf-record.c
tools/perf/tests/perf-time-to-tsc.c
tools/perf/tests/switch-tracking.c
tools/perf/util/evlist.c
tools/perf/util/evlist.h
tools/perf/util/record.c
tools/perf/util/session.c

index 7560d6b..6161251 100644 (file)
@@ -1022,7 +1022,7 @@ static int kvm_live_open_events(struct perf_kvm_stat *kvm)
        struct evlist *evlist = kvm->evlist;
        char sbuf[STRERR_BUFSIZE];
 
-       perf_evlist__config(evlist, &kvm->opts, NULL);
+       evlist__config(evlist, &kvm->opts, NULL);
 
        /*
         * Note: exclude_{guest,host} do not apply here.
index 4127174..2a73241 100644 (file)
@@ -910,7 +910,7 @@ static int record__open(struct record *rec)
                        pos->immediate = 1;
        }
 
-       perf_evlist__config(evlist, opts, &callchain_param);
+       evlist__config(evlist, opts, &callchain_param);
 
        evlist__for_each_entry(evlist, pos) {
 try_again:
@@ -935,7 +935,7 @@ try_again:
                pos->supported = true;
        }
 
-       if (symbol_conf.kptr_restrict && !perf_evlist__exclude_kernel(evlist)) {
+       if (symbol_conf.kptr_restrict && !evlist__exclude_kernel(evlist)) {
                pr_warning(
 "WARNING: Kernel address maps (/proc/{kallsyms,modules}) are restricted,\n"
 "check /proc/sys/kernel/kptr_restrict and /proc/sys/kernel/perf_event_paranoid.\n\n"
@@ -1444,7 +1444,7 @@ static int record__synthesize(struct record *rec, bool tail)
                        goto out;
        }
 
-       if (!perf_evlist__exclude_kernel(rec->evlist)) {
+       if (!evlist__exclude_kernel(rec->evlist)) {
                err = perf_event__synthesize_kernel_mmap(tool, process_synthesized_event,
                                                         machine);
                WARN_ONCE(err < 0, "Couldn't record kernel reference relocation symbol\n"
index e78614a..5efbd06 100644 (file)
@@ -563,7 +563,7 @@ static void report__warn_kptr_restrict(const struct report *rep)
        struct map *kernel_map = machine__kernel_map(&rep->session->machines.host);
        struct kmap *kernel_kmap = kernel_map ? map__kmap(kernel_map) : NULL;
 
-       if (perf_evlist__exclude_kernel(rep->session->evlist))
+       if (evlist__exclude_kernel(rep->session->evlist))
                return;
 
        if (kernel_map == NULL ||
index 51600f6..f65aa1c 100644 (file)
@@ -779,7 +779,7 @@ static void perf_event__process_sample(struct perf_tool *tool,
        if (!machine->kptr_restrict_warned &&
            symbol_conf.kptr_restrict &&
            al.cpumode == PERF_RECORD_MISC_KERNEL) {
-               if (!perf_evlist__exclude_kernel(top->session->evlist)) {
+               if (!evlist__exclude_kernel(top->session->evlist)) {
                        ui__warning(
 "Kernel address maps (/proc/{kallsyms,modules}) are restricted.\n\n"
 "Check /proc/sys/kernel/kptr_restrict and /proc/sys/kernel/perf_event_paranoid.\n\n"
@@ -1022,7 +1022,7 @@ static int perf_top__start_counters(struct perf_top *top)
                goto out_err;
        }
 
-       perf_evlist__config(evlist, opts, &callchain_param);
+       evlist__config(evlist, opts, &callchain_param);
 
        evlist__for_each_entry(evlist, counter) {
 try_again:
index ebf4fe9..fa7d57f 100644 (file)
@@ -3962,7 +3962,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
                goto out_delete_evlist;
        }
 
-       perf_evlist__config(evlist, &trace->opts, &callchain_param);
+       evlist__config(evlist, &trace->opts, &callchain_param);
 
        signal(SIGCHLD, sig_handler);
        signal(SIGINT, sig_handler);
index f00f7f3..b4b9a94 100644 (file)
@@ -127,7 +127,7 @@ int test__backward_ring_buffer(struct test *test __maybe_unused, int subtest __m
                goto out_delete_evlist;
        }
 
-       perf_evlist__config(evlist, &opts, NULL);
+       evlist__config(evlist, &opts, NULL);
 
        err = evlist__open(evlist);
        if (err < 0) {
index 22d7f56..f57e075 100644 (file)
@@ -160,7 +160,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
        evlist__splice_list_tail(evlist, &parse_state.list);
        evlist->nr_groups = parse_state.nr_groups;
 
-       perf_evlist__config(evlist, &opts, NULL);
+       evlist__config(evlist, &opts, NULL);
 
        err = evlist__open(evlist);
        if (err < 0) {
index 0c494aa..7c098d4 100644 (file)
@@ -651,7 +651,7 @@ static int do_test_code_reading(bool try_kcore)
                        goto out_put;
                }
 
-               perf_evlist__config(evlist, &opts, NULL);
+               evlist__config(evlist, &opts, NULL);
 
                evsel = evlist__first(evlist);
 
index 50a0c9f..e6f1b2a 100644 (file)
@@ -92,7 +92,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
        CHECK__(parse_events(evlist, "dummy:u", NULL));
        CHECK__(parse_events(evlist, "cycles:u", NULL));
 
-       perf_evlist__config(evlist, &opts, NULL);
+       evlist__config(evlist, &opts, NULL);
 
        evsel = evlist__first(evlist);
 
index 611512f..a7f6661 100644 (file)
@@ -115,7 +115,7 @@ static int test__checkevent_symbolic_name_config(struct evlist *evlist)
        TEST_ASSERT_VAL("wrong config",
                        PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config);
        /*
-        * The period value gets configured within perf_evlist__config,
+        * The period value gets configured within evlist__config,
         * while this test executes only parse events method.
         */
        TEST_ASSERT_VAL("wrong period",
@@ -443,7 +443,7 @@ static int test__checkevent_pmu(struct evlist *evlist)
        TEST_ASSERT_VAL("wrong config1",    1 == evsel->core.attr.config1);
        TEST_ASSERT_VAL("wrong config2",    3 == evsel->core.attr.config2);
        /*
-        * The period value gets configured within perf_evlist__config,
+        * The period value gets configured within evlist__config,
         * while this test executes only parse events method.
         */
        TEST_ASSERT_VAL("wrong period",     0 == evsel->core.attr.sample_period);
@@ -520,8 +520,7 @@ static int test__checkevent_pmu_partial_time_callgraph(struct evlist *evlist)
        TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type);
        TEST_ASSERT_VAL("wrong config",  1 == evsel->core.attr.config);
        /*
-        * The period, time and callgraph value gets configured
-        * within perf_evlist__config,
+        * The period, time and callgraph value gets configured within evlist__config,
         * while this test executes only parse events method.
         */
        TEST_ASSERT_VAL("wrong period",     0 == evsel->core.attr.sample_period);
@@ -533,8 +532,7 @@ static int test__checkevent_pmu_partial_time_callgraph(struct evlist *evlist)
        TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type);
        TEST_ASSERT_VAL("wrong config",  2 == evsel->core.attr.config);
        /*
-        * The period, time and callgraph value gets configured
-        * within perf_evlist__config,
+        * The period, time and callgraph value gets configured within evlist__config,
         * while this test executes only parse events method.
         */
        TEST_ASSERT_VAL("wrong period",     0 == evsel->core.attr.sample_period);
index 61d1ff3..0df471b 100644 (file)
@@ -109,7 +109,7 @@ int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unus
        evsel__set_sample_bit(evsel, CPU);
        evsel__set_sample_bit(evsel, TID);
        evsel__set_sample_bit(evsel, TIME);
-       perf_evlist__config(evlist, &opts, NULL);
+       evlist__config(evlist, &opts, NULL);
 
        err = sched__get_first_possible_cpu(evlist->workload.pid, &cpu_mask);
        if (err < 0) {
index a9560e0..7cff026 100644 (file)
@@ -80,7 +80,7 @@ int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest __maybe
 
        CHECK__(parse_events(evlist, "cycles:u", NULL));
 
-       perf_evlist__config(evlist, &opts, NULL);
+       evlist__config(evlist, &opts, NULL);
 
        evsel = evlist__first(evlist);
 
index a4cf5ee..15a2ab7 100644 (file)
@@ -432,7 +432,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
        evsel__set_sample_bit(tracking_evsel, TIME);
 
        /* Config events */
-       perf_evlist__config(evlist, &opts, NULL);
+       evlist__config(evlist, &opts, NULL);
 
        /* Check moved event is still at the front */
        if (cycles_evsel != evlist__first(evlist)) {
index 70b5b6e..7ca92a5 100644 (file)
@@ -1110,7 +1110,7 @@ u64 evlist__combined_branch_type(struct evlist *evlist)
        return branch_type;
 }
 
-bool perf_evlist__valid_read_format(struct evlist *evlist)
+bool evlist__valid_read_format(struct evlist *evlist)
 {
        struct evsel *first = evlist__first(evlist), *pos = first;
        u64 read_format = first->core.attr.read_format;
@@ -1632,7 +1632,7 @@ state_err:
        return;
 }
 
-bool perf_evlist__exclude_kernel(struct evlist *evlist)
+bool evlist__exclude_kernel(struct evlist *evlist)
 {
        struct evsel *evsel;
 
index 9e73d4a..ebc4550 100644 (file)
@@ -159,8 +159,7 @@ void evlist__close(struct evlist *evlist);
 struct callchain_param;
 
 void evlist__set_id_pos(struct evlist *evlist);
-void perf_evlist__config(struct evlist *evlist, struct record_opts *opts,
-                        struct callchain_param *callchain);
+void evlist__config(struct evlist *evlist, struct record_opts *opts, struct callchain_param *callchain);
 int record_opts__config(struct record_opts *opts);
 
 int evlist__prepare_workload(struct evlist *evlist, struct target *target,
@@ -211,7 +210,7 @@ int evlist__parse_sample_timestamp(struct evlist *evlist, union perf_event *even
 
 bool evlist__valid_sample_type(struct evlist *evlist);
 bool evlist__valid_sample_id_all(struct evlist *evlist);
-bool perf_evlist__valid_read_format(struct evlist *evlist);
+bool evlist__valid_read_format(struct evlist *evlist);
 
 void evlist__splice_list_tail(struct evlist *evlist, struct list_head *list);
 
@@ -321,7 +320,7 @@ struct evsel *evlist__find_evsel_by_str(struct evlist *evlist, const char *str);
 
 struct evsel *evlist__event2evsel(struct evlist *evlist, union perf_event *event);
 
-bool perf_evlist__exclude_kernel(struct evlist *evlist);
+bool evlist__exclude_kernel(struct evlist *evlist);
 
 void evlist__force_leader(struct evlist *evlist);
 
index f72c8e0..e70c9dd 100644 (file)
@@ -89,8 +89,7 @@ static void evsel__config_leader_sampling(struct evsel *evsel, struct evlist *ev
                            leader->core.attr.sample_type;
 }
 
-void perf_evlist__config(struct evlist *evlist, struct record_opts *opts,
-                        struct callchain_param *callchain)
+void evlist__config(struct evlist *evlist, struct record_opts *opts, struct callchain_param *callchain)
 {
        struct evsel *evsel;
        bool use_sample_identifier = false;
index 6707a01..bf10576 100644 (file)
@@ -125,7 +125,7 @@ static int perf_session__open(struct perf_session *session)
                return -1;
        }
 
-       if (!perf_evlist__valid_read_format(session->evlist)) {
+       if (!evlist__valid_read_format(session->evlist)) {
                pr_err("non matching read_format\n");
                return -1;
        }