Re: [PATCH v5 1/9] ftrace: Add ftrace_set_filter_ips function

From
Jiri Olsa <hidden>
Date
2022-01-28 09:38:09
Also in
bpf, lkml
Reply to
Masami Hiramatsu, 2022-01-28
On Fri, Jan 28, 2022 at 11:05:23AM +0900, Masami Hiramatsu wrote:

SNIP
quoted hunk ↗ jump to hunk
So, I wrote a below change for the next version. Is that OK for you?

Thank you,
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index f305e18f699f..a28b1bdb234a 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -4985,8 +4985,13 @@ ftrace_match_addr(struct ftrace_hash *hash, unsigned long *ips,
 
 	for (i = 0; i < cnt; i++) {
 		err = __ftrace_match_addr(hash, ips[i], remove);
-		if (err)
+		if (err) {
+			/*
+			 * This expects the @hash is a temporary hash and if this
+			 * fails the caller must free the @hash.
+			 */
 			return err;
+		}
 	}
 	return 0;
 }
@@ -5649,7 +5654,7 @@ int ftrace_set_filter_ip(struct ftrace_ops *ops, unsigned long ip,
 EXPORT_SYMBOL_GPL(ftrace_set_filter_ip);
 
 /**
- * ftrace_set_filter_ips - set a functions to filter on in ftrace by addresses
+ * ftrace_set_filter_ips - set functions to filter on in ftrace by addresses
  * @ops - the ops to set the filter with
  * @ips - the array of addresses to add to or remove from the filter.
  * @cnt - the number of addresses in @ips
looks good, thanks

jirka
Thread (25 messages) 25 messages, 3 authors, last reply 2022-01-28
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help