From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 93032 invoked by alias); 11 Jul 2019 17:43:38 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 92344 invoked by uid 48); 11 Jul 2019 17:43:26 -0000 From: "wcohen at redhat dot com" To: systemtap@sourceware.org Subject: [Bug bpf/24804] New: bpf code generation unable to determine type of target variable used to index global variable Date: Thu, 11 Jul 2019 17:43:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: bpf X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: wcohen at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2019-q3/txt/msg00010.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D24804 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 o= ut 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")'=20 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 :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")'=20 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]=3D719 ids[72]=3D595 ids[0]=3D577 ids[5]=3D332 ids[3]=3D307 ids[257]=3D208 ids[228]=3D172 ids[7]=3D115 ids[213]=3D106 ... --=20 You are receiving this mail because: You are the assignee for the bug.