Re: [PATCH v3 bpf-next 1/4] tracing/probe: Add PERF_EVENT_IOC_QUERY_PROBE ioctl

2019-08-22 Thread Daniel Xu
On Thu Aug 22, 2019 at 11:05 AM Peter Zijlstra wrote: > On Thu, Aug 22, 2019 at 07:54:16AM +, Song Liu wrote: > > Hi Peter, > > > > > On Aug 22, 2019, at 12:47 AM, Peter Zijlstra wrote: > > > > > > On Wed, Aug 21, 2019 at 06:43:49PM +, Yonghong Song wrote: > > >> On 8/21/19 11:31 AM,

Re: [PATCH v3 bpf-next 1/4] tracing/probe: Add PERF_EVENT_IOC_QUERY_PROBE ioctl

2019-08-22 Thread Peter Zijlstra
On Thu, Aug 22, 2019 at 07:54:16AM +, Song Liu wrote: > Hi Peter, > > > On Aug 22, 2019, at 12:47 AM, Peter Zijlstra wrote: > > > > On Wed, Aug 21, 2019 at 06:43:49PM +, Yonghong Song wrote: > >> On 8/21/19 11:31 AM, Peter Zijlstra wrote: > > > >>> So extending PERF_RECORD_LOST

Re: [PATCH v3 bpf-next 1/4] tracing/probe: Add PERF_EVENT_IOC_QUERY_PROBE ioctl

2019-08-22 Thread Song Liu
Hi Peter, > On Aug 22, 2019, at 12:47 AM, Peter Zijlstra wrote: > > On Wed, Aug 21, 2019 at 06:43:49PM +, Yonghong Song wrote: >> On 8/21/19 11:31 AM, Peter Zijlstra wrote: > >>> So extending PERF_RECORD_LOST doesn't work. But PERF_FORMAT_LOST might >>> still work fine; but you get to

Re: [PATCH v3 bpf-next 1/4] tracing/probe: Add PERF_EVENT_IOC_QUERY_PROBE ioctl

2019-08-22 Thread Peter Zijlstra
On Wed, Aug 21, 2019 at 06:43:49PM +, Yonghong Song wrote: > On 8/21/19 11:31 AM, Peter Zijlstra wrote: > > So extending PERF_RECORD_LOST doesn't work. But PERF_FORMAT_LOST might > > still work fine; but you get to implement it for all software events. > > Could you give more specifics about

Re: [PATCH v3 bpf-next 1/4] tracing/probe: Add PERF_EVENT_IOC_QUERY_PROBE ioctl

2019-08-21 Thread Yonghong Song
On 8/21/19 1:07 PM, Arnaldo Carvalho de Melo wrote: > Em Wed, Aug 21, 2019 at 04:54:47PM +, Yonghong Song escreveu: >> Arnaldo has a question on bcc mailing list about the hit/miss >> counting of bpf program missed to process events. > >>

Re: [PATCH v3 bpf-next 1/4] tracing/probe: Add PERF_EVENT_IOC_QUERY_PROBE ioctl

2019-08-21 Thread Arnaldo Carvalho de Melo
Em Wed, Aug 21, 2019 at 04:54:47PM +, Yonghong Song escreveu: > Arnaldo has a question on bcc mailing list about the hit/miss > counting of bpf program missed to process events. > https://lists.iovisor.org/g/iovisor-dev/message/1783 PERF_FORMAT_LOST seems to be a good answer to that? See my

Re: [PATCH v3 bpf-next 1/4] tracing/probe: Add PERF_EVENT_IOC_QUERY_PROBE ioctl

2019-08-21 Thread Arnaldo Carvalho de Melo
Em Wed, Aug 21, 2019 at 06:43:49PM +, Yonghong Song escreveu: > On 8/21/19 11:31 AM, Peter Zijlstra wrote: > > On Wed, Aug 21, 2019 at 04:54:47PM +, Yonghong Song wrote: > >> A lot of bpf-based tracing programs uses maps to communicate and > >> do not allocate ring buffer at all. > > > >

Re: [PATCH v3 bpf-next 1/4] tracing/probe: Add PERF_EVENT_IOC_QUERY_PROBE ioctl

