-struct kprobe *get_kprobe_by_insn_slot(kprobe_opcode_t *addr, pid_t tgid, struct pt_regs *regs);
+struct kprobe *get_ukprobe_by_insn_slot(void *addr, pid_t tgid, struct pt_regs *regs);
/* Get the kprobe at this addr (if any) - called with preemption disabled */
struct kprobe *get_kprobe(kprobe_opcode_t *addr, pid_t tgid);
/* Get the kprobe at this addr (if any) - called with preemption disabled */
struct kprobe *get_kprobe(kprobe_opcode_t *addr, pid_t tgid);
-#ifdef CONFIG_ARM
-struct kprobe *get_kprobe_by_insn_slot(kprobe_opcode_t *addr, pid_t tgid, struct pt_regs *regs);
-#else /* CONFIG_ARM */
-struct kprobe *get_kprobe_by_insn_slot (void *addr, int tgid, struct task_struct *ctask);
-#endif /* CONFIG_ARM */
+struct kprobe *get_ukprobe_by_insn_slot(void *addr, pid_t tgid, struct pt_regs *regs);
struct hlist_head *kretprobe_inst_table_head (void *hash_key);
struct hlist_head *kretprobe_inst_table_head (void *hash_key);
p = get_ukprobe(addr, tgid);
if (p == NULL) {
p = get_ukprobe(addr, tgid);
if (p == NULL) {
- p = get_kprobe_by_insn_slot(addr, tgid, regs);
+ p = get_ukprobe_by_insn_slot(addr, tgid, regs);
if (p == NULL) {
printk("no_uprobe\n");
return 1;
if (p == NULL) {
printk("no_uprobe\n");
return 1;
-static struct kprobe *get_kprobe_by_insn_slot_arm(kprobe_opcode_t *addr, pid_t tgid)
+static struct kprobe *get_ukprobe_bis_arm(void *addr, pid_t tgid)
{
struct hlist_head *head;
struct hlist_node *node;
{
struct hlist_head *head;
struct hlist_node *node;
- struct kprobe *p, *ret = NULL;
/* TODO: test - two processes invokes instrumented function */
head = &uprobe_insn_slot_table[hash_ptr(addr, UPROBE_HASH_BITS)];
hlist_for_each_entry_rcu(p, node, head, is_hlist_arm) {
/* TODO: test - two processes invokes instrumented function */
head = &uprobe_insn_slot_table[hash_ptr(addr, UPROBE_HASH_BITS)];
hlist_for_each_entry_rcu(p, node, head, is_hlist_arm) {
- if (p->ainsn.insn == addr && tgid == p->tgid) {
- ret = p;
- break;
+ if (p->ainsn.insn == addr && kp2up(p)->task->tgid == tgid) {
+ return p;
-static struct kprobe *get_kprobe_by_insn_slot_thumb(kprobe_opcode_t *addr, pid_t tgid)
+static struct kprobe *get_ukprobe_bis_thumb(void *addr, pid_t tgid)
{
struct hlist_head *head;
struct hlist_node *node;
{
struct hlist_head *head;
struct hlist_node *node;
- struct kprobe *p, *ret = NULL;
/* TODO: test - two processes invokes instrumented function */
head = &uprobe_insn_slot_table[hash_ptr(addr, UPROBE_HASH_BITS)];
hlist_for_each_entry_rcu(p, node, head, is_hlist_thumb) {
/* TODO: test - two processes invokes instrumented function */
head = &uprobe_insn_slot_table[hash_ptr(addr, UPROBE_HASH_BITS)];
hlist_for_each_entry_rcu(p, node, head, is_hlist_thumb) {
- if (p->ainsn.insn == addr && tgid == p->tgid) {
- ret = p;
- break;
+ if (p->ainsn.insn == addr && kp2up(p)->task->tgid == tgid) {
+ return p;
-struct kprobe *get_kprobe_by_insn_slot(kprobe_opcode_t *addr, pid_t tgid, struct pt_regs *regs)
+struct kprobe *get_ukprobe_by_insn_slot(void *addr, pid_t tgid, struct pt_regs *regs)
- struct kprobe *p = NULL;
-
- if (!thumb_mode(regs)) {
- p = get_kprobe_by_insn_slot_arm(addr - UPROBES_TRAMP_RET_BREAK_IDX, tgid);
- } else {
- p = get_kprobe_by_insn_slot_thumb((kprobe_opcode_t *)((unsigned long)addr - 0x1a), tgid);
- }
-
- return p;
+ return thumb_mode(regs) ?
+ get_ukprobe_bis_thumb(addr - 0x1a, tgid) :
+ get_ukprobe_bis_arm(addr - 4 * UPROBES_TRAMP_RET_BREAK_IDX, tgid);
-struct kprobe *get_kprobe_by_insn_slot(void *addr, int tgid, struct task_struct *ctask)
+struct kprobe *get_ukprobe_by_insn_slot(void *addr, pid_t tgid, struct pt_regs *regs)
{
struct hlist_head *head;
struct hlist_node *node;
{
struct hlist_head *head;
struct hlist_node *node;
- struct kprobe *p, *ret = NULL;
/* TODO: test - two processes invokes instrumented function */
head = &uprobe_insn_slot_table[hash_ptr(addr, UPROBE_HASH_BITS)];
hlist_for_each_entry_rcu(p, node, head, is_hlist) {
/* TODO: test - two processes invokes instrumented function */
head = &uprobe_insn_slot_table[hash_ptr(addr, UPROBE_HASH_BITS)];
hlist_for_each_entry_rcu(p, node, head, is_hlist) {
- if (p->ainsn.insn == addr && tgid == p->tgid) {
- ret = p;
- break;
+ if (p->ainsn.insn == addr && kp2up(p)->task->tgid == tgid) {
+ return p;
}
#endif /* CONFIG_ARM */
}
#endif /* CONFIG_ARM */