-
Notifications
You must be signed in to change notification settings - Fork 5
bpftool: Formatting defined by user:fmt: decl tag #6007
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
bpftool: Formatting defined by user:fmt: decl tag #6007
Conversation
|
Upstream branch: 5a427fd |
da4ec66 to
a98c373
Compare
|
Upstream branch: 58a5820 |
56d15e0 to
638a3dd
Compare
a98c373 to
f2c71e8
Compare
|
Upstream branch: 348f611 |
638a3dd to
fb64336
Compare
f2c71e8 to
0af025f
Compare
|
Upstream branch: 2383e45 |
fb64336 to
0867f00
Compare
0af025f to
30b62c7
Compare
|
Upstream branch: f0b5c14 |
0867f00 to
5ac8999
Compare
30b62c7 to
41e1333
Compare
|
Upstream branch: 8b52d09 |
5ac8999 to
c97d8db
Compare
41e1333 to
34ccf81
Compare
|
Upstream branch: 34f033a |
c97d8db to
7e1bde6
Compare
34ccf81 to
aea6d55
Compare
|
Upstream branch: ceeaa71 |
7e1bde6 to
80967e7
Compare
aea6d55 to
2225dd1
Compare
Certain data types get exceptionally unwieldy when formatted by bpftool,
e.g. IP6 addresses.
Introduce custom formatting in bpftool driven by user:fmt: decl tag.
When a type is tagged user:fmt:ip, the value is formatted as IP4 or IP6
address depending on the value size.
When a type is tagged user:fmt:be, the value is interpreted as a
big-endian integer (2, 4 or 8 bytes).
Example:
typedef struct in6_addr bpf_in6_addr
__attribute__((__btf_decl_tag__("user:fmt:ip")));
bpf_in6_addr in6;
$ bpftool map dump name .data
[{
"value": {
".data": [{
"in6": "2001:db8:130f::9c0:876a:130b"
}
]
}
}
]
versus
$ bpftool map dump name .data
[{
"value": {
".data": [{
"in6": {
"in6_u": {
"u6_addr8": [32,1,13,184,19,15,0,0,0,0,9,192,135,106,19,11
],
"u6_addr16": [288,47117,3859,0,0,49161,27271,2835
],
"u6_addr32": [3087860000,3859,3221815296,185821831
]
}
}
}
]
}
}
]
Signed-off-by: Nick Zavaritsky <[email protected]>
|
Upstream branch: d4680a1 |
80967e7 to
d99eb98
Compare
|
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=1004635 expired. Closing PR. |
Pull request for series with
subject: bpftool: Formatting defined by user:fmt: decl tag
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1004635