All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
	David Ahern <dsahern@gmail.com>, Ingo Molnar <mingo@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Noel Grandin <noelgrandin@gmail.com>,
	Adrian Hunter <adrian.hunter@intel.com>
Subject: [PATCH 01/13] perf tools: Remove perf_evlist__(enable|disable)_event functions
Date: Thu,  7 Jan 2016 10:13:58 +0100	[thread overview]
Message-ID: <1452158050-28061-2-git-send-email-jolsa@kernel.org> (raw)
In-Reply-To: <1452158050-28061-1-git-send-email-jolsa@kernel.org>

Replacing them with perf_evsel__(enable|disable).

Link: http://lkml.kernel.org/n/tip-bbyjpha9wc4ifn0ebfkm0mnl@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/arch/x86/util/intel-bts.c |  4 ++--
 tools/perf/arch/x86/util/intel-pt.c  |  4 ++--
 tools/perf/tests/keep-tracking.c     |  2 +-
 tools/perf/tests/switch-tracking.c   |  6 +++---
 tools/perf/util/evlist.c             | 42 ------------------------------------
 tools/perf/util/evlist.h             |  4 ----
 6 files changed, 8 insertions(+), 54 deletions(-)

diff --git a/tools/perf/arch/x86/util/intel-bts.c b/tools/perf/arch/x86/util/intel-bts.c
index 9b94ce520917..8d8150f1cf9b 100644
--- a/tools/perf/arch/x86/util/intel-bts.c
+++ b/tools/perf/arch/x86/util/intel-bts.c
@@ -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;
 }
diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c
index b64d46285ebb..f05daacc9e78 100644
--- a/tools/perf/arch/x86/util/intel-pt.c
+++ b/tools/perf/arch/x86/util/intel-pt.c
@@ -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;
 }
diff --git a/tools/perf/tests/keep-tracking.c b/tools/perf/tests/keep-tracking.c
index a337a6da1f39..7b27943ecfef 100644
--- a/tools/perf/tests/keep-tracking.c
+++ b/tools/perf/tests/keep-tracking.c
@@ -124,7 +124,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));
diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c
index dfbd8d69ce89..ebd80168d51e 100644
--- a/tools/perf/tests/switch-tracking.c
+++ b/tools/perf/tests/switch-tracking.c
@@ -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;
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index b9eac0daa0b9..05efa910a090 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -365,48 +365,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)
 {
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index 139a50038097..25c6c824d870 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -152,10 +152,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);
 
-- 
2.4.3


  reply	other threads:[~2016-01-07  9:14 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-07  9:13 [PATCHv2 00/13] perf tools: Various fixes Jiri Olsa
2016-01-07  9:13 ` Jiri Olsa [this message]
2016-01-09 16:40   ` [tip:perf/core] perf evlist: Remove perf_evlist__(enable|disable) _event functions tip-bot for Jiri Olsa
2016-01-07  9:13 ` [PATCH 02/13] perf tools: Make perf_evlist__open() open evsels with their cpus and threads (like perf record does) Jiri Olsa
2016-01-09 16:40   ` [tip:perf/core] perf evlist: " tip-bot for Adrian Hunter
2016-01-07  9:14 ` [PATCH 03/13] perf tools: Use find_map function in access_dso_mem Jiri Olsa
2016-01-09 16:41   ` [tip:perf/core] perf unwind: " tip-bot for Jiri Olsa
2016-01-07  9:14 ` [PATCH 04/13] perf tools libunwind: Check for mmaps also in MAP__VARIABLE tree Jiri Olsa
2016-01-09 16:41   ` [tip:perf/core] perf unwind: " tip-bot for Jiri Olsa
2016-01-07  9:14 ` [PATCH 05/13] perf tools libdw: " Jiri Olsa
2016-01-09 16:41   ` [tip:perf/core] perf " tip-bot for Jiri Olsa
2016-01-07  9:14 ` [PATCH 06/13] perf record: Store data mmaps for dwarf unwind Jiri Olsa
2016-01-07 11:12   ` Namhyung Kim
2016-01-07 12:39     ` [PATCHv2 " Jiri Olsa
2016-01-07 13:14       ` Namhyung Kim
2016-01-07 13:30         ` [PATCHv3 " Jiri Olsa
2016-01-07 20:42           ` Arnaldo Carvalho de Melo
2016-01-09 16:42           ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-01-07  9:14 ` [PATCH 07/13] perf tools: Do not show trace command if it's not compiled in Jiri Olsa
2016-01-09 16:37   ` [tip:perf/core] perf tools: Do not show trace command if it' s " tip-bot for Jiri Olsa
2016-01-07  9:14 ` [PATCH 08/13] perf script: Align event name properly Jiri Olsa
2016-01-09 16:38   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-01-07  9:14 ` [PATCH 09/13] perf tools: Include all tools/lib directory for tags/cscope/TAGS targets Jiri Olsa
2016-01-09 16:38   ` [tip:perf/core] perf tools: Include all tools/ lib " tip-bot for Jiri Olsa
2016-01-07  9:14 ` [PATCH 10/13] perf tools: Remove list entry from struct sort_entry Jiri Olsa
2016-01-07 11:13   ` Namhyung Kim
2016-01-09 16:38   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-01-07  9:14 ` [PATCH 11/13] perf tools: Add overhead/overhead_children keys defaults via string Jiri Olsa
2016-01-07 11:17   ` Namhyung Kim
2016-01-09 16:39   ` [tip:perf/core] perf tools: Add overhead/ overhead_children " tip-bot for Jiri Olsa
2016-01-07  9:14 ` [PATCH 12/13] perf diff: Use perf_hpp__register_sort_field interface Jiri Olsa
2016-01-07 11:17   ` Namhyung Kim
2016-01-09 16:39   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-01-07  9:14 ` [PATCH 13/13] perf tools: Export a couple of hist functions Jiri Olsa
2016-01-09 16:39   ` [tip:perf/core] perf hists: " tip-bot for Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1452158050-28061-2-git-send-email-jolsa@kernel.org \
    --to=jolsa@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=dsahern@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=noelgrandin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.