summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorddomingo <ddomingo@redhat.com>2008-09-03 09:44:45 +1000
committerddomingo <ddomingo@redhat.com>2008-09-03 09:44:45 +1000
commit404939a6c4f982062116f05aa22f7dff0b0ce24e (patch)
tree53015ff483f6ed2d1e9cdabc9289358ade12a0e3 /runtime
parentaac23edfa124a016581871770af84d10efc38239 (diff)
parentf02dd36464a34542d5f853d8643cc473af59c5b2 (diff)
downloadsystemtap-steved-404939a6c4f982062116f05aa22f7dff0b0ce24e.tar.gz
systemtap-steved-404939a6c4f982062116f05aa22f7dff0b0ce24e.tar.xz
systemtap-steved-404939a6c4f982062116f05aa22f7dff0b0ce24e.zip
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Diffstat (limited to 'runtime')
-rw-r--r--runtime/ChangeLog5
-rw-r--r--runtime/loc2c-runtime.h7
-rw-r--r--runtime/task_finder.c14
-rw-r--r--runtime/task_finder_vma.c12
4 files changed, 28 insertions, 10 deletions
diff --git a/runtime/ChangeLog b/runtime/ChangeLog
index b7e44a0f..e02c5f0b 100644
--- a/runtime/ChangeLog
+++ b/runtime/ChangeLog
@@ -1,3 +1,8 @@
+2008-09-01 Frank Ch. Eigler <fche@elastic.org>
+
+ * task_finder.c: Move CONFIG_UTRACE assertion here.
+ * task_finder_vma.c (__stp_tf_add_vma): Make printk conditional.
+
2008-08-29 David Smith <dsmith@redhat.com>
* task_finder.c (__stp_utrace_attach_match_filename): Don't call
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 f1c2c41b..9c0dd55b 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"
@@ -1110,6 +1120,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");
@@ -1217,3 +1228,6 @@ stap_stop_task_finder(void)
debug_task_finder_report();
atomic_set(&__stp_task_finder_state, __STP_TF_STOPPED);
}
+
+
+#endif /* TASK_FINDER_C */
diff --git a/runtime/task_finder_vma.c b/runtime/task_finder_vma.c
index 9d43e36c..8c60175e 100644
--- a/runtime/task_finder_vma.c
+++ b/runtime/task_finder_vma.c
@@ -133,11 +133,13 @@ __stp_tf_add_vma(struct task_struct *tsk, unsigned long addr,
hlist_for_each_entry(entry, node, head, hlist) {
if (tsk->pid == entry->pid
&& addr == entry->addr) {
- printk(KERN_NOTICE
- "vma (pid: %d, vm_start: 0x%lx) present?\n",
- tsk->pid, vma->vm_start);
- mutex_unlock(&__stp_tf_vma_mutex);
- return -EBUSY; /* Already there */
+#ifdef DEBUG_TASK_FINDER_VMA
+ printk(KERN_NOTICE
+ "vma (pid: %d, vm_start: 0x%lx) present?\n",
+ tsk->pid, vma->vm_start);
+#endif
+ mutex_unlock(&__stp_tf_vma_mutex);
+ return -EBUSY; /* Already there */
}
}