summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base/div0.stp
diff options
context:
space:
mode:
authorhunt <hunt>2007-03-14 07:11:11 +0000
committerhunt <hunt>2007-03-14 07:11:11 +0000
commit3b6fd2ea934f1d75174e5a786701c90f32553fe8 (patch)
treef1e359f5592625b3f2173885393aac3e8d853da8 /testsuite/systemtap.base/div0.stp
parentb272f21d2a42d44222cfc20f35025c324f6091c4 (diff)
downloadsystemtap-steved-3b6fd2ea934f1d75174e5a786701c90f32553fe8.tar.gz
systemtap-steved-3b6fd2ea934f1d75174e5a786701c90f32553fe8.tar.xz
systemtap-steved-3b6fd2ea934f1d75174e5a786701c90f32553fe8.zip
2007-03-14 Martin Hunt <hunt@redhat.com>
* systemtap.base/div0.stp: Fix so output won't possibly have the error message before the printed output. * systemtap.base/maxactive.exp: Ditto. * systemtap.maps/ix_clear.stp: Ditto. * systemtap.maps/ix_clear2.stp: Ditto. * systemtap.samples/args.exp: Remove obsolete "-r" option to staprun.
Diffstat (limited to 'testsuite/systemtap.base/div0.stp')
-rw-r--r--testsuite/systemtap.base/div0.stp23
1 files changed, 14 insertions, 9 deletions
diff --git a/testsuite/systemtap.base/div0.stp b/testsuite/systemtap.base/div0.stp
index 65710f09..b2694e58 100644
--- a/testsuite/systemtap.base/div0.stp
+++ b/testsuite/systemtap.base/div0.stp
@@ -2,7 +2,12 @@
* div.stp0
*
* Check the systemtap divide by 0 does not kill the machine
- * FIXME this test needs to be refined
+ *
+ * Note: Error messages are written to stderr. That means it is
+ * possible that if a printf is followed by something that
+ * generates an error, the error will get displayed before the printf.
+ * That is why both print's are in the begin probe.
+ *
*/
global x3
@@ -11,17 +16,17 @@ global x2
probe begin
{
- log("systemtap starting probe")
+ print("systemtap starting probe\n")
+ print("systemtap ending probe\n")
x1 = 56088; x2 = 0;
}
probe end
{
- log("systemtap ending probe")
- x3 = x1 / x2;
- if (x3 != 456 ) {
- log("systemtap test failure");
- } else {
- log("systemtap test success");
- }
+ x3 = x1 / x2
+ /* this part does not get executed */
+ if (x3 != 456 )
+ print("systemtap test failure\n")
+ else
+ print("systemtap test failure\n")
}