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

btf: take first entry on multiple btf validation #2488

Merged

Conversation

tixxdz
Copy link
Member

@tixxdz tixxdz commented May 30, 2024

No description provided.

@tixxdz tixxdz requested a review from a team as a code owner May 30, 2024 18:38
@tixxdz tixxdz requested a review from olsajiri May 30, 2024 18:38
@tixxdz tixxdz marked this pull request as draft May 30, 2024 18:38
@tixxdz tixxdz added the release-note/minor This PR introduces a minor user-visible change label May 31, 2024
@tixxdz tixxdz force-pushed the pr/tixxdz/btf-validation-take-first-id-on-multiple-matches branch from 9d9d421 to 1324bbc Compare May 31, 2024 10:21
@tixxdz tixxdz marked this pull request as ready for review May 31, 2024 10:22
pkg/btf/validation.go Outdated Show resolved Hide resolved
@tixxdz tixxdz force-pushed the pr/tixxdz/btf-validation-take-first-id-on-multiple-matches branch from 1324bbc to de6b5b9 Compare May 31, 2024 15:19
@tixxdz tixxdz force-pushed the pr/tixxdz/btf-validation-take-first-id-on-multiple-matches branch from de6b5b9 to 3ae527f Compare June 3, 2024 12:41
Copy link

netlify bot commented Jun 3, 2024

Deploy Preview for tetragon ready!

Name Link
🔨 Latest commit 3ae527f
🔍 Latest deploy log https://app.netlify.com/sites/tetragon/deploys/665dba02fac32b0008406364
😎 Deploy Preview https://deploy-preview-2488--tetragon.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@tixxdz tixxdz force-pushed the pr/tixxdz/btf-validation-take-first-id-on-multiple-matches branch from 3ae527f to 712cafe Compare June 3, 2024 12:48
@tixxdz
Copy link
Member Author

tixxdz commented Jun 3, 2024

Thanks Jiri, I added an if guard in case and tried to silence some go lint warning maybe. If it is green I merge.

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" metadata=/home/tixxdz/btf

Signed-off-by: Djalal Harouni <[email protected]>
@tixxdz tixxdz force-pushed the pr/tixxdz/btf-validation-take-first-id-on-multiple-matches branch from 712cafe to 6fdddd3 Compare June 3, 2024 12:55
@tixxdz tixxdz merged commit 0636406 into main Jun 3, 2024
39 checks passed
@tixxdz tixxdz deleted the pr/tixxdz/btf-validation-take-first-id-on-multiple-matches branch June 3, 2024 15:22
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