]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Fix resolving addresses of relocation records for SDT probe points. The
authorKris Van Hees <kris.van.hees@oracle.com>
Fri, 11 Nov 2011 07:34:04 +0000 (02:34 -0500)
committerKris Van Hees <kris.van.hees@oracle.com>
Fri, 11 Nov 2011 07:34:04 +0000 (02:34 -0500)
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 <kris.van.hees@oracle.com>
dtrace/sdt_dev.c

index 3aaa11404f810f38a48d6744bcc280e3869363cc..ad44e5c20aeed902ba1050db7a5026f5ae3df26e 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <linux/fs.h>
 #include <linux/miscdevice.h>
+#include <linux/sdt.h>
 
 #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;
 }