This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: stucture element variable access problem


bibo,mao åé:
Hi,
I encountered such problem when access structure element variable, if
the structure variable is pointer type, its element can be access, but
if the variable is structure type, there will be tapset translation
error when accessing its element. This is the test case:

It will be ok with this test case:
    probe kernel.function("__elv_add_request")
    {
       if ($q->queue_tags){
               tag_map = $q->queue_tags->tag_map
               printf(" %d \n", tag_map);
       }
    }
But this test case will fail:
     probe kernel.function("__elv_add_request")
    {
       elevator_name = $q->elevator.elevator_name
    }
And there will be such error information:

I checked into SystemTap CVS the tapsets used by LKET. Now you can use:
probe ioscheduler.elv_add_request
{
        printf("elv_name: %s\n", elevator_name)
}

I can't duplicate your errors on my box since my box used kernel 2.6.16.
For kernel >= 2.6.10, you should use: $q->elevator->elevator_type->elevator_name to get the name.


another comments is that you should use kernel_string to get the name.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]