Skip to content
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

Attach to duplicated USDT markers #1341

Merged
merged 7 commits into from
May 25, 2020
Merged

Attach to duplicated USDT markers #1341

merged 7 commits into from
May 25, 2020

Conversation

danobi
Copy link
Member

@danobi danobi commented May 20, 2020

This PR adds support for duplicated USDT markers. Duplication in
this context means identical provider and name. See the runtime
test for an example of how this can occur.

With this change, bpftrace will generate separate programs for each
duplicated marker. We need to generate separate programs because the
location of the usdt arguments may not be the same in each call site.
The later runtime test does not reproduce this behavior but I've
observed this happening in production before.

Note that a good portion of this PR is light refactoring work. Someone
(probably me) should really refactor the probe generation code. It's
excruciatingly difficult to reason about and extremely easy to make
mistakes. Maybe it could be made better by passing a metadata struct
around instead of trying to guess section names.

Checklist
  • Language changes are updated in docs/reference_guide.md
  • User-visible and non-trivial changes updated in CHANGELOG.md

danobi added 7 commits May 19, 2020 17:41
Non functional change.

Tuples become hard to read after you get enough entries.
We had two codepaths with almost duplicate code. This commit factors out
the common code.
Non functional change.

Just some small code cleanup.
This commit adds support for duplicated USDT markers. Duplication in
this context means identical provider and name. See the later runtime
test for an example of how this can occur.

With this commit, bpftrace will generate separate programs for each
duplicated marker. We need to generate separate programs because the
location of the usdt arguments may not be the same in each call site.
The later runtime test does not reproduce this behavior but I've
observed this happening in production before.
@fbs fbs merged commit 147a390 into bpftrace:master May 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants