Thread (36 messages) 36 messages, 4 authors, 2018-03-26

Re: [PATCH v5 bpf-next 06/10] tracepoint: compute num_args at build time

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2018-03-26 15:56:18
Also in: linux-api

On Fri, 23 Mar 2018 19:30:34 -0700
Alexei Starovoitov [off-list ref] wrote:
+static void *for_each_tracepoint_range(struct tracepoint * const *begin,
+				       struct tracepoint * const *end,
+				       void *(*fct)(struct tracepoint *tp, void *priv),
+				       void *priv)
 {
 	struct tracepoint * const *iter;
+	void *ret;
 
 	if (!begin)
-		return;
-	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;
So you just stopped the loop here. You have an inconsistent state. What
about the functions that were called before. How do you undo them? Or
what about the rest that haven't been touched. This function gives no
feedback to the caller.

-- Steve

+	}
+	return NULL;
 }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help