From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 39672 invoked by alias); 20 Jun 2019 17:30:27 -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 33266 invoked by uid 48); 20 Jun 2019 17:30:16 -0000 From: "me at serhei dot io" To: systemtap@sourceware.org Subject: [Bug bpf/24528] stapbpf-next housekeeping: bpf-translate.cxx should distinguish codegen for kernel/userspace targets Date: Thu, 20 Jun 2019 17:30:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: bpf X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: me at serhei dot io 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: Message-ID: In-Reply-To: References: 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-q2/txt/msg00101.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D24528 --- Comment #1 from Serhei Makarov --- Added a 'target' field to struct program. Next step is to go through bpf-translate.cxx and spot all the places where = we should be checking that 'target' field and signalling an error (or possibly generating different code) instead of crossing our fingers that the user kn= ows which stap language constructs are and aren't supported by kernel bpf. That way, if we use the wrong construct in the wrong code, we won't be gett= ing this type of cryptic madness anymore: $ sudo ~/stap-install/bin/stap --bpf -e 'global g probe kernel.function("vfs_read") { g["foo"] =3D "bar" foreach(k in g) { println(= k) } }' Error loading /tmp/stapoSgfxZ/stap_25366.bo: bpf program load failed: Inval= id argument back-edge from insn 1051 to 92 WARNING: /home/serhei/stap-install/bin/stapbpf exited with status: 1 Pass 5: run failed. [man error::pass5] Once the error messages work well (exist), I'll close this PR. But in gener= al, this work should also allow the userspace interpreter's constraints to be relaxed (e.g. stack size or hard-register file could be increased) if or wh= en that proves necessary down the line. --=20 You are receiving this mail because: You are the assignee for the bug.