perf evlist: Remove perf_evlist__(enable|disable)_event functions
authorJiri Olsa <jolsa@kernel.org>
Thu, 7 Jan 2016 09:13:58 +0000 (10:13 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 8 Jan 2016 17:15:43 +0000 (14:15 -0300)
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>
tools/perf/arch/x86/util/intel-bts.c
tools/perf/arch/x86/util/intel-pt.c
tools/perf/tests/keep-tracking.c
tools/perf/tests/switch-tracking.c
tools/perf/util/evlist.c
tools/perf/util/evlist.h

index 9b94ce5209170fcb6105723aea00bf1214fc4032..8d8150f1cf9bcf426b4c29a19170221db680a980 100644 (file)
@@ -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;
 }
index b64d46285ebb4e9434778ff159618eb3e32d1fc4..f05daacc9e7810117cfe25415a75990b3aa89f63 100644 (file)
@@ -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;
 }
index 6158132783346fc8d2423d1334d6a918846885ac..ddb78fae064a50ca1d43476b29c7b5ff7ee2e7b3 100644 (file)
@@ -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));
index dfbd8d69ce896154993b2ca0bf13b61b4abe6a0f..ebd80168d51e853a29e0f34d93e4dad1812b417b 100644 (file)
@@ -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;
index 29e085b2e168ba256e308338f79bfefd74d6e15f..d81f13de24769963f6c32c3f809a714e6868dc5e 100644 (file)
@@ -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)
 {
index 3b7e1e2f1a868b14666aee4ec02d8faf178dc4b9..7c4d9a2067769b0e3de2d96a11e6f7dd7d62106a 100644 (file)
@@ -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);