summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/systemtap.base')
-rw-r--r--testsuite/systemtap.base/cast.exp3
-rw-r--r--testsuite/systemtap.base/cast.stp9
-rw-r--r--testsuite/systemtap.base/pointer_array.exp13
-rw-r--r--testsuite/systemtap.base/pointer_array.stp16
-rw-r--r--testsuite/systemtap.base/utrace_syscall_args.stp2
5 files changed, 41 insertions, 2 deletions
diff --git a/testsuite/systemtap.base/cast.exp b/testsuite/systemtap.base/cast.exp
index 374132f0..38ef67b9 100644
--- a/testsuite/systemtap.base/cast.exp
+++ b/testsuite/systemtap.base/cast.exp
@@ -2,5 +2,6 @@ set test "cast"
set ::result_string {PID OK
PID2 OK
execname OK
-sa_data OK}
+sa_data OK
+usage OK}
stap_run2 $srcdir/$subdir/$test.stp -g
diff --git a/testsuite/systemtap.base/cast.stp b/testsuite/systemtap.base/cast.stp
index e2505000..bb889bb8 100644
--- a/testsuite/systemtap.base/cast.stp
+++ b/testsuite/systemtap.base/cast.stp
@@ -33,6 +33,15 @@ probe begin
else
printf("sa_data %d != %d\n", data, cast_data)
+ // Compare usage counter values through a struct address
+ usage = @cast(curr, "task_struct")->usage->counter
+ pusage = & @cast(curr, "task_struct")->usage
+ cast_usage = @cast(pusage, "atomic_t")->counter
+ if (usage == cast_usage)
+ println("usage OK")
+ else
+ printf("usage %d != %d\n", usage, cast_usage)
+
exit()
}
diff --git a/testsuite/systemtap.base/pointer_array.exp b/testsuite/systemtap.base/pointer_array.exp
new file mode 100644
index 00000000..0e3af213
--- /dev/null
+++ b/testsuite/systemtap.base/pointer_array.exp
@@ -0,0 +1,13 @@
+set test "pointer_array"
+set ::result_string {/bin/true
+/
+b
+i
+n
+/
+t
+r
+u
+e
+0}
+stap_run2 $srcdir/$subdir/$test.stp -c/bin/true
diff --git a/testsuite/systemtap.base/pointer_array.stp b/testsuite/systemtap.base/pointer_array.stp
new file mode 100644
index 00000000..1d15ebf4
--- /dev/null
+++ b/testsuite/systemtap.base/pointer_array.stp
@@ -0,0 +1,16 @@
+probe syscall.execve
+{
+ if (pid() == target()) {
+ println(user_string($argv[0]))
+ printf("%c\n", $argv[0][0])
+ printf("%c\n", $argv[0][1])
+ printf("%c\n", $argv[0][2])
+ printf("%c\n", $argv[0][3])
+ printf("%c\n", $argv[0][4])
+ printf("%c\n", $argv[0][5])
+ printf("%c\n", $argv[0][6])
+ printf("%c\n", $argv[0][7])
+ printf("%c\n", $argv[0][8])
+ println($argv[0][9])
+ }
+}
diff --git a/testsuite/systemtap.base/utrace_syscall_args.stp b/testsuite/systemtap.base/utrace_syscall_args.stp
index 6c9e14fc..5c6ca451 100644
--- a/testsuite/systemtap.base/utrace_syscall_args.stp
+++ b/testsuite/systemtap.base/utrace_syscall_args.stp
@@ -36,7 +36,7 @@ probe begin
}
probe syscall.open {
- if (filename == "foobar") {
+ if (pid() == target() && filename == "foobar") {
syscalls_seen += 1
}
}