Skip to content

Commit e8440c1

Browse files
cuviperoleg-nesterov
authored andcommitted
uprobes: Add exports for module use
The original pull message for uprobes (commit 654443e) noted: This tree includes uprobes support in 'perf probe' - but SystemTap (and other tools) can take advantage of user probe points as well. In order to actually be usable in module-based tools like SystemTap, the interface needs to be exported. This patch first adds the obvious exports for uprobe_register and uprobe_unregister. Then it also adds one for task_user_regset_view, which is necessary to get the correct state of userspace registers. Signed-off-by: Josh Stone <jistone@redhat.com> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
1 parent af4355e commit e8440c1

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎kernel/events/uprobes.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <linux/pagemap.h> /* read_mapping_page */
2828
#include <linux/slab.h>
2929
#include <linux/sched.h>
30+
#include <linux/export.h>
3031
#include <linux/rmap.h> /* anon_vma_prepare */
3132
#include <linux/mmu_notifier.h> /* set_pte_at_notify */
3233
#include <linux/swap.h> /* try_to_free_swap */
@@ -851,6 +852,7 @@ int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *
851852
goto retry;
852853
return ret;
853854
}
855+
EXPORT_SYMBOL_GPL(uprobe_register);
854856

855857
/*
856858
* uprobe_unregister - unregister a already registered probe.
@@ -871,6 +873,7 @@ void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consume
871873
up_write(&uprobe->register_rwsem);
872874
put_uprobe(uprobe);
873875
}
876+
EXPORT_SYMBOL_GPL(uprobe_unregister);
874877

875878
static int unapply_uprobe(struct uprobe *uprobe, struct mm_struct *mm)
876879
{

‎kernel/ptrace.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,12 @@ static int ptrace_regset(struct task_struct *task, int req, unsigned int type,
712712
kiov->iov_len, kiov->iov_base);
713713
}
714714

715+
/*
716+
* This is declared in linux/regset.h and defined in machine-dependent
717+
* code. We put the export here, near the primary machine-neutral use,
718+
* to ensure no machine forgets it.
719+
*/
720+
EXPORT_SYMBOL_GPL(task_user_regset_view);
715721
#endif
716722

717723
int ptrace_request(struct task_struct *child, long request,

0 commit comments

Comments
 (0)