summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorDavid Smith <dsmith@redhat.com>2009-04-21 08:21:34 -0500
committerDavid Smith <dsmith@redhat.com>2009-04-21 08:21:34 -0500
commitd0ea46ceac2e72fe0b86269ea50c004711148158 (patch)
treeb3eff51448fec3ac7ebe0d24da69ea87113ec955 /testsuite
parent543b26ed48ac66743ad309ac6cb848a5d377260f (diff)
downloadsystemtap-steved-d0ea46ceac2e72fe0b86269ea50c004711148158.tar.gz
systemtap-steved-d0ea46ceac2e72fe0b86269ea50c004711148158.tar.xz
systemtap-steved-d0ea46ceac2e72fe0b86269ea50c004711148158.zip
Correctly handle $syscall in process(PID_OR_PATH).syscall.return probes.
2009-04-21 David Smith <dsmith@redhat.com> * tapsets.cxx (utrace_derived_probe::utrace_derived_probe): If during target-variable-expanding the probe, we added a new block or probe, add them. (utrace_var_expanding_visitor::visit_target_symbol_cached): New function to cache target variables in a generated syscall probe to use in syscall.return probes. (utrace_var_expanding_visitor::visit_target_symbol_context): In a syscall.return probe, you can't access $syscall. So use visit_target_symbol_cached() to cache the value for use here. * testsuite/systemtap.base/utrace_syscall_args.stp: Test use of $syscall in syscall.return probes.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/systemtap.base/utrace_syscall_args.stp40
1 files changed, 40 insertions, 0 deletions
diff --git a/testsuite/systemtap.base/utrace_syscall_args.stp b/testsuite/systemtap.base/utrace_syscall_args.stp
index 166e1ace..6c9e14fc 100644
--- a/testsuite/systemtap.base/utrace_syscall_args.stp
+++ b/testsuite/systemtap.base/utrace_syscall_args.stp
@@ -113,18 +113,23 @@ probe process("utrace_syscall_args").syscall.return {
if (syscalls_seen >= 4) {
if (syscalls_seen == 4) {
mmap_args[7] = $return
+ mmap_args[8] = $syscall
}
else if (syscalls_seen == 5) {
munmap_args[3] = $return
+ munmap_args[4] = $syscall
}
else if (syscalls_seen == 6) {
close_args[2] = $return
+ close_args[3] = $syscall
}
else if (syscalls_seen == 7) {
dup_args[7] = $return
+ dup_args[8] = $syscall
}
else if (syscalls_seen == 8) {
bad_syscall_args[7] = $return
+ bad_syscall_args[8] = $syscall
syscalls_seen = 0
}
}
@@ -159,6 +164,13 @@ probe end
failures += 1
printf("mmap bad arg 6: 0x%x vs 0x0\n", mmap_args[6])
}
+
+ # Validate syscall number
+ if (mmap_args[0] != mmap_args[8]) {
+ failures += 1
+ printf("mmap $syscall mismatch: %d vs. %d\n",
+ mmap_args[0], mmap_args[8])
+ }
}
# print munmap info
@@ -191,6 +203,13 @@ probe end
failures += 1
printf("munmap bad return value: 0x%x vs 0x0\n", munmap_args[7])
}
+
+ # Validate syscall number
+ if (munmap_args[0] != munmap_args[4]) {
+ failures += 1
+ printf("munmap $syscall mismatch: %d vs. %d\n",
+ munmap_args[0], munmap_args[4])
+ }
}
# print close info
@@ -207,6 +226,13 @@ probe end
printf("close bad arg 1: 0x%x vs 0x%x\n",
close_args[0], mmap_args[5])
}
+
+ # Validate syscall number
+ if (close_args[0] != close_args[3]) {
+ failures += 1
+ printf("close $syscall mismatch: %d vs. %d\n",
+ close_args[0], close_args[3])
+ }
}
# print dup info
@@ -278,6 +304,13 @@ probe end
printf("dup bad arg 6: 0x%x vs 0xe38e38e3\n", dup_args[6])
}
}
+
+ # Validate syscall number
+ if (dup_args[0] != dup_args[8]) {
+ failures += 1
+ printf("dup $syscall mismatch: %d vs. %d\n",
+ dup_args[0], dup_args[8])
+ }
}
# print bad_syscall info
@@ -355,6 +388,13 @@ probe end
bad_syscall_args[6])
}
}
+
+ # Validate syscall number
+ if (bad_syscall_args[0] != bad_syscall_args[8]) {
+ failures += 1
+ printf("bad_syscall $syscall mismatch: %d vs. %d\n",
+ bad_syscall_args[0], bad_syscall_args[8])
+ }
}
if (failures == 0) {