diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2024-12-13 14:35:42 -0800 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2024-12-13 14:35:43 -0800 |
commit | 6a10d2d3613fed501ae9c164cb1c4335e11cb714 (patch) | |
tree | 1a2c31dab8f42af0f97dc5c392f3290c2de29093 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 5506b7d7bbdb7622959d80a4a2fc18985a01d512 (diff) | |
parent | 9d294f6986789e20696f44c2deb4c7f7b8ae4704 (diff) |
Merge branch 'bpftool-btf-support-dumping-a-single-type-from-file'
Daniel Xu says:
====================
bpftool: btf: Support dumping a single type from file
Some projects, for example xdp-tools [0], prefer to check in a minimized
vmlinux.h rather than the complete file which can get rather large.
However, when you try to add a minimized version of a complex struct (eg
struct xfrm_state), things can get quite complex if you're trying to
manually untangle and deduplicate the dependencies.
This commit teaches bpftool to do a minimized dump of a single type by
providing an optional root_id argument.
Example usage:
$ ./bpftool btf dump file ~/dev/linux/vmlinux | rg "STRUCT 'xfrm_state'"
[12643] STRUCT 'xfrm_state' size=912 vlen=58
$ ./bpftool btf dump file ~/dev/linux/vmlinux root_id 12643 format c
#ifndef __VMLINUX_H__
#define __VMLINUX_H__
[..]
struct xfrm_type_offload;
struct xfrm_sec_ctx;
struct xfrm_state {
possible_net_t xs_net;
union {
struct hlist_node gclist;
struct hlist_node bydst;
};
union {
struct hlist_node dev_gclist;
struct hlist_node bysrc;
};
struct hlist_node byspi;
[..]
[0]: https://github.com/xdp-project/xdp-tools/blob/master/headers/bpf/vmlinux.h
=== Changelog ===
Changes in v5:
* Update bash-completion to support repeating root_id
* Update man page to mention root_id NAND map key/value/kv/all
Changes in v4:
* Support multiple instances of root_id
Changes in v3:
* Make `root_id` a top level btf-dump argument rather than attached to `file`
* Update bash completion script
* Refactor root_type_ids checking to after btf handle creation
* Update help messages and fix existing man page inconsistency
Changes in v2:
* Add early error check for invalid BTF ID
====================
Link: https://patch.msgid.link/cover.1734119028.git.dxu@dxuuu.xyz
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions