From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexei Starovoitov Subject: Re: [PATCH v5 bpf-next 06/10] tracepoint: compute num_args at build time Date: Mon, 26 Mar 2018 08:42:49 -0700 Message-ID: <5bcacdb5-e72f-b67a-4884-61fcedf0938a@fb.com> References: <20180324023038.938665-1-ast@fb.com> <20180324023038.938665-7-ast@fb.com> <20180326110204.042801dd@gandalf.local.home> <1787605856.4574.1522077244597.JavaMail.zimbra@efficios.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Cc: "David S. Miller" , Daniel Borkmann , Linus Torvalds , Peter Zijlstra , , , linux-api To: Mathieu Desnoyers , rostedt Return-path: Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:39160 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752306AbeCZPoi (ORCPT ); Mon, 26 Mar 2018 11:44:38 -0400 In-Reply-To: <1787605856.4574.1522077244597.JavaMail.zimbra@efficios.com> Sender: netdev-owner@vger.kernel.org List-ID: 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 wrote: >> >>> From: Alexei Starovoitov >>> >>> 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'.