Summary: | error accessing anonymous struct/union memeber | ||
---|---|---|---|
Product: | systemtap | Reporter: | Li Guanglei <guanglei> |
Component: | translator | Assignee: | Unassigned <systemtap> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | mark, mhiramat, wcohen |
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: |
Description
Li Guanglei
2006-08-09 08:09:30 UTC
I've duplicated this problem, and it only occurs with the anonymous struct. Accessing other 'struct page' members works correctly, i.e.: probe kernel.function("do_mpage_readpage") { printf("%p", $page->flags) } Yes, looking for anonymous structs/unions is just not handled. I can whip up loc2c-test changes to support it, to give a model for what the translator needs to do. It's straightforward. *** Bug 4519 has been marked as a duplicate of this bug. *** Changed the translate_components() function of tapsets.cxx to call itself recursively for every instance of anonymous struct / union present as a member in a given struct/ union. I adjusted the test case a little so that it works on both older and newer kernels by using the mapping field as in the first comment. commit dd4918442a55569175bda0575f746e84c99cee58 Author: Mark Wielaard <mjw@redhat.com> Date: Wed Oct 1 13:38:16 2008 +0200 Adjust semok/thirtythree.stp test to pass on older kernels. diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index f3fad07..4825cd2 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-10-01 Mark Wielaard <mjw@redhat.com> + + * semok/thirtythree.stp: Use page->mapping instead of page->inuse + as annonymous struct value (also available in older kernels). + 2008-09-26 Frank Ch. Eigler <fche@elastic.org> PR 6916. diff --git a/testsuite/semok/thirtythree.stp b/testsuite/semok/thirtythree.stp index d5171f6..9007037 100755 --- a/testsuite/semok/thirtythree.stp +++ b/testsuite/semok/thirtythree.stp @@ -1,5 +1,5 @@ #! stap -p2 # Per bz3016, this should get through the semantic pass without warnings. probe kernel.function("do_mpage_readpage") { - printf("\n page ->inuse %u",$page->inuse) + printf("\n page->mapping %p",$page->mapping) } |