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


Groups > linux.kernel > #1245330

Re: [RFC PATCH 2/2] bpf: Implement bpf_perf_event_sample_enable/disable() helpers

From Alexei Starovoitov <ast@plumgrid.com>
Newsgroups linux.kernel
Subject Re: [RFC PATCH 2/2] bpf: Implement bpf_perf_event_sample_enable/disable() helpers
Date 2015-10-13 06:20 +0200
Message-ID <qiZe9-3H1-9@gated-at.bofh.it> (permalink)
References (1 earlier) <qiHhh-2LN-27@gated-at.bofh.it> <qiQXg-8t1-13@gated-at.bofh.it> <qiYrL-2vS-7@gated-at.bofh.it> <qiYBr-2Ii-5@gated-at.bofh.it> <qiYUO-35B-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 10/12/15 8:51 PM, Wangnan (F) wrote:
>> why 'set disable' is needed ?
>> the example given in cover letter shows the use case where you want
>> to receive samples only within sys_write() syscall.
>> The example makes sense, but sys_write() is running on this cpu, so just
>> disabling it on the current one is enough.
>>
>
> Our real use case is control of the system-wide sampling. For example,
> we need sampling all CPUs when smartphone start refershing its display.
> We need all CPUs because in Android system there are plenty of threads
> get involed into this behavior. We can't achieve this by controling
> sampling on only one CPU. This is the reason we need 'set enable'
> and 'set disable'.

ok, but that use case may have different enable/disable pattern.
In sys_write example ultra-fast enable/disable is must have, since
the whole syscall is fast and overhead should be minimal.
but for display refresh? we're talking milliseconds, no?
Can you just ioctl() it from user space?
If cost of enable/disable is high or the time range between toggling is
long, then doing it from the bpf program doesn't make sense. Instead
the program can do bpf_perf_event_output() to send a notification to
user space that condition is met and the user space can ioctl() events.

--
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

[RFC PATCH 2/2] bpf: Implement bpf_perf_event_sample_enable/disable() helpers Kaixu Xia <xiakaixu@huawei.com> - 2015-10-12 11:10 +0200
  Re: [RFC PATCH 2/2] bpf: Implement  bpf_perf_event_sample_enable/disable() helpers Alexei Starovoitov <ast@plumgrid.com> - 2015-10-12 21:30 +0200
    Re: [RFC PATCH 2/2] bpf: Implement bpf_perf_event_sample_enable/disable()  helpers "Wangnan (F)" <wangnan0@huawei.com> - 2015-10-13 05:30 +0200
      Re: [RFC PATCH 2/2] bpf: Implement  bpf_perf_event_sample_enable/disable() helpers Alexei Starovoitov <ast@plumgrid.com> - 2015-10-13 05:40 +0200
        Re: [RFC PATCH 2/2] bpf: Implement bpf_perf_event_sample_enable/disable()  helpers "Wangnan (F)" <wangnan0@huawei.com> - 2015-10-13 06:00 +0200
          Re: [RFC PATCH 2/2] bpf: Implement  bpf_perf_event_sample_enable/disable() helpers Alexei Starovoitov <ast@plumgrid.com> - 2015-10-13 06:20 +0200
            Re: [RFC PATCH 2/2] bpf: Implement bpf_perf_event_sample_enable/disable()  helpers "Wangnan (F)" <wangnan0@huawei.com> - 2015-10-13 06:40 +0200
              Re: [RFC PATCH 2/2] bpf: Implement  bpf_perf_event_sample_enable/disable() helpers Alexei Starovoitov <ast@plumgrid.com> - 2015-10-13 07:20 +0200
                Re: [RFC PATCH 2/2] bpf: Implement bpf_perf_event_sample_enable/disable()  helpers "Wangnan (F)" <wangnan0@huawei.com> - 2015-10-13 09:10 +0200
                Re: [RFC PATCH 2/2] bpf: Implement  bpf_perf_event_sample_enable/disable() helpers He Kuang <hekuang@huawei.com> - 2015-10-13 13:00 +0200
                Re: [RFC PATCH 2/2] bpf: Implement bpf_perf_event_sample_enable/disable()  helpers "Wangnan (F)" <wangnan0@huawei.com> - 2015-10-13 13:20 +0200
                Re: [RFC PATCH 2/2] bpf: Implement  bpf_perf_event_sample_enable/disable() helpers Alexei Starovoitov <ast@plumgrid.com> - 2015-10-14 07:20 +0200

csiph-web