Skip to content

Commit 67cb8ea

Browse files
rostedtgregkh
authored andcommitted
ftrace: Do not add duplicate entries in subops manager ops
commit 8eb4b09 upstream. Check if a function is already in the manager ops of a subops. A manager ops contains multiple subops, and if two or more subops are tracing the same function, the manager ops only needs a single entry in its hash. Cc: stable@vger.kernel.org Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Sven Schnelle <svens@linux.ibm.com> Cc: Vasily Gorbik <gor@linux.ibm.com> Cc: Alexander Gordeev <agordeev@linux.ibm.com> Link: https://lore.kernel.org/20250220202055.226762894@goodmis.org Fixes: 4f554e9 ("ftrace: Add ftrace_set_filter_ips function") Tested-by: Heiko Carstens <hca@linux.ibm.com> Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6856b5c commit 67cb8ea

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kernel/trace/ftrace.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5758,6 +5758,9 @@ __ftrace_match_addr(struct ftrace_hash *hash, unsigned long ip, int remove)
57585758
return -ENOENT;
57595759
free_hash_entry(hash, entry);
57605760
return 0;
5761+
} else if (__ftrace_lookup_ip(hash, ip) != NULL) {
5762+
/* Already exists */
5763+
return 0;
57615764
}
57625765

57635766
entry = add_hash_entry(hash, ip);

0 commit comments

Comments
 (0)