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

bpftool: introduce btf c dump sorting #6967

Closed

Conversation

kernel-patches-daemon-bpf[bot]
Copy link

Pull request for series with
subject: bpftool: introduce btf c dump sorting
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=850804

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: a9e7715
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=850804
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 8e6d9ae
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=850804
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: e549b39
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=850804
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 41b307a
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=850804
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 329a672
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=850804
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 75b0fbf
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=850804
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=850804 expired. Closing PR.

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 0093670
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=851926
version: 2

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: ba39486
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=852902
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: ba39486
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=853125
version: 4

Sort bpftool c dump output; aiming to simplify vmlinux.h diffing and
forcing more natural type definitions ordering.

Definitions are sorted first by their BTF kind ranks, then by their base
type name and by their own name.

Type ranks

Assign ranks to btf kinds (defined in function btf_type_rank) to set
next order:
1. Anonymous enums/enums64
2. Named enums/enums64
3. Trivial types typedefs (ints, then floats)
4. Structs/Unions
5. Function prototypes
6. Forward declarations

Type rank is set to maximum for unnamed reference types, structs and
unions to avoid emitting those types early. They will be emitted as
part of the type chain starting with named type.

Lexicographical ordering

Each type is assigned a sort_name and own_name.
sort_name is the resolved name of the final base type for reference
types (typedef, pointer, array etc). Sorting by sort_name allows to
group typedefs of the same base type. sort_name for non-reference type
is the same as own_name. own_name is a direct name of particular type,
is used as final sorting step.

Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Tested-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Quentin Monnet <qmo@kernel.org>
@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 5c16727
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=853125
version: 4

@kernel-patches-daemon-bpf
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=853125 irrelevant now. Closing PR.

@kernel-patches-daemon-bpf kernel-patches-daemon-bpf bot deleted the series/850804=>bpf-next branch May 17, 2024 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant