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

cb[] (array of values) is not printed correctly when dumping the full skb #295

Open
qmonnet opened this issue Dec 8, 2023 · 4 comments
Open
Labels
bug Something isn't working

Comments

@qmonnet
Copy link
Member

qmonnet commented Dec 8, 2023

When running pwru with --output-skb, we dump the full content of the socket buffer. However, the value for cb (char cb[48]) seems incorrect. I saw only the first value from the array (corresponding the first char), the following ones were not displayed.

I think cb is the only array in the skb, but this would probably related to the way we handle arrays in general.

context

@jschwinger233
Copy link
Member

Considering that Cilium heavily relies on skb->cb, I can't tolerate this issue any longer!

Do you think it's a good idea to fetch and output skb->cb when --output-meta is set? Or we add a new flag --output-skb-cb? Any suggestion?

The best solution looks like #11, but it requires huge engineering...

@qmonnet
Copy link
Member Author

qmonnet commented Jan 22, 2024

Not sure what #11 mean, do you mean finding a way to specify what fields from the skb we want to print? An alternative to that would be to output the SKB metadata (possibly the other info, too) in JSON and filter with jq?

Do you think it's a good idea to fetch and output `skb->cb` when --output-meta is set? Or we add a new flag `--output-skb-cb`? Any suggestion?

I personally wouldn't mind printing the skb->cb by default. We'd need to fix bpf_snprintf_btf() to retrieve the content correctly though, if I understand correctly?

@jschwinger233
Copy link
Member

We'd need to fix bpf_snprintf_btf() to retrieve the content correctly though, if I understand correctly?

True, although it would be long way to go.

@brb
Copy link
Member

brb commented Feb 14, 2024

Maybe as a temp solution we could add skb->cb[] to --output-meta's output if --filter-trace-tc is set? The latter is expected for tracing BPF progs.

@brb brb added the bug Something isn't working label Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants