summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStan Cox <scox@redhat.com>2010-01-15 15:06:35 -0500
committerStan Cox <scox@redhat.com>2010-01-15 15:06:35 -0500
commit77694f530954dfeaf76662ebaae67ac39239a24b (patch)
treefef1a3f05ba8de5086a088a3fd0acf743bdc4e9d
parent2a1c9b5db533fe7d2d2d4bac572195c490de62fb (diff)
downloadsystemtap-steved-77694f530954dfeaf76662ebaae67ac39239a24b.tar.gz
systemtap-steved-77694f530954dfeaf76662ebaae67ac39239a24b.tar.xz
systemtap-steved-77694f530954dfeaf76662ebaae67ac39239a24b.zip
Relax sdt address check for attach to running process case.
* uprobes-common.c (stap_uprobe_change_plus): Relax VM_EXEC check.
-rw-r--r--runtime/uprobes-common.c4
-rw-r--r--testsuite/systemtap.base/sdt_misc.exp11
2 files changed, 10 insertions, 5 deletions
diff --git a/runtime/uprobes-common.c b/runtime/uprobes-common.c
index 58e3a05f..17ed69fc 100644
--- a/runtime/uprobes-common.c
+++ b/runtime/uprobes-common.c
@@ -37,7 +37,7 @@ static int stap_uprobe_change_plus (struct task_struct *tsk, unsigned long reloc
if (likely(sups->tfi != tfi)) continue;
/* skip probes with an address beyond this map event; should not
happen unless a shlib/exec got mmapped in weirdly piecemeal */
- if (likely((vm_flags & VM_EXEC) && ((sups->address >= length) || (sups->sdt_sem_offset >= length)))) continue;
+ if (likely((vm_flags & VM_EXEC) && sups->address >= length)) continue;
/* Found a uprobe_spec for this stap_uprobe_tf. Need to lock the
stap_uprobes[] array to allocate a free spot, but then we can
@@ -159,7 +159,7 @@ static int stap_uprobe_change_semaphore_plus (struct task_struct *tsk, unsigned
_stp_dbug(__FUNCTION__,__LINE__, "+semaphore %#x @ %#lx spec %d idx %d task %d\n", sdt_semaphore, sup->sdt_sem_address, sup->spec_index, i, tsk->tgid);
}
#endif
- rc = put_user (sdt_semaphore, (unsigned short __user*) sup->sdt_sem_address);
+ rc = put_user (sdt_semaphore, (unsigned short __user*) sup->sdt_sem_address);
/* XXX: need to analyze possibility of race condition */
}
}
diff --git a/testsuite/systemtap.base/sdt_misc.exp b/testsuite/systemtap.base/sdt_misc.exp
index 74ebdc4e..3ba38c45 100644
--- a/testsuite/systemtap.base/sdt_misc.exp
+++ b/testsuite/systemtap.base/sdt_misc.exp
@@ -74,13 +74,13 @@ int
main ()
{
#ifdef LOOP
+ #include <signal.h>
+ signal (SIGINT, &int_handler);
+ signal (SIGALRM, &alrm_handler);
alarm (30);
while (!loop_check())
{
}
- #include <signal.h>
- signal (SIGINT, &int_handler);
- signal (SIGALRM, &alrm_handler);
#endif
bar(2);
baz(3,(char*)\"abc\");
@@ -379,6 +379,11 @@ if {$ok == 5} {
# 5. Test attaching to a running process with markers in a shared object
if { $pbtype_mssg != "kprobe" } {
+set loop_flags "additional_flags=-I$srcdir/../includes/sys"
+set loop_flags "$loop_flags additional_flags=-I$sdtdir"
+set loop_flags "$loop_flags additional_flags=-g"
+set loop_flags "$loop_flags additional_flags=-I. $pbtype_flag"
+set loop_flags "$loop_flags additional_flags=-DLOOP"
set loop_flags "$loop_flags additional_flags=-DONLY_MAIN"
set loop_flags "$loop_flags additional_flags=-Wl,-rpath,[pwd]"
set loop_flags "$loop_flags additional_flags=-L[pwd] additional_flags=-lsdt-$pbtype_mssg"