public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug bpf/24804] New: bpf code generation unable to determine type of target variable used to index global variable
@ 2019-07-11 17:43 wcohen at redhat dot com
  2019-07-11 17:56 ` [Bug bpf/24804] " wcohen at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: wcohen at redhat dot com @ 2019-07-11 17:43 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=24804

            Bug ID: 24804
           Summary: bpf code generation unable to determine type of target
                    variable used to index global variable
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: bpf
          Assignee: systemtap at sourceware dot org
          Reporter: wcohen at redhat dot com
  Target Milestone: ---

When experimenting with the bpf tracepoints on the most currently checked out
version of systemtap came across the following problem where the target
variable seems to be properly typed, but when used as an index for a global
array systemtap reports it can't determine the type:

[wcohen@localhost systemtap]$ rpm -q systemtap
systemtap-4.2-1.201907111323.fc31.x86_64
[wcohen@localhost systemtap]$ stap  --bpf -L 'kernel.trace("sys_enter")' 
kernel.trace("raw_syscalls:sys_enter") $id:long int $args:long unsigned int[]
[wcohen@localhost systemtap]$ stap --bpf -e 'global ids; probe
kernel.trace("sys_enter"){ids[$id]++}' -T 10
semantic error: unresolved type : identifier '$id' at <input>:1:49
        source: global ids; probe kernel.trace("sys_enter"){ids[$id]++}
                                                                ^

Pass 2: analysis failed.  [man error::pass2]
Number of similar error messages suppressed: 1.
Rerun with -v to see them.

However, it looks for some cases systemtap can determine the target variable
type as the following works:

[wcohen@localhost systemtap]$ stap  -m good -e 'probe
kernel.trace("sys_enter"){printf("syscall %d\n", $id); exit()}'
syscall 72


The traditional linux kernel module version works fine:

[wcohen@localhost systemtap]$ stap   -L 'kernel.trace("sys_enter")' 
kernel.trace("raw_syscalls:sys_enter") $regs:struct pt_regs* $id:long int
[wcohen@localhost systemtap]$ stap  -e 'global ids; probe
kernel.trace("sys_enter"){ids[$id]++}' -T 10
ids[39]=719
ids[72]=595
ids[0]=577
ids[5]=332
ids[3]=307
ids[257]=208
ids[228]=172
ids[7]=115
ids[213]=106
...

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-11 19:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-11 17:43 [Bug bpf/24804] New: bpf code generation unable to determine type of target variable used to index global variable wcohen at redhat dot com
2019-07-11 17:56 ` [Bug bpf/24804] " wcohen at redhat dot com
2019-07-11 18:10 ` wcohen at redhat dot com
2019-07-11 19:12 ` wcohen at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).