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

backport:v1.1: btf: take first entry on multiple function matches #2504

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

tixxdz
Copy link
Member

@tixxdz tixxdz commented Jun 3, 2024

[ OSS upstream 0636406 ]

TypeByName() can fail with ErrMultipleMatches if we have multiple candidates. If so, let's try again and take first match as it is.

This can help solve our immediate issue of having multiple definitions per system calls, however the long-term fix would be to iterate over all candidate, match their proto and arguments definitions, then attach to the corresponding ones.

Example output:

time="2024-05-31T15:53:17+01:00" level=info msg="BTF includes '2' matched candidates on call "__x64_sys_init_module", using first one"

[ OSS upstream 0636406 ]

TypeByName() can fail with ErrMultipleMatches if we have multiple
candidates. If so, let's try again and take first match as it is.

This can help solve our immediate issue of having multiple definitions
per system calls, however the long-term fix would be to iterate over
all candidate, match their proto and arguments definitions, then attach
to the corresponding ones.

Example output:

time="2024-05-31T15:53:17+01:00" level=info msg="BTF includes '2' matched candidates on call \"__x64_sys_init_module\", using first one"

Signed-off-by: Djalal Harouni <tixxdz@gmail.com>
@tixxdz tixxdz requested a review from a team as a code owner June 3, 2024 15:25
@tixxdz tixxdz requested review from tpapagian and removed request for a team June 3, 2024 15:25
@tixxdz tixxdz changed the title btf: take first entry on multiple function matches backport:v1.1: btf: take first entry on multiple function matches Jun 3, 2024
@tixxdz tixxdz added the release-note/minor This PR introduces a minor user-visible change label Jun 3, 2024
@tixxdz tixxdz requested a review from olsajiri June 3, 2024 21:42
@tixxdz tixxdz merged commit 1ece66b into v1.1 Jun 4, 2024
36 of 38 checks passed
@tixxdz tixxdz deleted the pr/tixxdz/backports-1.1-btf-multiple-calls branch June 4, 2024 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/minor This PR introduces a minor user-visible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants