aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
diff options
context:
space:
mode:
authorLorenz Bauer <[email protected]>2021-04-29 14:46:54 +0100
committerAlexei Starovoitov <[email protected]>2021-05-10 16:13:01 -0700
commitc69431aab67a912836e5831f03d99a819c14c9c3 (patch)
treec7d1e311865974c2fe4555947ca51ca82ce7ebcc /tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
parentb741596468b010af2846b75f5e75a842ce344a6e (diff)
bpf: verifier: Improve function state reallocation
Resizing and copying stack and reference tracking state currently does a lot of kfree / kmalloc when the size of the tracked set changes. The logic in copy_*_state and realloc_*_state is also hard to follow. Refactor this into two core functions. copy_array copies from a source into a destination. It avoids reallocation by taking the allocated size of the destination into account via ksize(). The function is essentially krealloc_array, with the difference that the contents of dst are not preserved. realloc_array changes the size of an array and zeroes newly allocated items. Contrary to krealloc both functions don't free the destination if the size is zero. Instead we rely on free_func_state to clean up. realloc_stack_state is renamed to grow_stack_state to better convey that it never shrinks the stack state. Signed-off-by: Lorenz Bauer <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py')
0 files changed, 0 insertions, 0 deletions