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: How does stap execute probe aliases?


Hi Frank,

I instantiate the probe like this:

# cat page_fault.stp
#!/usr/bin/stap -v
probe vm.pagefault = kernel.function("__handle_mm_fault@mm/memory.c") ?,
                     kernel.function("handle_mm_fault@mm/memory.c") ?
{
        name = "pagefault"
        write_access = (@defined($flags)
                        ? $flags & FAULT_FLAG_WRITE : $write_access)
        address =  $address
}

probe vm.pagefault
{
        printf("%s:%d 0x%x\n", name, write_access, address);
}

But executing it outputs the following error:

# ./page_fault.stp
Pass 1: parsed user script and 102 library script(s) using
78244virt/28420res/2684shr/26440data kb, in 110usr/20sys/128real ms.
semantic error: unable to find local 'write_access', [man
error::dwarf] dieoffset 0xe3b727 in kernel, near pc 0xffffffff8012a5dc
in __handle_mm_fault ../mm/memory.c (alternatives: $address, $mm,
$flags, $vma)): identifier '$write_access' at ./page_fault.stp:7:34
        source:                         ? $flags & FAULT_FLAG_WRITE :
$write_access)
                                                                      ^

semantic error: failed to retrieve location attribute for 'address'
[man error::dwarf] (dieoffset: 0xe3b744): identifier '$address' at
:8:13
        source:         address =  $address
                                   ^

semantic error: unable to find local 'write_access', [man
error::dwarf] dieoffset 0xe3b727 in kernel, near pc 0xffffffff8012a5dc
in __handle_mm_fault ../mm/memory.c (alternatives: $address, $mm,
$flags, $vma)): identifier '$write_access' at :7:34
        source:                         ? $flags & FAULT_FLAG_WRITE :
$write_access)
                                                                      ^

semantic error: failed to retrieve location attribute for 'address'
[man error::dwarf] (dieoffset: 0xe3b744): identifier '$address' at
:8:13
        source:         address =  $address
                                   ^

semantic error: unable to find local 'write_access', [man
error::dwarf] dieoffset 0xe3b727 in kernel, near pc 0xffffffff8012a5dc
in __handle_mm_fault ../mm/memory.c (alternatives: $address, $mm,
$flags, $vma)): identifier '$write_access' at :7:34
        source:                         ? $flags & FAULT_FLAG_WRITE :
$write_access)
                                                                      ^

semantic error: failed to retrieve location attribute for 'address'
[man error::dwarf] (dieoffset: 0xe3b744): identifier '$address' at
:8:13
        source:         address =  $address
                                   ^

semantic error: unable to find local 'write_access', [man
error::dwarf] dieoffset 0xe3b727 in kernel, near pc 0xffffffff8012a5dc
in __handle_mm_fault ../mm/memory.c (alternatives: $address, $mm,
$flags, $vma)): identifier '$write_access' at :7:34
        source:                         ? $flags & FAULT_FLAG_WRITE :
$write_access)
                                                                      ^

semantic error: failed to retrieve location attribute for 'address'
[man error::dwarf] (dieoffset: 0xe3b744): identifier '$address' at
:8:13
        source:         address =  $address
                                   ^

Pass 2: analyzed script: 3 probe(s), 4 function(s), 1 embed(s), 1
global(s) using 113032virt/63380res/3620shr/61228data kb, in
360usr/80sys/533real ms.
Pass 2: analysis failed.  [man error::pass2]

Checking the probes:
# stap -L 'kernel.function("__handle_mm_fault@mm/memory.c")'
kernel.function("__handle_mm_fault@../mm/memory.c:3752")
# stap -L 'kernel.function("handle_mm_fault@mm/memory.c")'
kernel.function("handle_mm_fault@../mm/memory.c:3832") $mm:struct
mm_struct* $vma:struct vm_area_struct* $address:long unsigned int
$flags:unsigned int

It seems the probes all exist and OK.

Could you give some clues about this error? Thanks in advance!
Best Regards
Nan Xiao


On Sat, Nov 21, 2015 at 12:12 AM, Frank Ch. Eigler <fche@redhat.com> wrote:
>
> xiaonan830818 wrote:
>
>> I try to execute the following script from this page
>> (https://sourceware.org/systemtap/SystemTap_Beginners_Guide/targetavailable.html#available):
>> [...]
>> Why can't the stap find the probes? Thanks in advance!
>
> Because that script defines aliases only (kind of like a #define FOO BAR
> in a C program), and doesn't instantiate them (FOO in a C program).
> So add
>
>    probe vm.pagefault { /* ... */ }
>
> to your script.
>
> - FChE


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