From 9523c6714e1b45d6ddde96b79bc2a8d39cb3193c Mon Sep 17 00:00:00 2001 From: Kris Van Hees Date: Fri, 11 Nov 2011 02:34:04 -0500 Subject: [PATCH] Fix resolving addresses of relocation records for SDT probe points. The addresses were being calculated based on the wrong starting point (_stext whereas it ought to be _text), and the base was not taken into account. Fixed the writing of NOPs in the location of the probe point calls, since the existing case was causing kernel paging faults. Made the add_nops() function in alternative.c non-static so it can be used in sdt_register. Use add_nops() to select the most appropriate NOP sequence for replacing the probe point call, and write the NOPs using text_poke(). Signed-off-by: Kris Van Hees --- dtrace/sdt_dev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dtrace/sdt_dev.c b/dtrace/sdt_dev.c index 3aaa11404f81..ad44e5c20aee 100644 --- a/dtrace/sdt_dev.c +++ b/dtrace/sdt_dev.c @@ -27,6 +27,7 @@ #include #include +#include #include "dtrace_dev.h" @@ -38,6 +39,8 @@ static long sdt_ioctl(struct file *file, static int sdt_open(struct inode *inode, struct file *file) { + /* Temporary call to assist testing SDT. */ + dtrace_register_builtins(); return -EAGAIN; } -- 2.50.1