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

may uint128 to [16]byte #785

Closed
wants to merge 3 commits into from
Closed

may uint128 to [16]byte #785

wants to merge 3 commits into from

Conversation

Benjmmi
Copy link
Contributor

@Benjmmi Benjmmi commented Sep 4, 2022

When using uint128 in ebpf, it was escaping golang's uint128 which was obviously incorrect, so a temporary solution was added to convert it to [16]byte instead. I am also testing further ....

@ti-mo ti-mo marked this pull request as draft September 7, 2022 09:04
@lmb
Copy link
Collaborator

lmb commented Sep 11, 2022

I think it would be better to tackle this in GoFormatter, since the problem is that Go doesn't have a valid uint128 type. With your solution we lose the "real" type info completely.

@lmb
Copy link
Collaborator

lmb commented Sep 11, 2022

The code in question is here:

ebpf/btf/format.go

Lines 176 to 181 in c5668cf

bits := i.Size * 8
if i.Encoding.IsSigned() {
fmt.Fprintf(&gf.w, "int%d", bits)
} else {
fmt.Fprintf(&gf.w, "uint%d", bits)
}

@Benjmmi Benjmmi marked this pull request as ready for review September 19, 2022 02:56
Copy link
Collaborator

@lmb lmb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please remove the merge commit and rebase on top of master instead? Thanks!

btf/format.go Outdated Show resolved Hide resolved
@Benjmmi Benjmmi requested a review from lmb September 21, 2022 05:09
@Benjmmi Benjmmi closed this Sep 21, 2022
@Benjmmi Benjmmi reopened this Sep 21, 2022
@Benjmmi Benjmmi closed this Sep 21, 2022
@Benjmmi
Copy link
Contributor Author

Benjmmi commented Sep 21, 2022

redirect:#799

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.

None yet

2 participants