Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1253837

Re: [PATCH v2 net-next] bpf: fix bpf_perf_event_read() helper

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2 net-next] bpf: fix bpf_perf_event_read() helper
Date 2015-10-22 16:00 +0200
Message-ID <qmozq-4eU-31@gated-at.bofh.it> (permalink)
References <qmawr-en-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Oct 21, 2015 at 03:58:03PM -0700, Alexei Starovoitov wrote:
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index 64754bfecd70..0b6333265872 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -3258,7 +3258,7 @@ static inline u64 perf_event_count(struct perf_event *event)
>  u64 perf_event_read_local(struct perf_event *event)
>  {
>  	unsigned long flags;
> -	u64 val;
> +	u64 val = -EINVAL;

No, you cannot do this, -EINVAL is a valid count value. You simply must
not call this function on !local events, ever.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 net-next] bpf: fix bpf_perf_event_read() helper Alexei Starovoitov <ast@plumgrid.com> - 2015-10-22 01:00 +0200
  Re: [PATCH v2 net-next] bpf: fix bpf_perf_event_read() helper "Wangnan (F)" <wangnan0@huawei.com> - 2015-10-22 07:00 +0200
    Re: [PATCH v2 net-next] bpf: fix bpf_perf_event_read() helper Alexei Starovoitov <ast@plumgrid.com> - 2015-10-22 07:10 +0200
      Re: [PATCH v2 net-next] bpf: fix bpf_perf_event_read() helper "Wangnan (F)" <wangnan0@huawei.com> - 2015-10-22 07:40 +0200
  Re: [PATCH v2 net-next] bpf: fix bpf_perf_event_read() helper "Wangnan (F)" <wangnan0@huawei.com> - 2015-10-22 07:40 +0200
    Re: [PATCH v2 net-next] bpf: fix bpf_perf_event_read() helper Alexei Starovoitov <ast@plumgrid.com> - 2015-10-22 08:30 +0200
      Re: [PATCH v2 net-next] bpf: fix bpf_perf_event_read() helper "Wangnan (F)" <wangnan0@huawei.com> - 2015-10-22 09:50 +0200
        Re: [PATCH v2 net-next] bpf: fix bpf_perf_event_read() helper Alexei Starovoitov <ast@plumgrid.com> - 2015-10-22 18:00 +0200
  Re: [PATCH v2 net-next] bpf: fix bpf_perf_event_read() helper "Wangnan (F)" <wangnan0@huawei.com> - 2015-10-22 14:40 +0200
    Re: [PATCH v2 net-next] bpf: fix bpf_perf_event_read() helper Peter Zijlstra <peterz@infradead.org> - 2015-10-22 14:50 +0200
  Re: [PATCH v2 net-next] bpf: fix bpf_perf_event_read() helper Peter Zijlstra <peterz@infradead.org> - 2015-10-22 16:00 +0200
    Re: [PATCH v2 net-next] bpf: fix bpf_perf_event_read() helper Alexei Starovoitov <ast@plumgrid.com> - 2015-10-22 18:00 +0200

csiph-web