From c2b89290dc293a0c858f651f56cc0ccc38e621e2 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Thu, 7 May 2009 11:24:04 -0400 Subject: fix permissions of some testsuite files Reported-By: Petr Muller --- testsuite/buildko/two.stp | 0 testsuite/buildok/thirty.stp | 0 testsuite/systemtap.base/bz10078.stp | 0 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 testsuite/buildko/two.stp mode change 100644 => 100755 testsuite/buildok/thirty.stp mode change 100644 => 100755 testsuite/systemtap.base/bz10078.stp (limited to 'testsuite') diff --git a/testsuite/buildko/two.stp b/testsuite/buildko/two.stp old mode 100644 new mode 100755 diff --git a/testsuite/buildok/thirty.stp b/testsuite/buildok/thirty.stp old mode 100644 new mode 100755 diff --git a/testsuite/systemtap.base/bz10078.stp b/testsuite/systemtap.base/bz10078.stp old mode 100644 new mode 100755 -- cgit From e361ac2bdb6f1996e020a5612cec71762b556e25 Mon Sep 17 00:00:00 2001 From: Malte Nuhn Date: Fri, 8 May 2009 12:20:33 -0400 Subject: context tapset: sid() function to return task session leader pid --- testsuite/buildok/context_test.stp | 1 + 1 file changed, 1 insertion(+) (limited to 'testsuite') diff --git a/testsuite/buildok/context_test.stp b/testsuite/buildok/context_test.stp index 84f1cbf1..d0b42890 100755 --- a/testsuite/buildok/context_test.stp +++ b/testsuite/buildok/context_test.stp @@ -18,6 +18,7 @@ function print_stuff () { printf("gid is %d\n", gid()) printf("egid is %d\n", egid()) printf("pp is %s\n", pp()) + printf("sid is %d\n", sid()) } probe kernel.function("uptime_read_proc") ? { -- cgit From 7da77276c8a703a4dab1ed242801f3afd38864ea Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 8 May 2009 12:40:43 -0700 Subject: Simplify buildok/context_test.stp The test was using optional probes on uptime_read_proc, which doesn't exist anymore on 2.6.30. The problem is that when those optional probes are skipped, the test doesn't really do anything. For a buildok test of the context functions, the actual probe point doesn't matter, so I've changed it to just a begin probe that calls all of the functions. --- testsuite/buildok/context_test.stp | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'testsuite') diff --git a/testsuite/buildok/context_test.stp b/testsuite/buildok/context_test.stp index d0b42890..acc4ea07 100755 --- a/testsuite/buildok/context_test.stp +++ b/testsuite/buildok/context_test.stp @@ -1,6 +1,6 @@ #! stap -p4 -function print_stuff () { +probe begin { print_regs() print_backtrace() bt = backtrace() @@ -20,22 +20,3 @@ function print_stuff () { printf("pp is %s\n", pp()) printf("sid is %d\n", sid()) } - -probe kernel.function("uptime_read_proc") ? { - print("NOW IN UPTIME\n") - print_stuff () -} - -probe kernel.function("uptime_read_proc").return ? { - print("DONE WITH UPTIME\n") - print_stuff () - exit () -} - -probe begin { - print ("BEGIN\n") -} - -probe end { - print ("END\n") -} -- 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') 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') 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