All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: peterz@infradead.org, acme@kernel.org
Cc: mingo@redhat.com, tglx@linutronix.de,
	alexander.shishkin@linux.intel.com, schwidefsky@de.ibm.com,
	heiko.carstens@de.ibm.com, will.deacon@arm.com,
	mark.rutland@arm.com, jolsa@redhat.com, namhyung@kernel.org,
	adrian.hunter@intel.com, ast@kernel.org,
	gregkh@linuxfoundation.org, hpa@zytor.com,
	mathieu.poirier@linaro.org, linux-s390@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/6] perf tools: Use ioctl to communicate driver configuration to kernel
Date: Mon,  2 Jul 2018 16:33:25 -0600	[thread overview]
Message-ID: <1530570810-28929-2-git-send-email-mathieu.poirier@linaro.org> (raw)
In-Reply-To: <1530570810-28929-1-git-send-email-mathieu.poirier@linaro.org>

Following in the footsteps of what was done for filters, adding the
necessary mechanic needed to push down driver specific configuration
to the kernel using an ioctl. By proceeding this way PMU specific
configuration can be communicated to each event.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
 include/uapi/linux/perf_event.h       | 1 +
 tools/include/uapi/linux/perf_event.h | 1 +
 tools/perf/util/evsel.c               | 7 +++++++
 tools/perf/util/evsel.h               | 1 +
 4 files changed, 10 insertions(+)

diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
index b8e288a1f740..b5b3241877df 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -460,6 +460,7 @@ struct perf_event_query_bpf {
 #define PERF_EVENT_IOC_PAUSE_OUTPUT		_IOW('$', 9, __u32)
 #define PERF_EVENT_IOC_QUERY_BPF		_IOWR('$', 10, struct perf_event_query_bpf *)
 #define PERF_EVENT_IOC_MODIFY_ATTRIBUTES	_IOW('$', 11, struct perf_event_attr *)
+#define PERF_EVENT_IOC_SET_DRV_CONFIG		_IOW('$', 12, char *)
 
 enum perf_event_ioc_flags {
 	PERF_IOC_FLAG_GROUP		= 1U << 0,
diff --git a/tools/include/uapi/linux/perf_event.h b/tools/include/uapi/linux/perf_event.h
index b8e288a1f740..b5b3241877df 100644
--- a/tools/include/uapi/linux/perf_event.h
+++ b/tools/include/uapi/linux/perf_event.h
@@ -460,6 +460,7 @@ struct perf_event_query_bpf {
 #define PERF_EVENT_IOC_PAUSE_OUTPUT		_IOW('$', 9, __u32)
 #define PERF_EVENT_IOC_QUERY_BPF		_IOWR('$', 10, struct perf_event_query_bpf *)
 #define PERF_EVENT_IOC_MODIFY_ATTRIBUTES	_IOW('$', 11, struct perf_event_attr *)
+#define PERF_EVENT_IOC_SET_DRV_CONFIG		_IOW('$', 12, char *)
 
 enum perf_event_ioc_flags {
 	PERF_IOC_FLAG_GROUP		= 1U << 0,
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 94fce4f537e9..534aca4c642c 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -1162,6 +1162,13 @@ static int perf_evsel__append_filter(struct perf_evsel *evsel,
 	return -1;
 }
 
+int perf_evsel__apply_drv_config(struct perf_evsel *evsel, const char *config)
+{
+	return perf_evsel__run_ioctl(evsel,
+				     PERF_EVENT_IOC_SET_DRV_CONFIG,
+				     (void *)config);
+}
+
 int perf_evsel__append_tp_filter(struct perf_evsel *evsel, const char *filter)
 {
 	return perf_evsel__append_filter(evsel, "(%s) && (%s)", filter);
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index d277930b19a1..0f671bd2a988 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -271,6 +271,7 @@ int perf_evsel__append_tp_filter(struct perf_evsel *evsel, const char *filter);
 int perf_evsel__append_addr_filter(struct perf_evsel *evsel,
 				   const char *filter);
 int perf_evsel__apply_filter(struct perf_evsel *evsel, const char *filter);
+int perf_evsel__apply_drv_config(struct perf_evsel *evsel, const char *config);
 int perf_evsel__enable(struct perf_evsel *evsel);
 int perf_evsel__disable(struct perf_evsel *evsel);
 
-- 
2.7.4


WARNING: multiple messages have this Message-ID (diff)
From: mathieu.poirier@linaro.org (Mathieu Poirier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/6] perf tools: Use ioctl to communicate driver configuration to kernel
Date: Mon,  2 Jul 2018 16:33:25 -0600	[thread overview]
Message-ID: <1530570810-28929-2-git-send-email-mathieu.poirier@linaro.org> (raw)
In-Reply-To: <1530570810-28929-1-git-send-email-mathieu.poirier@linaro.org>

Following in the footsteps of what was done for filters, adding the
necessary mechanic needed to push down driver specific configuration
to the kernel using an ioctl. By proceeding this way PMU specific
configuration can be communicated to each event.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
 include/uapi/linux/perf_event.h       | 1 +
 tools/include/uapi/linux/perf_event.h | 1 +
 tools/perf/util/evsel.c               | 7 +++++++
 tools/perf/util/evsel.h               | 1 +
 4 files changed, 10 insertions(+)

diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
index b8e288a1f740..b5b3241877df 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -460,6 +460,7 @@ struct perf_event_query_bpf {
 #define PERF_EVENT_IOC_PAUSE_OUTPUT		_IOW('$', 9, __u32)
 #define PERF_EVENT_IOC_QUERY_BPF		_IOWR('$', 10, struct perf_event_query_bpf *)
 #define PERF_EVENT_IOC_MODIFY_ATTRIBUTES	_IOW('$', 11, struct perf_event_attr *)
+#define PERF_EVENT_IOC_SET_DRV_CONFIG		_IOW('$', 12, char *)
 
 enum perf_event_ioc_flags {
 	PERF_IOC_FLAG_GROUP		= 1U << 0,
diff --git a/tools/include/uapi/linux/perf_event.h b/tools/include/uapi/linux/perf_event.h
index b8e288a1f740..b5b3241877df 100644
--- a/tools/include/uapi/linux/perf_event.h
+++ b/tools/include/uapi/linux/perf_event.h
@@ -460,6 +460,7 @@ struct perf_event_query_bpf {
 #define PERF_EVENT_IOC_PAUSE_OUTPUT		_IOW('$', 9, __u32)
 #define PERF_EVENT_IOC_QUERY_BPF		_IOWR('$', 10, struct perf_event_query_bpf *)
 #define PERF_EVENT_IOC_MODIFY_ATTRIBUTES	_IOW('$', 11, struct perf_event_attr *)
+#define PERF_EVENT_IOC_SET_DRV_CONFIG		_IOW('$', 12, char *)
 
 enum perf_event_ioc_flags {
 	PERF_IOC_FLAG_GROUP		= 1U << 0,
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 94fce4f537e9..534aca4c642c 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -1162,6 +1162,13 @@ static int perf_evsel__append_filter(struct perf_evsel *evsel,
 	return -1;
 }
 
+int perf_evsel__apply_drv_config(struct perf_evsel *evsel, const char *config)
+{
+	return perf_evsel__run_ioctl(evsel,
+				     PERF_EVENT_IOC_SET_DRV_CONFIG,
+				     (void *)config);
+}
+
 int perf_evsel__append_tp_filter(struct perf_evsel *evsel, const char *filter)
 {
 	return perf_evsel__append_filter(evsel, "(%s) && (%s)", filter);
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index d277930b19a1..0f671bd2a988 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -271,6 +271,7 @@ int perf_evsel__append_tp_filter(struct perf_evsel *evsel, const char *filter);
 int perf_evsel__append_addr_filter(struct perf_evsel *evsel,
 				   const char *filter);
 int perf_evsel__apply_filter(struct perf_evsel *evsel, const char *filter);
+int perf_evsel__apply_drv_config(struct perf_evsel *evsel, const char *config);
 int perf_evsel__enable(struct perf_evsel *evsel);
 int perf_evsel__disable(struct perf_evsel *evsel);
 
-- 
2.7.4

  reply	other threads:[~2018-07-02 22:34 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-02 22:33 [PATCH 0/6] perf: Add ioctl for PMU driver configuration Mathieu Poirier
2018-07-02 22:33 ` Mathieu Poirier
2018-07-02 22:33 ` Mathieu Poirier [this message]
2018-07-02 22:33   ` [PATCH 1/6] perf tools: Use ioctl to communicate driver configuration to kernel Mathieu Poirier
2018-07-02 22:33 ` [PATCH 2/6] perf tools: Make perf_evsel accessible to PMU driver configuration code Mathieu Poirier
2018-07-02 22:33   ` Mathieu Poirier
2018-07-02 22:33 ` [PATCH 3/6] perf tools: Use ioctl function to send sink configuration to kernel Mathieu Poirier
2018-07-02 22:33   ` Mathieu Poirier
2018-07-02 22:33 ` [PATCH 4/6] perf/aux: Make perf_event accessible to setup_aux() Mathieu Poirier
2018-07-02 22:33   ` Mathieu Poirier
2018-07-03  2:05   ` kbuild test robot
2018-07-03  2:05     ` kbuild test robot
2018-07-03  7:31   ` Hendrik Brueckner
2018-07-03  7:31     ` Hendrik Brueckner
2018-07-03 17:37     ` Mathieu Poirier
2018-07-03 17:37       ` Mathieu Poirier
2018-07-03  9:27   ` Alexander Shishkin
2018-07-03  9:27     ` Alexander Shishkin
2018-07-02 22:33 ` [PATCH 5/6] perf/core: Use ioctl to communicate driver configuration to kernel Mathieu Poirier
2018-07-02 22:33   ` Mathieu Poirier
2018-07-03 10:03   ` Alexander Shishkin
2018-07-03 10:03     ` Alexander Shishkin
2018-07-03 10:56     ` Alexander Shishkin
2018-07-03 10:56       ` Alexander Shishkin
2018-07-03 22:00       ` Mathieu Poirier
2018-07-03 22:00         ` Mathieu Poirier
2018-07-04 10:34         ` Alexander Shishkin
2018-07-04 10:34           ` Alexander Shishkin
2018-07-04 21:39           ` Mathieu Poirier
2018-07-04 21:39             ` Mathieu Poirier
2018-07-03 20:30     ` Mathieu Poirier
2018-07-03 20:30       ` Mathieu Poirier
2018-07-04 10:51       ` Alexander Shishkin
2018-07-04 10:51         ` Alexander Shishkin
2018-07-03 22:03     ` Mathieu Poirier
2018-07-03 22:03       ` Mathieu Poirier
2018-07-03 13:40   ` Jiri Olsa
2018-07-03 13:40     ` Jiri Olsa
2018-07-03 17:47     ` Mathieu Poirier
2018-07-03 17:47       ` Mathieu Poirier
2018-07-03 13:41   ` Jiri Olsa
2018-07-03 13:41     ` Jiri Olsa
2018-07-02 22:33 ` [PATCH 6/6] coresight: Use PMU driver configuration for sink selection Mathieu Poirier
2018-07-02 22:33   ` Mathieu Poirier

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=1530570810-28929-2-git-send-email-mathieu.poirier@linaro.org \
    --to=mathieu.poirier@linaro.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=ast@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heiko.carstens@de.ibm.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=will.deacon@arm.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.