public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "me at serhei dot io" <sourceware-bugzilla@sourceware.org>
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	[thread overview]
Message-ID: <bug-24528-6586-sWSP9jAIxP@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-24528-6586@http.sourceware.org/bugzilla/>

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

--- Comment #1 from Serhei Makarov <me at serhei dot io> ---
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 knows
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 getting
this type of cryptic madness anymore:

$ sudo ~/stap-install/bin/stap --bpf -e 'global g probe
kernel.function("vfs_read") { g["foo"] = "bar" foreach(k in g) { println(k) }
}'
Error loading /tmp/stapoSgfxZ/stap_25366.bo: bpf program load failed: Invalid
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 general,
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 when
that proves necessary down the line.

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

  parent reply	other threads:[~2019-06-20 17:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-06 16:25 [Bug bpf/24528] New: bpf-next " me at serhei dot io
2019-05-06 17:04 ` [Bug bpf/24528] " me at serhei dot io
2019-05-06 17:07 ` [Bug bpf/24528] stapbpf-next " me at serhei dot io
2019-06-20 17:30 ` me at serhei dot io [this message]
2019-06-21 15:12 ` me at serhei dot io
2019-06-26 20:29 ` me at serhei dot io

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-24528-6586-sWSP9jAIxP@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).