Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1567236 > unrolled thread
| Started by | Alexander Shishkin <alexander.shishkin@linux.intel.com> |
|---|---|
| First post | 2017-01-26 10:50 +0100 |
| Last post | 2017-01-26 19:40 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 2/3] perf: Do error out on a kernel filter on an exclude_filter event Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2017-01-26 10:50 +0100
Re: [PATCH 2/3] perf: Do error out on a kernel filter on an exclude_filter event Mathieu Poirier <mathieu.poirier@linaro.org> - 2017-01-26 19:40 +0100
| From | Alexander Shishkin <alexander.shishkin@linux.intel.com> |
|---|---|
| Date | 2017-01-26 10:50 +0100 |
| Subject | [PATCH 2/3] perf: Do error out on a kernel filter on an exclude_filter event |
| Message-ID | <t3OQN-5FW-13@gated-at.bofh.it> |
It is currently possible to configure a kernel address filter for a
event that excludes kernel from its traces (attr.exclude_kernel==1).
While in reality this doesn't make sense, the SET_FILTER ioctl() should
return a error in such case, currently it does not. Furthermore, it
will still silently discard the filter and any potentially valid filters
that came with it.
This patch makes the SET_FILTER ioctl() error out in such cases.
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
---
kernel/events/core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index b422b5feee..36770a13ef 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -8261,6 +8261,7 @@ perf_event_parse_addr_filter(struct perf_event *event, char *fstr,
* attribute.
*/
if (state == IF_STATE_END) {
+ ret = -EINVAL;
if (kernel && event->attr.exclude_kernel)
goto fail;
--
2.11.0
[toc] | [next] | [standalone]
| From | Mathieu Poirier <mathieu.poirier@linaro.org> |
|---|---|
| Date | 2017-01-26 19:40 +0100 |
| Subject | Re: [PATCH 2/3] perf: Do error out on a kernel filter on an exclude_filter event |
| Message-ID | <t3X7I-2kP-27@gated-at.bofh.it> |
| In reply to | #1567236 |
On Thu, Jan 26, 2017 at 11:40:56AM +0200, Alexander Shishkin wrote:
> It is currently possible to configure a kernel address filter for a
> event that excludes kernel from its traces (attr.exclude_kernel==1).
>
> While in reality this doesn't make sense, the SET_FILTER ioctl() should
> return a error in such case, currently it does not. Furthermore, it
> will still silently discard the filter and any potentially valid filters
> that came with it.
>
> This patch makes the SET_FILTER ioctl() error out in such cases.
>
> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
> ---
> kernel/events/core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index b422b5feee..36770a13ef 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -8261,6 +8261,7 @@ perf_event_parse_addr_filter(struct perf_event *event, char *fstr,
> * attribute.
> */
> if (state == IF_STATE_END) {
> + ret = -EINVAL;
> if (kernel && event->attr.exclude_kernel)
> goto fail;
Yes, I stumbled on that when implementing filters on CS and could swear I had a
patch for it. It obviously never got sent out.
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
>
> --
> 2.11.0
>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web