diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-10-11 10:25:12 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-10-11 12:42:26 -0700 |
| commit | 2e5d46264617f1214c075c81cbe6e2ebb3a08b5b (patch) | |
| tree | 7364393132381a4656b59b12fa499737233661a6 /tools/perf/scripts/python/stackcollapse.py | |
| parent | cfc1c672c56797a077aa9f713671162e2b858752 (diff) | |
| download | linux-next-2e5d46264617f1214c075c81cbe6e2ebb3a08b5b.tar.gz linux-next-2e5d46264617f1214c075c81cbe6e2ebb3a08b5b.zip | |
assoc_array: choose between splitting a node and a shortcut without gotos
With its jobs in functions, assoc_array_insert_into_terminal_node()
comes down to one decision: replace the node with a shortcut when every
leaf in it and the new key share one segment, or split it otherwise.
Write that as an if and an else, in place of the labels split_node,
do_split_node and all_leaves_cluster_together.
Each branch now works out where its replacement goes from that
replacement's own back pointer and parent slot, with
assoc_array_parent_link(), rather than both using the node's. The two
are the same today.
None of the new functions is recursive, and gcc inlines all of them into
assoc_array_insert(), whose stack frame is 240 bytes after this series
against 224 before it, on an x86-64 defconfig.
No functional change.
Assisted-by: LLM
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
