arch/powerpc/kernel/kprobes-ftrace.c

Source file repositories/reference/linux-study-clean/arch/powerpc/kernel/kprobes-ftrace.c

File Facts

System
Linux kernel
Corpus path
arch/powerpc/kernel/kprobes-ftrace.c
Extension
.c
Size
1847 bytes
Lines
76
Domain
Architecture Layer
Bucket
arch/powerpc
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

if (!p->pre_handler || !p->pre_handler(p, regs)) {
			/*
			 * Emulate singlestep (and also recover regs->nip)
			 * as if there is a nop
			 */
			regs_add_return_ip(regs, MCOUNT_INSN_SIZE);
			if (unlikely(p->post_handler)) {
				kcb->kprobe_status = KPROBE_HIT_SSDONE;
				p->post_handler(p, regs, 0);
			}
		}
		/*
		 * If pre_handler returns !0, it changes regs->nip. We have to
		 * skip emulating post_handler.
		 */
		__this_cpu_write(current_kprobe, NULL);
	}
out:
	ftrace_test_recursion_unlock(bit);
}
NOKPROBE_SYMBOL(kprobe_ftrace_handler);

int arch_prepare_kprobe_ftrace(struct kprobe *p)
{
	p->ainsn.insn = NULL;
	p->ainsn.boostable = -1;
	return 0;
}

Annotation

Implementation Notes