From 6dfeb4e36f7339ddfafefcb69578e1b5809b6e72 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Wed, 1 Apr 2009 11:26:01 -0400 Subject: semok/badvar.stp test: add stap -p2 as for other semok tests --- testsuite/semok/badvar.stp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'testsuite/semok') diff --git a/testsuite/semok/badvar.stp b/testsuite/semok/badvar.stp index b3bd2d67..677187a3 100755 --- a/testsuite/semok/badvar.stp +++ b/testsuite/semok/badvar.stp @@ -1,7 +1,9 @@ -#! stap --skip-badvars +#! /bin/sh +stap -p2 --skip-badvars -e ' probe syscall.read { if ($foo == 0) printf ("Voila! It works..\n") exit () } +' -- cgit From 219b3700b8603b6fe3610d6f06e353f3c041ee0b Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 20 Apr 2009 17:18:32 -0700 Subject: Add tests for @cast-generated modules --- testsuite/semok/cast.stp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'testsuite/semok') diff --git a/testsuite/semok/cast.stp b/testsuite/semok/cast.stp index 93da18ef..d30823cd 100755 --- a/testsuite/semok/cast.stp +++ b/testsuite/semok/cast.stp @@ -10,4 +10,8 @@ probe begin { // would be nice to test usermode @cast too, // but who knows what debuginfo is installed... + + // check modules generated from headers + println(@cast(0, "task_struct", "kmod")->tgid) + println(@cast(0, "timeval", "umod")->tv_sec) } -- cgit From 41d9243cc9d107d1980e18537090ed358dc7920a Mon Sep 17 00:00:00 2001 From: David Smith Date: Tue, 21 Apr 2009 10:49:15 -0500 Subject: Updated utrace tests. 2009-04-21 David Smith * testsuite/semok/utrace01.stp: New test. * testsuite/parseko/utrace01.stp: Updated test. * testsuite/semko/utrace03.stp: Ditto. * testsuite/semko/utrace04.stp: Ditto. * testsuite/semko/utrace01.stp: Deleted unneeded test. * testsuite/semko/utrace08.stp: Ditto. * testsuite/semko/utrace09.stp: Ditto. * testsuite/semko/utrace10.stp: Ditto. * testsuite/semko/utrace11.stp: Ditto. * testsuite/semko/utrace12.stp: Ditto. * testsuite/semko/utrace13.stp: Ditto. --- testsuite/semok/utrace01.stp | 4 ++++ 1 file changed, 4 insertions(+) create mode 100755 testsuite/semok/utrace01.stp (limited to 'testsuite/semok') diff --git a/testsuite/semok/utrace01.stp b/testsuite/semok/utrace01.stp new file mode 100755 index 00000000..864bdf15 --- /dev/null +++ b/testsuite/semok/utrace01.stp @@ -0,0 +1,4 @@ +#! stap -p2 + +# process path doesn't need to be absolute +probe process("cat").end { } -- cgit From d90053e72a515371936e10bf83ecb822aec91b17 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 21 Apr 2009 12:08:42 -0700 Subject: Refine the @cast-with-header syntax The special syntax to generate a module for type information is now: - "kernel" to use the kernel's build environment - "" to use no special build environment, and so use gcc's default parameters only (for user mode). --- testsuite/semok/cast.stp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'testsuite/semok') diff --git a/testsuite/semok/cast.stp b/testsuite/semok/cast.stp index d30823cd..769335f2 100755 --- a/testsuite/semok/cast.stp +++ b/testsuite/semok/cast.stp @@ -12,6 +12,6 @@ probe begin { // but who knows what debuginfo is installed... // check modules generated from headers - println(@cast(0, "task_struct", "kmod")->tgid) - println(@cast(0, "timeval", "umod")->tv_sec) + println(@cast(0, "task_struct", "kernel")->tgid) + println(@cast(0, "timeval", "")->tv_sec) } -- cgit From ea7d087ab3866eb99c19444b237c9586e8dc9b17 Mon Sep 17 00:00:00 2001 From: Ananth N Mavinakayanahalli Date: Thu, 30 Apr 2009 17:00:38 +0530 Subject: PR10007: Avoid probing syscall entry points in the testsuite. While there, fix minor issues with the s390x syscall tapset. --- testsuite/semok/thirtytwo.stp | 2 +- testsuite/semok/twentynine.stp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'testsuite/semok') diff --git a/testsuite/semok/thirtytwo.stp b/testsuite/semok/thirtytwo.stp index 2a69b8cd..0f0334a1 100755 --- a/testsuite/semok/thirtytwo.stp +++ b/testsuite/semok/thirtytwo.stp @@ -2,4 +2,4 @@ # PR 6836 -probe kernel.function("sys_open").return { log($$return . $$parms) } +probe kernel.function("do_sys_open").return { log($$return . $$parms) } diff --git a/testsuite/semok/twentynine.stp b/testsuite/semok/twentynine.stp index 05e591ce..4b2e5056 100755 --- a/testsuite/semok/twentynine.stp +++ b/testsuite/semok/twentynine.stp @@ -5,7 +5,7 @@ function dummy:long () {return p;} # alias with a condition probe alias0 = begin if (3) {p=1} # alias with a kernel-variable condition -- not valid -probe alias1 = kernel.function("sys_read").return if (0) { if ($return) {p=0} } +probe alias1 = kernel.function("vfs_read").return if (0) { if ($return) {p=0} } # alias with a function-call condition probe blias0 = timer.s(1) if (1 /* dummy() */) {p=10} -- cgit From 0730bfbd2665aef93d6fae287f3623a51f243540 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 8 May 2009 17:50:28 -0700 Subject: Refactor anonymous lookups in translate_components The previous code recursed the entirety of translate_components, and it seemed to be restarting the components list every time, so it would only work if the anonymous portion was the first component. Even then, examining the code output by semok/thirtythree revealed that it wasn't fully translating the locations when multiple anonymous pieces were involved. Instead, it now recurses in a separate function, find_struct_member, which does just enough to find the member die and return. It also builds a vector of the locations passed through, so translate_components can output code for the full chain of anonymity. The generated code for semok/thirtythree's $page->mapping now appears to match the offsets from my manual inspection of struct page. I also added a test for $page->first_page->mapping, which works now but would segfault the old code. --- testsuite/semok/thirtythree.stp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'testsuite/semok') diff --git a/testsuite/semok/thirtythree.stp b/testsuite/semok/thirtythree.stp index 90070370..0f0cacf6 100755 --- a/testsuite/semok/thirtythree.stp +++ b/testsuite/semok/thirtythree.stp @@ -1,5 +1,9 @@ #! stap -p2 # Per bz3016, this should get through the semantic pass without warnings. probe kernel.function("do_mpage_readpage") { - printf("\n page->mapping %p",$page->mapping) + printf("\n page->mapping %p",$page->mapping) + %( kernel_v >= "2.6.22" %? + printf("\n page->first_page->mapping %p",$page->first_page->mapping) + %) + } -- cgit From 946e1a48eb5b92dcf17a064b62157124da661869 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 8 May 2009 19:30:42 -0700 Subject: Allow @cast failures to get optimized away We have the saved_conversion_error field, but I wasn't using it. Now @cast errors are saved in that field, so they're only seen if the optimizer doesn't remove the @cast. --- testsuite/semok/cast.stp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'testsuite/semok') diff --git a/testsuite/semok/cast.stp b/testsuite/semok/cast.stp index 769335f2..14401886 100755 --- a/testsuite/semok/cast.stp +++ b/testsuite/semok/cast.stp @@ -14,4 +14,10 @@ probe begin { // check modules generated from headers println(@cast(0, "task_struct", "kernel")->tgid) println(@cast(0, "timeval", "")->tv_sec) + + // make sure that bogus @casts can get optimized away + @cast(0, "task_struct")->no_such_field + @cast(0, "task_struct")->parent->no_such_field + @cast(0, "no_such_type")->tgid + @cast(0, "task_struct", "no_such_module")->tgid } -- cgit