fix multiple definition

This commit is contained in:
zy
2023-11-16 18:26:49 +08:00
parent 67b53ae048
commit d94f916f2d
6 changed files with 68 additions and 38 deletions

View File

@@ -1,5 +1,22 @@
#include "monitor_kallsyms.h"
unsigned long (*diag_kallsyms_lookup_name)(const char *name);
struct kprobe kprobe_kallsyms_lookup_name = {.symbol_name =
"kallsyms_lookup_name"};
unsigned int (*orig_stack_trace_save_tsk)(struct task_struct *task,
unsigned long *store,
unsigned int size,
unsigned int skipnr);
void (*orig_show_stack)(struct task_struct *task, unsigned long *sp,
const char *loglvl);
struct sched_class *orig_idle_sched_class;
int (*orig_get_task_type)(struct sched_entity *se);
int (*orig_kernfs_name)(struct kernfs_node *kn, char *buf, size_t buflen);
int (*orig_access_remote_vm)(struct mm_struct *mm, unsigned long addr,
void *buf, int len, unsigned int gup_flags);
/// @brief init kallsyms_lookup_name
/// @param
/// @return 0 is success
@@ -26,4 +43,5 @@ int init_orig_fun(void) {
LOOKUP_SYMS_NORET(get_task_type); // get_task_type
LOOKUP_SYMS_NORET(kernfs_name); // kernfs_name
return 0;
}