diff options
author | David A. Long <dave.long@linaro.org> | 2014-02-03 14:25:49 -0500 |
---|---|---|
committer | David A. Long <dave.long@linaro.org> | 2014-03-18 16:39:34 -0400 |
commit | 6fe50a28ba6e5fafb4a549dea666dd15297dd8bd (patch) | |
tree | 998f67b5bb336339c5308e000b0f8f5c9e97a44e /kernel/events | |
parent | 21254ebc9e509967317ad8c6922797e21137ad53 (diff) |
uprobes: allow ignoring of probe hits
Allow arches to decided to ignore a probe hit. ARM will use this to
only call handlers if the conditions to execute a conditionally executed
instruction are satisfied.
Signed-off-by: David A. Long <dave.long@linaro.org>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Diffstat (limited to 'kernel/events')
-rw-r--r-- | kernel/events/uprobes.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index 307d87c0991a..04709b66369d 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c | |||
@@ -1804,6 +1804,11 @@ static bool handle_trampoline(struct pt_regs *regs) | |||
1804 | return true; | 1804 | return true; |
1805 | } | 1805 | } |
1806 | 1806 | ||
1807 | bool __weak arch_uprobe_ignore(struct arch_uprobe *aup, struct pt_regs *regs) | ||
1808 | { | ||
1809 | return false; | ||
1810 | } | ||
1811 | |||
1807 | /* | 1812 | /* |
1808 | * Run handler and ask thread to singlestep. | 1813 | * Run handler and ask thread to singlestep. |
1809 | * Ensure all non-fatal signals cannot interrupt thread while it singlesteps. | 1814 | * Ensure all non-fatal signals cannot interrupt thread while it singlesteps. |
@@ -1858,7 +1863,11 @@ static void handle_swbp(struct pt_regs *regs) | |||
1858 | if (!get_utask()) | 1863 | if (!get_utask()) |
1859 | goto out; | 1864 | goto out; |
1860 | 1865 | ||
1866 | if (arch_uprobe_ignore(&uprobe->arch, regs)) | ||
1867 | goto out; | ||
1868 | |||
1861 | handler_chain(uprobe, regs); | 1869 | handler_chain(uprobe, regs); |
1870 | |||
1862 | if (can_skip_sstep(uprobe, regs)) | 1871 | if (can_skip_sstep(uprobe, regs)) |
1863 | goto out; | 1872 | goto out; |
1864 | 1873 | ||