2019-08-21 Thread Yonghong Song
On 8/21/19 11:31 AM, Peter Zijlstra wrote: > On Wed, Aug 21, 2019 at 04:54:47PM +, Yonghong Song wrote: >> Currently, in kernel/trace/bpf_trace.c, we have >> >> unsigned int trace_call_bpf(struct trace_event_call *call, void *ctx) >> { >> unsigned int ret; >> >> if

Re: [PATCH v3 bpf-next 1/4] tracing/probe: Add PERF_EVENT_IOC_QUERY_PROBE ioctl

2019-08-21 Thread Peter Zijlstra
On Wed, Aug 21, 2019 at 04:54:47PM +, Yonghong Song wrote: > Currently, in kernel/trace/bpf_trace.c, we have > > unsigned int trace_call_bpf(struct trace_event_call *call, void *ctx) > { > unsigned int ret; > > if (in_nmi()) /* not supported yet */ > return

Re: [PATCH v3 bpf-next 1/4] tracing/probe: Add PERF_EVENT_IOC_QUERY_PROBE ioctl

2019-08-21 Thread Yonghong Song
On 8/21/19 4:08 AM, Peter Zijlstra wrote: > On Tue, Aug 20, 2019 at 10:58:47AM -0700, Daniel Xu wrote: >> Hi Peter, >> >> On Tue Aug 20, 2019 at 4:45 PM Peter Zijlstra wrote: >>> On Fri, Aug 16, 2019 at 03:31:46PM -0700, Daniel Xu wrote: It's useful to know [uk]probe's nmissed and nhit

Re: [PATCH v3 bpf-next 1/4] tracing/probe: Add PERF_EVENT_IOC_QUERY_PROBE ioctl

2019-08-21 Thread Peter Zijlstra
On Tue, Aug 20, 2019 at 10:58:47AM -0700, Daniel Xu wrote: > Hi Peter, > > On Tue Aug 20, 2019 at 4:45 PM Peter Zijlstra wrote: > > On Fri, Aug 16, 2019 at 03:31:46PM -0700, Daniel Xu wrote: > > > It's useful to know [uk]probe's nmissed and nhit stats. For example with > > > tracing tools, it's

Re: [PATCH v3 bpf-next 1/4] tracing/probe: Add PERF_EVENT_IOC_QUERY_PROBE ioctl

2019-08-20 Thread Daniel Xu
Hi Peter, On Tue Aug 20, 2019 at 4:45 PM Peter Zijlstra wrote: > On Fri, Aug 16, 2019 at 03:31:46PM -0700, Daniel Xu wrote: > > It's useful to know [uk]probe's nmissed and nhit stats. For example with > > tracing tools, it's important to know when events may have been lost. > > debugfs currently

Re: [PATCH v3 bpf-next 1/4] tracing/probe: Add PERF_EVENT_IOC_QUERY_PROBE ioctl

2019-08-20 Thread Peter Zijlstra
On Fri, Aug 16, 2019 at 03:31:46PM -0700, Daniel Xu wrote: > It's useful to know [uk]probe's nmissed and nhit stats. For example with > tracing tools, it's important to know when events may have been lost. > debugfs currently exposes a control file to get this information, but > it is not

Re: [PATCH v3 bpf-next 1/4] tracing/probe: Add PERF_EVENT_IOC_QUERY_PROBE ioctl

2019-08-19 Thread Alexei Starovoitov
On Mon, Aug 19, 2019 at 7:34 PM Daniel Xu wrote: > > Ah yes, sorry. Will add that. Also please fix build errors. It looks like buildbot is not happy about few things.

Re: [PATCH v3 bpf-next 1/4] tracing/probe: Add PERF_EVENT_IOC_QUERY_PROBE ioctl

2019-08-19 Thread Daniel Xu
On Mon Aug 19, 2019 at 6:26 PM Alexei Starovoitov wrote: > On Fri, Aug 16, 2019 at 3:33 PM Daniel Xu wrote: > > > > It's useful to know [uk]probe's nmissed and nhit stats. For example with > > tracing tools, it's important to know when events may have been lost. > > debugfs currently exposes a

Re: [PATCH v3 bpf-next 1/4] tracing/probe: Add PERF_EVENT_IOC_QUERY_PROBE ioctl

2019-08-19 Thread kbuild test robot
Hi Daniel, Thank you for the patch! Yet something to improve: [auto build test ERROR on bpf-next/master] url: https://github.com/0day-ci/linux/commits/Daniel-Xu/tracing-probe-Add-PERF_EVENT_IOC_QUERY_PROBE-ioctl/20190820-003910 base:

Re: [PATCH v3 bpf-next 1/4] tracing/probe: Add PERF_EVENT_IOC_QUERY_PROBE ioctl

2019-08-19 Thread Alexei Starovoitov
On Fri, Aug 16, 2019 at 3:33 PM Daniel Xu wrote: > > It's useful to know [uk]probe's nmissed and nhit stats. For example with > tracing tools, it's important to know when events may have been lost. > debugfs currently exposes a control file to get this information, but > it is not compatible with

Re: [PATCH v3 bpf-next 1/4] tracing/probe: Add PERF_EVENT_IOC_QUERY_PROBE ioctl

2019-08-19 Thread kbuild test robot
Hi Daniel, Thank you for the patch! Yet something to improve: [auto build test ERROR on bpf-next/master] url: https://github.com/0day-ci/linux/commits/Daniel-Xu/tracing-probe-Add-PERF_EVENT_IOC_QUERY_PROBE-ioctl/20190820-003910 base:

[PATCH v3 bpf-next 1/4] tracing/probe: Add PERF_EVENT_IOC_QUERY_PROBE ioctl

2019-08-16 Thread Daniel Xu
It's useful to know [uk]probe's nmissed and nhit stats. For example with tracing tools, it's important to know when events may have been lost. debugfs currently exposes a control file to get this information, but it is not compatible with probes registered with the perf API. While bpf programs