diff options
-rw-r--r-- | arch/x86/kernel/kprobes.c | 27 | ||||
-rw-r--r-- | tools/perf/util/trace-event-parse.c | 2 |
2 files changed, 14 insertions, 15 deletions
diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c index b43bbaebe2c0..1658efdfb4e5 100644 --- a/arch/x86/kernel/kprobes.c +++ b/arch/x86/kernel/kprobes.c | |||
@@ -534,20 +534,6 @@ static int __kprobes kprobe_handler(struct pt_regs *regs) | |||
534 | struct kprobe_ctlblk *kcb; | 534 | struct kprobe_ctlblk *kcb; |
535 | 535 | ||
536 | addr = (kprobe_opcode_t *)(regs->ip - sizeof(kprobe_opcode_t)); | 536 | addr = (kprobe_opcode_t *)(regs->ip - sizeof(kprobe_opcode_t)); |
537 | if (*addr != BREAKPOINT_INSTRUCTION) { | ||
538 | /* | ||
539 | * The breakpoint instruction was removed right | ||
540 | * after we hit it. Another cpu has removed | ||
541 | * either a probepoint or a debugger breakpoint | ||
542 | * at this address. In either case, no further | ||
543 | * handling of this interrupt is appropriate. | ||
544 | * Back up over the (now missing) int3 and run | ||
545 | * the original instruction. | ||
546 | */ | ||
547 | regs->ip = (unsigned long)addr; | ||
548 | return 1; | ||
549 | } | ||
550 | |||
551 | /* | 537 | /* |
552 | * We don't want to be preempted for the entire | 538 | * We don't want to be preempted for the entire |
553 | * duration of kprobe processing. We conditionally | 539 | * duration of kprobe processing. We conditionally |
@@ -579,6 +565,19 @@ static int __kprobes kprobe_handler(struct pt_regs *regs) | |||
579 | setup_singlestep(p, regs, kcb, 0); | 565 | setup_singlestep(p, regs, kcb, 0); |
580 | return 1; | 566 | return 1; |
581 | } | 567 | } |
568 | } else if (*addr != BREAKPOINT_INSTRUCTION) { | ||
569 | /* | ||
570 | * The breakpoint instruction was removed right | ||
571 | * after we hit it. Another cpu has removed | ||
572 | * either a probepoint or a debugger breakpoint | ||
573 | * at this address. In either case, no further | ||
574 | * handling of this interrupt is appropriate. | ||
575 | * Back up over the (now missing) int3 and run | ||
576 | * the original instruction. | ||
577 | */ | ||
578 | regs->ip = (unsigned long)addr; | ||
579 | preempt_enable_no_resched(); | ||
580 | return 1; | ||
582 | } else if (kprobe_running()) { | 581 | } else if (kprobe_running()) { |
583 | p = __get_cpu_var(current_kprobe); | 582 | p = __get_cpu_var(current_kprobe); |
584 | if (p->break_handler && p->break_handler(p, regs)) { | 583 | if (p->break_handler && p->break_handler(p, regs)) { |
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c index 9b3c20f42f98..613c9cc90570 100644 --- a/tools/perf/util/trace-event-parse.c +++ b/tools/perf/util/trace-event-parse.c | |||
@@ -1925,7 +1925,7 @@ void *raw_field_ptr(struct event *event, const char *name, void *data) | |||
1925 | if (!field) | 1925 | if (!field) |
1926 | return NULL; | 1926 | return NULL; |
1927 | 1927 | ||
1928 | if (field->flags & FIELD_IS_STRING) { | 1928 | if (field->flags & FIELD_IS_DYNAMIC) { |
1929 | int offset; | 1929 | int offset; |
1930 | 1930 | ||
1931 | offset = *(int *)(data + field->offset); | 1931 | offset = *(int *)(data + field->offset); |