From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Alexei Starovoitov <ast@fb.com>
Cc: rostedt <rostedt@goodmis.org>,
"David S. Miller" <davem@davemloft.net>,
Daniel Borkmann <daniel@iogearbox.net>,
Linus Torvalds <torvalds@linux-foundation.org>,
Peter Zijlstra <peterz@infradead.org>,
netdev <netdev@vger.kernel.org>, kernel-team <kernel-team@fb.com>,
linux-api <linux-api@vger.kernel.org>,
"Frank Ch. Eigler" <fche@redhat.com>
Subject: Re: [PATCH v5 bpf-next 06/10] tracepoint: compute num_args at build time
Date: Mon, 26 Mar 2018 12:17:25 -0400 (EDT) [thread overview]
Message-ID: <1055377367.195.1522081045131.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <f39181e0-3d46-2154-044c-dfc985053b3a@fb.com>
----- On Mar 26, 2018, at 12:08 PM, Alexei Starovoitov ast@fb.com wrote:
> On 3/26/18 8:55 AM, Mathieu Desnoyers wrote:
>> ----- On Mar 26, 2018, at 11:42 AM, Alexei Starovoitov ast@fb.com wrote:
>>
>>> On 3/26/18 8:14 AM, Mathieu Desnoyers wrote:
>>>> ----- On Mar 26, 2018, at 11:02 AM, rostedt rostedt@goodmis.org wrote:
>>>>
>>>>> On Fri, 23 Mar 2018 19:30:34 -0700
>>>>> Alexei Starovoitov <ast@fb.com> wrote:
>>>>>
>>>>>> From: Alexei Starovoitov <ast@kernel.org>
>>>>>>
>>>>>> add fancy macro to compute number of arguments passed into tracepoint
>>>>>> at compile time and store it as part of 'struct tracepoint'.
>>>>>> The number is necessary to check safety of bpf program access that
>>>>>> is coming in subsequent patch.
>>>>>>
>>>>>> for_each_tracepoint_range() api has no users inside the kernel.
>>>>>> Make it more useful with ability to stop for_each() loop depending
>>>>>> via callback return value.
>>>>>> In such form it's used in subsequent patch.
>>>>>
>>>>> I believe this is used by LTTng.
>>>>
>>>> Indeed, and by SystemTAP as well.
>>>>
>>>> What justifies the need to stop mid-iteration ? A less intrusive alternative
>>>> would be to use the "priv" data pointer to keep state telling further calls
>>>> to return immediately. Does performance of iteration over tracepoints really
>>>> matter here so much that stopping iteration immediately is worth it ?
>>>
>>> I'm sure both you and Steven are not serious when you object
>>> to _in-tree_ change to for_each_kernel_tracepoint() that
>>> affects _out-of_tree_ modules?
>>>
>>> Just change your module to 'return NULL' instead of plain 'return'.
>>
>> I never said I objected to adapt the LTTng out of tree code. If there is a
>> solid reason for changing the kernel API, I will adapt my code to those
>> changes.
>>
>> What I'm trying to understand here is whether there is solid ground for
>> the added complexity you are proposing. Is it a performance enhancement ?
>> If so, explanation of the use cases targeted, and numbers that measure
>> performance improvements are needed.
>>
>> How is your patch making tracepoints "more useful" ?
>
> are you arguing about the whole set overall or about a change
> to for_each_kernel_tracepoint() ?
I'm perfectly fine with adding the "num_args" stuff. I think it's
really useful. It's only the for_each_kernel_tracepoint change for
which I'm trying to understand the rationale.
> I'm hearing your arguments as that now changes to all exported functions
> need to be "solid" (not sure what exactly means 'solid' here) to
> justify breakage of out-of-tree modules?
No. Any added complexity to tracepoint.c needs to be justified
appropriately.
>
> re: 'added complexity'...
> - for (iter = begin; iter < end; iter++)
> - fct(*iter, priv);
> + return NULL;
> + for (iter = begin; iter < end; iter++) {
> + ret = fct(*iter, priv);
> + if (ret)
> + return ret;
> + }
> + return NULL;
>
> where do you see 'added complexity' ?
> Isn't the above diff self-explanatory that for_each_tracepoint_range()
> can be used not only to iterate over all tracepoints
> (just do 'return NULL') from callback _and_ to find one particular
> tracepoint as patch 7 does ?
I am not arguing about your proposed implementation. I am arguing about
the lack of justification behind this change. Why is this change needed ?
What is it allowing you to do that cannot be done using the private data
pointer ?
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
next prev parent reply other threads:[~2018-03-26 16:17 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-24 2:30 [PATCH v5 bpf-next 00/10] bpf, tracing: introduce bpf raw tracepoints Alexei Starovoitov
2018-03-24 2:30 ` [PATCH v5 bpf-next 01/10] treewide: remove large struct-pass-by-value from tracepoint arguments Alexei Starovoitov
2018-03-24 2:30 ` [PATCH v5 bpf-next 02/10] net/mediatek: disambiguate mt76 vs mt7601u trace events Alexei Starovoitov
2018-03-24 2:30 ` [PATCH v5 bpf-next 03/10] net/mac802154: disambiguate mac80215 vs mac802154 " Alexei Starovoitov
2018-03-24 2:30 ` [PATCH v5 bpf-next 04/10] net/wireless/iwlwifi: fix iwlwifi_dev_ucode_error tracepoint Alexei Starovoitov
2018-03-24 2:30 ` [PATCH v5 bpf-next 05/10] macro: introduce COUNT_ARGS() macro Alexei Starovoitov
2018-03-24 2:30 ` [PATCH v5 bpf-next 06/10] tracepoint: compute num_args at build time Alexei Starovoitov
2018-03-26 15:02 ` Steven Rostedt
2018-03-26 15:02 ` Steven Rostedt
2018-03-26 15:14 ` Mathieu Desnoyers
2018-03-26 15:42 ` Alexei Starovoitov
2018-03-26 15:42 ` Alexei Starovoitov
2018-03-26 15:55 ` Mathieu Desnoyers
2018-03-26 16:08 ` Alexei Starovoitov
2018-03-26 16:17 ` Mathieu Desnoyers [this message]
2018-03-26 16:25 ` Alexei Starovoitov
2018-03-26 16:35 ` Steven Rostedt
2018-03-26 16:47 ` Alexei Starovoitov
2018-03-26 17:04 ` Steven Rostedt
2018-03-26 16:57 ` Mathieu Desnoyers
2018-03-26 17:55 ` Alexei Starovoitov
2018-03-26 18:11 ` Steven Rostedt
2018-03-26 18:39 ` Alexei Starovoitov
2018-03-26 18:48 ` Steven Rostedt
2018-03-26 21:27 ` Mathieu Desnoyers
2018-03-26 15:56 ` Steven Rostedt
2018-03-26 15:56 ` Steven Rostedt
2018-03-26 16:31 ` Steven Rostedt
2018-03-26 16:31 ` Steven Rostedt
2018-03-24 2:30 ` [PATCH v5 bpf-next 07/10] bpf: introduce BPF_RAW_TRACEPOINT Alexei Starovoitov
2018-03-24 2:30 ` [PATCH v5 bpf-next 08/10] libbpf: add bpf_raw_tracepoint_open helper Alexei Starovoitov
2018-03-24 2:30 ` [PATCH v5 bpf-next 09/10] samples/bpf: raw tracepoint test Alexei Starovoitov
2018-03-24 2:30 ` [PATCH v5 bpf-next 10/10] selftests/bpf: test for bpf_get_stackid() from raw tracepoints Alexei Starovoitov
2018-03-24 2:35 ` [PATCH v5 bpf-next 00/10] bpf, tracing: introduce bpf " Alexei Starovoitov
2018-03-26 8:28 ` Daniel Borkmann
2018-03-26 15:04 ` Steven Rostedt
2018-03-26 15:32 ` Daniel Borkmann
2018-03-26 15:47 ` Steven Rostedt
2018-03-26 16:00 ` Alexei Starovoitov
2018-03-26 16:00 ` Alexei Starovoitov
2018-03-26 16:16 ` Steven Rostedt
2018-03-26 16:16 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1055377367.195.1522081045131.JavaMail.zimbra@efficios.com \
--to=mathieu.desnoyers@efficios.com \
--cc=ast@fb.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=fche@redhat.com \
--cc=kernel-team@fb.com \
--cc=linux-api@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.