[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180612075117.65420-6-alexander.shishkin@linux.intel.com>
Date: Tue, 12 Jun 2018 10:51:16 +0300
From: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
To: Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Ingo Molnar <mingo@...hat.com>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>,
linux-kernel@...r.kernel.org, jolsa@...hat.com,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Subject: [PATCH v1 5/6] perf: Drop PERF_FLAG_FD_OUTPUT
Since commit:
ac9721f3f54b ("perf_events: Fix races and clean up perf_event and perf_mmap_data interaction")
... PERF_FLAG_FD_OUTPUT has been always returning -EINVAL. This can be
either fixed by supplying enough context information to the set_output
path to validate the request, or it can simply be dropped. The fact that
in 8 years since it last worked, nobody (except Vince [1]) seems to
notice, this patch drops it.
[1] https://lkml.org/lkml/2015/1/9/479
Signed-off-by: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
---
kernel/events/core.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 70918ed33143..9bf5c7abb621 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -344,7 +344,6 @@ static void event_function_local(struct perf_event *event, event_f func, void *d
}
#define PERF_FLAG_ALL (PERF_FLAG_FD_NO_GROUP |\
- PERF_FLAG_FD_OUTPUT |\
PERF_FLAG_PID_CGROUP |\
PERF_FLAG_FD_CLOEXEC |\
PERF_FLAG_FD_SAMPLE)
@@ -9997,7 +9996,7 @@ SYSCALL_DEFINE5(perf_event_open,
struct perf_event_attr __user *, attr_uptr,
pid_t, pid, int, cpu, int, group_fd, unsigned long, flags)
{
- struct perf_event *group_leader = NULL, *output_event = NULL;
+ struct perf_event *group_leader = NULL;
struct perf_event *sample_event = NULL;
struct perf_event *event, *sibling;
struct perf_event_attr attr;
@@ -10067,8 +10066,6 @@ SYSCALL_DEFINE5(perf_event_open,
if (err)
goto err_fd;
group_leader = group.file->private_data;
- if (flags & PERF_FLAG_FD_OUTPUT)
- output_event = group_leader;
if (flags & PERF_FLAG_FD_SAMPLE)
sample_event = group_leader;
if (flags & PERF_FLAG_FD_NO_GROUP)
@@ -10223,12 +10220,6 @@ SYSCALL_DEFINE5(perf_event_open,
goto err_context;
}
- if (output_event) {
- err = perf_event_set_output(event, output_event);
- if (err)
- goto err_context;
- }
-
event_file = anon_inode_getfile("[perf_event]", &perf_fops, event,
f_flags);
if (IS_ERR(event_file)) {
--
2.17.1
Powered by blists - more mailing lists