Skip to content

Commit 40c577a

Browse files
olsajiriKernel Patches Daemon
authored andcommitted
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 <[email protected]>
1 parent 3bd2c43 commit 40c577a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

kernel/trace/ftrace.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ static void __add_hash_entry(struct ftrace_hash *hash,
11861186
}
11871187

11881188
static struct ftrace_func_entry *
1189-
add_hash_entry(struct ftrace_hash *hash, unsigned long ip)
1189+
add_hash_entry_direct(struct ftrace_hash *hash, unsigned long ip, unsigned long direct)
11901190
{
11911191
struct ftrace_func_entry *entry;
11921192

@@ -1195,11 +1195,18 @@ add_hash_entry(struct ftrace_hash *hash, unsigned long ip)
11951195
return NULL;
11961196

11971197
entry->ip = ip;
1198+
entry->direct = direct;
11981199
__add_hash_entry(hash, entry);
11991200

12001201
return entry;
12011202
}
12021203

1204+
static struct ftrace_func_entry *
1205+
add_hash_entry(struct ftrace_hash *hash, unsigned long ip)
1206+
{
1207+
return add_hash_entry_direct(hash, ip, 0);
1208+
}
1209+
12031210
static void
12041211
free_hash_entry(struct ftrace_hash *hash,
12051212
struct ftrace_func_entry *entry)
@@ -1372,7 +1379,7 @@ alloc_and_copy_ftrace_hash(int size_bits, struct ftrace_hash *hash)
13721379
size = 1 << hash->size_bits;
13731380
for (i = 0; i < size; i++) {
13741381
hlist_for_each_entry(entry, &hash->buckets[i], hlist) {
1375-
if (add_hash_entry(new_hash, entry->ip) == NULL)
1382+
if (add_hash_entry_direct(new_hash, entry->ip, entry->direct) == NULL)
13761383
goto free_hash;
13771384
}
13781385
}

0 commit comments

Comments
 (0)