Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ftrace: Make alloc_and_copy_ftrace_hash direct friendly

Make alloc_and_copy_ftrace_hash to copy also direct address
for each hash entry.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Link: https://lore.kernel.org/bpf/20251230145010.103439-3-jolsa@kernel.org

authored by

Jiri Olsa and committed by
Andrii Nakryiko
676bfeae 4be42c92

+9 -2
+9 -2
kernel/trace/ftrace.c
··· 1212 1212 } 1213 1213 1214 1214 static struct ftrace_func_entry * 1215 - add_hash_entry(struct ftrace_hash *hash, unsigned long ip) 1215 + add_hash_entry_direct(struct ftrace_hash *hash, unsigned long ip, unsigned long direct) 1216 1216 { 1217 1217 struct ftrace_func_entry *entry; 1218 1218 ··· 1221 1221 return NULL; 1222 1222 1223 1223 entry->ip = ip; 1224 + entry->direct = direct; 1224 1225 __add_hash_entry(hash, entry); 1225 1226 1226 1227 return entry; 1228 + } 1229 + 1230 + static struct ftrace_func_entry * 1231 + add_hash_entry(struct ftrace_hash *hash, unsigned long ip) 1232 + { 1233 + return add_hash_entry_direct(hash, ip, 0); 1227 1234 } 1228 1235 1229 1236 static void ··· 1405 1398 size = 1 << hash->size_bits; 1406 1399 for (i = 0; i < size; i++) { 1407 1400 hlist_for_each_entry(entry, &hash->buckets[i], hlist) { 1408 - if (add_hash_entry(new_hash, entry->ip) == NULL) 1401 + if (add_hash_entry_direct(new_hash, entry->ip, entry->direct) == NULL) 1409 1402 goto free_hash; 1410 1403 } 1411 1404 }