#define sign_extend(x, signbit) ((x) | (0 - ((x) & (1 << (signbit)))))
#define branch_displacement(insn) sign_extend(((insn) & 0xffffff) << 2, 25)
-extern struct kprobe * per_cpu__current_kprobe;
-extern struct hlist_head kprobe_table[KPROBE_TABLE_SIZE];
static void (*__swap_register_undef_hook)(struct undef_hook *hook);
static void (*__swap_unregister_undef_hook)(struct undef_hook *hook);
#include <kprobe/swap_kprobes_deps.h>
#define SUPRESS_BUG_MESSAGES /**< Debug-off definition. */
-extern struct kprobe * per_cpu__current_kprobe;
-extern struct kprobe * per_cpu__current_kprobe;
-extern struct kprobe *swap_current_kprobe;
-
static int (*swap_fixup_exception)(struct pt_regs * regs);
static void *(*swap_text_poke)(void *addr, const void *opcode, size_t len);
DECLARE_PER_CPU(struct kprobe *, swap_current_kprobe);
-extern struct hlist_head kprobe_table[KPROBE_TABLE_SIZE];
-//extern struct hlist_head kretprobe_inst_table[KPROBE_TABLE_SIZE];
extern atomic_t kprobe_count;
extern unsigned long sched_addr;
#define DEBUG_PRINT_HASH_TABLE 0
#if DEBUG_PRINT_HASH_TABLE
-void print_kprobe_hash_table(void)
-{
- int i;
- struct hlist_head *head;
- struct kprobe *p;
- DECLARE_NODE_PTR_FOR_HLIST(node);
-
- // print uprobe table
- for (i = 0; i < KPROBE_TABLE_SIZE; ++i) {
- head = &kprobe_table[i];
- swap_hlist_for_each_entry_rcu(p, node, head, is_hlist_arm) {
- printk("####### find K tgid=%u, addr=%x\n",
- p->tgid, p->addr);
- }
- }
-}
-
-void print_kretprobe_hash_table(void)
-{
- int i;
- struct hlist_head *head;
- struct kprobe *p;
- DECLARE_NODE_PTR_FOR_HLIST(node);
-
- // print uprobe table
- for (i = 0; i < KPROBE_TABLE_SIZE; ++i) {
- head = &kretprobe_inst_table[i];
- swap_hlist_for_each_entry_rcu(p, node, head, is_hlist_arm) {
- printk("####### find KR tgid=%u, addr=%x\n",
- p->tgid, p->addr);
- }
- }
-}
-
void print_uprobe_hash_table(void)
{
int i;