diff options
author | Josh Stone <jistone@redhat.com> | 2009-05-08 17:50:28 -0700 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2009-05-08 18:11:34 -0700 |
commit | 0730bfbd2665aef93d6fae287f3623a51f243540 (patch) | |
tree | d3def4975bc8416109cfc9803b63188699091465 /testsuite/semok/thirtythree.stp | |
parent | 620c2105eb1d928b97769006eb6eed79d6998531 (diff) | |
download | systemtap-steved-0730bfbd2665aef93d6fae287f3623a51f243540.tar.gz systemtap-steved-0730bfbd2665aef93d6fae287f3623a51f243540.tar.xz systemtap-steved-0730bfbd2665aef93d6fae287f3623a51f243540.zip |
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.
Diffstat (limited to 'testsuite/semok/thirtythree.stp')
-rwxr-xr-x | testsuite/semok/thirtythree.stp | 6 |
1 files changed, 5 insertions, 1 deletions
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) + %) + } |