All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Jiri Olsa <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: noelgrandin@gmail.com, acme@redhat.com,
	linux-kernel@vger.kernel.org, hpa@zytor.com, dsahern@gmail.com,
	a.p.zijlstra@chello.nl, mingo@kernel.org, jolsa@kernel.org,
	namhyung@kernel.org, tglx@linutronix.de, adrian.hunter@intel.com
Subject: [tip:perf/core] perf evlist: Remove perf_evlist__(enable|disable) _event functions
Date: Sat, 9 Jan 2016 08:40:49 -0800	[thread overview]
Message-ID: <tip-d2190a8091124f832c8862ace3a3d7d70a2506a5@git.kernel.org> (raw)
In-Reply-To: <1452158050-28061-2-git-send-email-jolsa@kernel.org>

Commit-ID:  d2190a8091124f832c8862ace3a3d7d70a2506a5
Gitweb:     http://git.kernel.org/tip/d2190a8091124f832c8862ace3a3d7d70a2506a5
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Thu, 7 Jan 2016 10:13:58 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 8 Jan 2016 14:15:43 -0300

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>
---
 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 9b94ce5..8d8150f 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 b64d462..f05daac 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 6158132..ddb78fa 100644
--- a/tools/perf/tests/keep-tracking.c
+++ b/tools/perf/tests/keep-tracking.c
@@ -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));
diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c
index dfbd8d6..ebd8016 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 29e085b2..d81f13d 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -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)
 {
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index 3b7e1e2..7c4d9a2 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -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);
 

  reply	other threads:[~2016-01-09 16:41 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 ` [PATCH 01/13] perf tools: Remove perf_evlist__(enable|disable)_event functions Jiri Olsa
2016-01-09 16:40   ` tip-bot for Jiri Olsa [this message]
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=tip-d2190a8091124f832c8862ace3a3d7d70a2506a5@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=dsahern@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=noelgrandin@gmail.com \
    --cc=tglx@linutronix.de \
    /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.