Skip to content

Commit 79d437e

Browse files
ftrace: Properly merge notrace hashes
JIRA: https://issues.redhat.com/browse/RHEL-115358 commit 04a80a3 Author: Andy Chiu <andybnac@gmail.com> Date: Wed Apr 9 00:02:57 2025 +0800 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> Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
1 parent d8a3101 commit 79d437e

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
@@ -3523,16 +3523,16 @@ int ftrace_startup_subops(struct ftrace_ops *ops, struct ftrace_ops *subops, int
35233523
ftrace_hash_empty(subops->func_hash->notrace_hash)) {
35243524
notrace_hash = EMPTY_HASH;
35253525
} else {
3526-
size_bits = max(ops->func_hash->filter_hash->size_bits,
3527-
subops->func_hash->filter_hash->size_bits);
3526+
size_bits = max(ops->func_hash->notrace_hash->size_bits,
3527+
subops->func_hash->notrace_hash->size_bits);
35283528
notrace_hash = alloc_ftrace_hash(size_bits);
35293529
if (!notrace_hash) {
35303530
free_ftrace_hash(filter_hash);
35313531
return -ENOMEM;
35323532
}
35333533

3534-
ret = intersect_hash(&notrace_hash, ops->func_hash->filter_hash,
3535-
subops->func_hash->filter_hash);
3534+
ret = intersect_hash(&notrace_hash, ops->func_hash->notrace_hash,
3535+
subops->func_hash->notrace_hash);
35363536
if (ret < 0) {
35373537
free_ftrace_hash(filter_hash);
35383538
free_ftrace_hash(notrace_hash);

0 commit comments

Comments
 (0)