Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf update from Thomas Gleixner: "The perf crowd presents: Kernel updates: - Removal of jprobes - Cleanup and consolidatation the handling of kprobes - Cleanup and consolidation of hardware breakpoints - The usual pile of fixes and updates to PMUs and event descriptors Tooling updates: - Updates and improvements all over the place. Nothing outstanding, just the (good) boring incremental grump work" * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (103 commits) perf trace: Do not require --no-syscalls to suppress strace like output perf bpf: Include uapi/linux/bpf.h from the 'perf trace' script's bpf.h perf tools: Allow overriding MAX_NR_CPUS at compile time perf bpf: Show better message when failing to load an object perf list: Unify metric group description format with PMU event description perf vendor events arm64: Update ThunderX2 implementation defined pmu core events perf cs-etm: Generate branch sample for CS_ETM_TRACE_ON packet perf cs-etm: Generate branch sample when receiving a CS_ETM_TRACE_ON packet perf cs-etm: Support dummy address value for CS_ETM_TRACE_ON packet perf cs-etm: Fix start tracing packet handling perf build: Fix installation directory for eBPF perf c2c report: Fix crash for empty browser perf tests: Fix indexing when invoking subtests perf trace: Beautify the AF_INET & AF_INET6 'socket' syscall 'protocol' args perf trace beauty: Add beautifiers for 'socket''s 'protocol' arg perf trace beauty: Do not print NULL strarray entries perf beauty: Add a generator for IPPROTO_ socket's protocol constants tools include uapi: Grab a copy of linux/in.h perf tests: Fix complex event name parsing perf evlist: Fix error out while applying initial delay and LBR ...
This commit is contained in:
@@ -44,7 +44,6 @@ struct kprobe_ctlblk {
|
||||
unsigned long kprobe_status;
|
||||
unsigned long kprobe_orig_tnpc;
|
||||
unsigned long kprobe_orig_tstate_pil;
|
||||
struct pt_regs jprobe_saved_regs;
|
||||
struct prev_kprobe prev_kprobe;
|
||||
};
|
||||
|
||||
|
@@ -147,18 +147,12 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
|
||||
kcb->kprobe_status = KPROBE_REENTER;
|
||||
prepare_singlestep(p, regs, kcb);
|
||||
return 1;
|
||||
} else {
|
||||
if (*(u32 *)addr != BREAKPOINT_INSTRUCTION) {
|
||||
} else if (*(u32 *)addr != BREAKPOINT_INSTRUCTION) {
|
||||
/* The breakpoint instruction was removed by
|
||||
* another cpu right after we hit, no further
|
||||
* handling of this interrupt is appropriate
|
||||
*/
|
||||
ret = 1;
|
||||
goto no_kprobe;
|
||||
}
|
||||
p = __this_cpu_read(current_kprobe);
|
||||
if (p->break_handler && p->break_handler(p, regs))
|
||||
goto ss_probe;
|
||||
ret = 1;
|
||||
}
|
||||
goto no_kprobe;
|
||||
}
|
||||
@@ -181,10 +175,12 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
|
||||
|
||||
set_current_kprobe(p, regs, kcb);
|
||||
kcb->kprobe_status = KPROBE_HIT_ACTIVE;
|
||||
if (p->pre_handler && p->pre_handler(p, regs))
|
||||
if (p->pre_handler && p->pre_handler(p, regs)) {
|
||||
reset_current_kprobe();
|
||||
preempt_enable_no_resched();
|
||||
return 1;
|
||||
}
|
||||
|
||||
ss_probe:
|
||||
prepare_singlestep(p, regs, kcb);
|
||||
kcb->kprobe_status = KPROBE_HIT_SS;
|
||||
return 1;
|
||||
@@ -441,53 +437,6 @@ out:
|
||||
exception_exit(prev_state);
|
||||
}
|
||||
|
||||
/* Jprobes support. */
|
||||
int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
|
||||
{
|
||||
struct jprobe *jp = container_of(p, struct jprobe, kp);
|
||||
struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
|
||||
|
||||
memcpy(&(kcb->jprobe_saved_regs), regs, sizeof(*regs));
|
||||
|
||||
regs->tpc = (unsigned long) jp->entry;
|
||||
regs->tnpc = ((unsigned long) jp->entry) + 0x4UL;
|
||||
regs->tstate |= TSTATE_PIL;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void __kprobes jprobe_return(void)
|
||||
{
|
||||
struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
|
||||
register unsigned long orig_fp asm("g1");
|
||||
|
||||
orig_fp = kcb->jprobe_saved_regs.u_regs[UREG_FP];
|
||||
__asm__ __volatile__("\n"
|
||||
"1: cmp %%sp, %0\n\t"
|
||||
"blu,a,pt %%xcc, 1b\n\t"
|
||||
" restore\n\t"
|
||||
".globl jprobe_return_trap_instruction\n"
|
||||
"jprobe_return_trap_instruction:\n\t"
|
||||
"ta 0x70"
|
||||
: /* no outputs */
|
||||
: "r" (orig_fp));
|
||||
}
|
||||
|
||||
extern void jprobe_return_trap_instruction(void);
|
||||
|
||||
int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
|
||||
{
|
||||
u32 *addr = (u32 *) regs->tpc;
|
||||
struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
|
||||
|
||||
if (addr == (u32 *) jprobe_return_trap_instruction) {
|
||||
memcpy(regs, &(kcb->jprobe_saved_regs), sizeof(*regs));
|
||||
preempt_enable_no_resched();
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* The value stored in the return address register is actually 2
|
||||
* instructions before where the callee will return to.
|
||||
* Sequences usually look something like this
|
||||
@@ -562,9 +511,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p,
|
||||
regs->tpc = orig_ret_address;
|
||||
regs->tnpc = orig_ret_address + 4;
|
||||
|
||||
reset_current_kprobe();
|
||||
kretprobe_hash_unlock(current, &flags);
|
||||
preempt_enable_no_resched();
|
||||
|
||||
hlist_for_each_entry_safe(ri, tmp, &empty_rp, hlist) {
|
||||
hlist_del(&ri->hlist);
|
||||
|
Reference in New Issue
Block a user