Commit 62685ab0 authored by Jiri Olsa's avatar Jiri Olsa Committed by Peter Zijlstra
Browse files

uprobe: Move arch_uprobe_optimize right after handlers execution



It's less confusing to optimize uprobe right after handlers execution
and before we do the check for changed ip register to avoid situations
where changed ip register would skip uprobe optimization.

Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
Acked-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Acked-by: default avatarOleg Nesterov <oleg@redhat.com>
parent 3a866087
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -2765,6 +2765,9 @@ static void handle_swbp(struct pt_regs *regs)

	handler_chain(uprobe, regs);

	/* Try to optimize after first hit. */
	arch_uprobe_optimize(&uprobe->arch, bp_vaddr);

	/*
	 * If user decided to take execution elsewhere, it makes little sense
	 * to execute the original instruction, so let's skip it.
@@ -2772,9 +2775,6 @@ static void handle_swbp(struct pt_regs *regs)
	if (instruction_pointer(regs) != bp_vaddr)
		goto out;

	/* Try to optimize after first hit. */
	arch_uprobe_optimize(&uprobe->arch, bp_vaddr);

	if (arch_uprobe_skip_sstep(&uprobe->arch, regs))
		goto out;