[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250408160258.48563-1-andybnac@gmail.com>
Date: Wed, 9 Apr 2025 00:02:57 +0800
From: Andy Chiu <andybnac@...il.com>
To: rostedt@...dmis.org,
linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org
Cc: mark.rutland@....com,
mhiramat@...nel.org,
mathieu.desnoyers@...icios.com,
Andy Chiu <andybnac@...il.com>,
bjorn@...osinc.com,
puranjay12@...il.com,
alexghiti@...osinc.com,
paul.walmsley@...ive.com,
greentime.hu@...ive.com,
nick.hu@...ive.com,
nylon.chen@...ive.com,
eric.lin@...ive.com,
vincent.chen@...ive.com,
zong.li@...ive.com,
yongxuan.wang@...ive.com,
samuel.holland@...ive.com,
olivia.chu@...ive.com,
c2232430@...il.com
Subject: [PATCH v2] ftrace: properly merge notrace hash
The global notrace hash should be jointly decided by the intersection of
each subops's notrace hash, but not the filter hash.
Fixes: 5fccc7552ccb ("ftrace: Add subops logic to allow one ops to manage many")
Signed-off-by: Andy Chiu <andybnac@...il.com>
---
Changelog v2:
- free both filter and notrace hash when intersect_hash() fails
---
kernel/trace/ftrace.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 1a48aedb5255..bb9e1bf4fe86 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -3526,16 +3526,16 @@ int ftrace_startup_subops(struct ftrace_ops *ops, struct ftrace_ops *subops, int
ftrace_hash_empty(subops->func_hash->notrace_hash)) {
notrace_hash = EMPTY_HASH;
} else {
- size_bits = max(ops->func_hash->filter_hash->size_bits,
- subops->func_hash->filter_hash->size_bits);
+ size_bits = max(ops->func_hash->notrace_hash->size_bits,
+ subops->func_hash->notrace_hash->size_bits);
notrace_hash = alloc_ftrace_hash(size_bits);
if (!notrace_hash) {
- free_ftrace_hash(filter_hash);
+ free_ftrace_hash(notrace_hash);
return -ENOMEM;
}
- ret = intersect_hash(¬race_hash, ops->func_hash->filter_hash,
- subops->func_hash->filter_hash);
+ ret = intersect_hash(¬race_hash, ops->func_hash->notrace_hash,
+ subops->func_hash->notrace_hash);
if (ret < 0) {
free_ftrace_hash(filter_hash);
free_ftrace_hash(notrace_hash);
--
2.39.3 (Apple Git-145)
Powered by blists - more mailing lists