Skip to content

Commit 04a80a3

Browse files
AndybnACTrostedt
authored andcommitted
ftrace: Properly merge notrace hashes
The global notrace hash should be jointly decided by the intersection of each subops's notrace hash, but not the filter hash. Cc: stable@vger.kernel.org Link: https://lore.kernel.org/20250408160258.48563-1-andybnac@gmail.com Fixes: 5fccc75 ("ftrace: Add subops logic to allow one ops to manage many") Signed-off-by: Andy Chiu <andybnac@gmail.com> [ fixed removing of freeing of filter_hash ] Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent e1a453a commit 04a80a3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

kernel/trace/ftrace.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3526,16 +3526,16 @@ int ftrace_startup_subops(struct ftrace_ops *ops, struct ftrace_ops *subops, int
35263526
ftrace_hash_empty(subops->func_hash->notrace_hash)) {
35273527
notrace_hash = EMPTY_HASH;
35283528
} else {
3529-
size_bits = max(ops->func_hash->filter_hash->size_bits,
3530-
subops->func_hash->filter_hash->size_bits);
3529+
size_bits = max(ops->func_hash->notrace_hash->size_bits,
3530+
subops->func_hash->notrace_hash->size_bits);
35313531
notrace_hash = alloc_ftrace_hash(size_bits);
35323532
if (!notrace_hash) {
35333533
free_ftrace_hash(filter_hash);
35343534
return -ENOMEM;
35353535
}
35363536

3537-
ret = intersect_hash(&notrace_hash, ops->func_hash->filter_hash,
3538-
subops->func_hash->filter_hash);
3537+
ret = intersect_hash(&notrace_hash, ops->func_hash->notrace_hash,
3538+
subops->func_hash->notrace_hash);
35393539
if (ret < 0) {
35403540
free_ftrace_hash(filter_hash);
35413541
free_ftrace_hash(notrace_hash);

0 commit comments

Comments
 (0)