mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 02:17:36 -04:00
ftrace: Add ftrace_hash_count function
Adding external ftrace_hash_count function so we could get hash count outside of ftrace object. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Link: https://lore.kernel.org/r/20260606123955.345967-2-jolsa@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
committed by
Alexei Starovoitov
parent
5b038319be
commit
e57f13eaab
@@ -551,6 +551,8 @@ int update_ftrace_direct_mod(struct ftrace_ops *ops, struct ftrace_hash *hash, b
|
||||
|
||||
void ftrace_stub_direct_tramp(void);
|
||||
|
||||
unsigned long ftrace_hash_count(struct ftrace_hash *hash);
|
||||
|
||||
#else
|
||||
struct ftrace_ops;
|
||||
static inline unsigned long ftrace_find_rec_direct(unsigned long ip)
|
||||
@@ -590,6 +592,11 @@ static inline int update_ftrace_direct_mod(struct ftrace_ops *ops, struct ftrace
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static inline unsigned long ftrace_hash_count(struct ftrace_hash *hash)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* This must be implemented by the architecture.
|
||||
* It is the way the ftrace direct_ops helper, when called
|
||||
|
||||
@@ -6288,11 +6288,16 @@ int modify_ftrace_direct(struct ftrace_ops *ops, unsigned long addr)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(modify_ftrace_direct);
|
||||
|
||||
static unsigned long hash_count(struct ftrace_hash *hash)
|
||||
static inline unsigned long hash_count(struct ftrace_hash *hash)
|
||||
{
|
||||
return hash ? hash->count : 0;
|
||||
}
|
||||
|
||||
unsigned long ftrace_hash_count(struct ftrace_hash *hash)
|
||||
{
|
||||
return hash_count(hash);
|
||||
}
|
||||
|
||||
/**
|
||||
* hash_add - adds two struct ftrace_hash and returns the result
|
||||
* @a: struct ftrace_hash object
|
||||
|
||||
Reference in New Issue
Block a user