summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/loc2c-runtime.h7
-rw-r--r--runtime/task_finder.c14
2 files changed, 16 insertions, 5 deletions
diff --git a/runtime/loc2c-runtime.h b/runtime/loc2c-runtime.h
index 215676ee..1247da51 100644
--- a/runtime/loc2c-runtime.h
+++ b/runtime/loc2c-runtime.h
@@ -113,16 +113,13 @@
kernel mode, it is not saved in the trap frame (struct pt_regs).
The `esp' (and `xss') fields are valid only for a user-mode trap.
For a kernel mode trap, the interrupted state's esp is actually an
- address inside where the `struct pt_regs' on the kernel trap stack points.
-
- For now we assume all traps are from kprobes in kernel-mode code.
- For extra paranoia, could do BUG_ON((regs->xcs & 3) == 3). */
+ address inside where the `struct pt_regs' on the kernel trap stack points. */
#define dwarf_register_0(regs) regs->eax
#define dwarf_register_1(regs) regs->ecx
#define dwarf_register_2(regs) regs->edx
#define dwarf_register_3(regs) regs->ebx
-#define dwarf_register_4(regs) ((long) &regs->esp)
+#define dwarf_register_4(regs) (user_mode(regs) ? regs->esp : (long)&regs->esp)
#define dwarf_register_5(regs) regs->ebp
#define dwarf_register_6(regs) regs->esi
#define dwarf_register_7(regs) regs->edi
diff --git a/runtime/task_finder.c b/runtime/task_finder.c
index d81ad115..146ce06f 100644
--- a/runtime/task_finder.c
+++ b/runtime/task_finder.c
@@ -1,5 +1,15 @@
+#ifndef TASK_FINDER_C
+#define TASK_FINDER_C
+
+#if ! defined(CONFIG_UTRACE)
+#error "Need CONFIG_UTRACE!"
+#endif
+
+#include <linux/utrace.h>
#include <linux/list.h>
#include <linux/binfmts.h>
+#include <linux/mount.h>
+
#include "syscall.h"
#include "utrace_compatibility.h"
#include "task_finder_vma.c"
@@ -1069,6 +1079,7 @@ stap_start_task_finder(void)
struct task_struct *grp, *tsk;
char *mmpath_buf;
+ debug_task_finder_report();
mmpath_buf = _stp_kmalloc(PATH_MAX);
if (mmpath_buf == NULL) {
_stp_error("Unable to allocate space for path");
@@ -1189,3 +1200,6 @@ stap_stop_task_finder(void)
debug_task_finder_report();
atomic_set(&__stp_task_finder_state, __STP_TF_STOPPED);
}
+
+
+#endif /* TASK_FINDER_C */