-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up unnecessary symbol existence checks #2370
Conversation
794b9af
to
a83b0d1
Compare
9a3de98
to
ad05431
Compare
5fc8cee
to
456d08e
Compare
Currently, the test runner can use variables in the `except` branch before they're initialized. Hoist all the local state variables to before the try: to fix that. Also, make BEFORE_PID logic run only if the test uses `{{BEFORE_PID}}`.
456d08e
to
eb5b7db
Compare
Alright, I think I found a fix for the flaky usdt test (or at least made it better?). For reasons I don't understand, I was only able to fix it by writing a new C binary that forks and execs the necessary two instances. Doing so from bash made the BEFORE phase time out (wtf GH Actions; I suspect some layer of security hooks or auditing slowing things down). Doing so from a bash script doesn't work because |
The way the test runner determines that the BEFORE clause has started is by splitting the string by whitespace and calling `pidof` with the last substring. In this test, we launch the same program twice, so there exists a time between the two invocations where `pidof` will return the pid for the first process but we wouldn't have launched the second one yet. bpftrace would then launch and only attach to the first process and the test will time out. The fix is somewhat hacky - we build a small C binary which runs one instance as a child and one instance as the parent process. (I tried bash-based fixes in previous iterations to no avail; there is something going on inside GH Actions but I can't figure out what.)
eb5b7db
to
5fe7b07
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one thing comes to mind: are we documenting the minimum required libbpf and bcc versions somewhere?
I'll document it in INSTALL.md and README.md and send a separate PR |
(This is based on top of #2369, look at the libbpf: and libbcc: commits only in this PR)
(Part of #2334 work)
Now that we have strict requirements for minimum library versions, this PR removes unnecessary libbpf and bcc symbol checks in the bpftrace codebase. Now that these are cleaned up, we may even be able to set up libbpf and bcc as ExternalProjects, if we so desired (though I'd personally prefer to keep them as git submodules).