This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug bpf/24804] bpf code generation unable to determine type of target variable used to index global variable
- From: "wcohen at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sourceware dot org
- Date: Thu, 11 Jul 2019 19:12:29 +0000
- Subject: [Bug bpf/24804] bpf code generation unable to determine type of target variable used to index global variable
- Auto-submitted: auto-generated
- References: <bug-24804-6586@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=24804
--- Comment #3 from William Cohen <wcohen at redhat dot com> ---
Took a look the verbose output of the following commands for the failing bpf
and working lkm versions:
$ stap -p4 -vvvvv --bpf -e 'global ids; probe
kernel.function("__do_sys_fcntl"){ids[$fd]++}' >& bpf_function_typing.log
$ stap -vvvvv -p4 -e 'global ids; probe
kernel.trace("sys_enter"){ids[$id]++}' >& lkm_typing.log
In the failing bpf version in the output see:
focused on module '/tmp/stapvvSB1G/tracequery_kmod_1/tracequery_kmod_1_116.o'
pattern 'stapprobe_sys_enter' matches function 'stapprobe_sys_enter'
replaced $id with __tracepoint_arg_id
Rerunning the code filters.
tracepoint-based probe_20795 tracepoint='sys_enter'
Later in the bpf output see:
symbol resolution for derived-probe kernel.trace("raw_syscalls:sys_enter") /*
<- kernel.trace("sys_enter") */
global ids is defined in chosen-tapset-file <input>
number of probes with global-variable conditions: 0
Eliding side-effect-free singleton block operator '{' at <input>:1:44
replaced {
(__global_ids[__tracepoint_arg_id])++;
} with (__global_ids[__tracepoint_arg_id])++
resolved type long to identifier 'ids' at <input>:1:45
resolved type long to operator '++' at <input>:1:53
resolved type long to identifier 'ids' at <input>:1:45
semantic error: unresolved type : identifier '$id' at <input>:1:49
thrown from: elaborate.cxx:7391
source: global ids; probe kernel.trace("sys_enter"){ids[$id]++}
It seems that bpf is losing typing information for __tracepoint_arg_id. For
the lkm version see:
found parameter for tracepoint 'sys_enter': type:'long int' name:'id'
decl:'long int __tracepoint_arg_id' ok
replaced $id with __tracepoint_arg_id
Rerunning the code filters.
Then later in the lkm output:
symbol resolution for derived-probe kernel.trace("raw_syscalls:sys_enter") /*
<- kernel.trace("sys_enter") */
local __tracepoint_arg_id is already defined
global ids is defined in chosen-tapset-file <input>
number of probes with global-variable conditions: 0
Eliding side-effect-free singleton block operator '{' at <input>:1:44
replaced {
(__global_ids[__tracepoint_arg_id])++;
} with (__global_ids[__tracepoint_arg_id])++
resolved type long to identifier 'ids' at <input>:1:45
resolved type long to identifier '$id' at <input>:1:49
resolved type long to identifier '$id' at <input>:1:49
resolved type long to operator '++' at <input>:1:53
resolved type long to identifier 'ids' at <input>:1:45
derive-probes (location #0): end of keyword at <input>:1:1
global ids is already defined
local __idx0 is already defined
local __val is already defined
resolved type long to identifier '__idx0' at <input>:2:19
resolved type long to identifier 'ids' at <input>:2:30
resolved type long to identifier '__val' at <input>:2:10
resolved type long to identifier '__idx0' at <input>:3:25
resolved type long to identifier '__val' at <input>:3:32
resolved type long to identifier 'printf' at <input>:3:1
resolved type long to identifier '__idx0' at <input>:2:19
resolved type long to identifier '__val' at <input>:2:10
deleting module_cache
--
You are receiving this mail because:
You are the assignee for the bug.