systemtap:serhei/pr23478

Last commit made on 2021-08-24
Get this branch:
git clone -b serhei/pr23478 https://git.launchpad.net/systemtap

Branch merges

Branch information

Name:
serhei/pr23478
Repository:
lp:systemtap

Recent commits

b6ec889... by Serguei Makarov <email address hidden>

bpf pr23478 :: test non-unique key/val iteration

2e16a06... by Serguei Makarov <email address hidden>

bpf pr23478 :: test multi-key associative array iteration

40bfafe... by Serguei Makarov <email address hidden>

rhbz1938312: un-disable bpf.exp after kernel bugfix

Some overzealous audit checking caused kernel deadlock when probing
sensitive tracepoints. The rhbz lists the problem as fixed in 5.12.10.

21b70b6... by Serguei Makarov <email address hidden>

pr23478 WIP: fixes for existing foreach testcases

fbea5e3... by Serhei Makarov <email address hidden>

pr23478 WIP: rework bpf foreach to handle multi-key array

The major addition is a new ELF section giving details on each
foreach loop in the program, including where the sort column
is located within a composite key.

Previously all the foreach info was packed into a uint64_t
flags parameter to stapbpf's map_get_next_key userspace-only
helper function, which would not work for this nor for future
foreach work (sort_aggr, array slicing).

* bpf-internal.h (BPF_MAXKEYLEN,BPF_MAXKEYLEN_PLUS): new const.
(SORT_FLAGS etc): deprecate, but still read from old .bo files.
(globals::foreach_info): new struct with info for bpfinterp.cxx.
(globals::foreach_loop_info): vector of foreach_info structs.
(typedef interned_foreach_info): serialized foreach_info.
({intern,deintern}_loop_info): [de]serialize foreach_info.
(loop_idx): alias for index into foreach_loop_info vector.
* bpf-shared-globals.h ({intern,deintern}_loop_info): crudely
[de]serialize foreach_info by putting the fields in a vector.

* bpf-translate.cxx (bpf_unparser::visit_foreach_loop): change
to generate foreach_info, handle multi-key array iteration.
(output_foreach_info): serialize foreach_loop_info into a
new 'stapbpf_foreach_loop_info' ELF section.
(translate_bpf_pass): add 'stapbpf_foreach_loop_info' ELF section.

* stapbpf/stapbpf.cxx (foreach_loop_info): global table
of foreach loop information.
(load_bpf_file): load 'stapbpf_foreach_loop_info' ELF section.
(init_perf_transport): add foreach_loop_info to bpf_transport_context.
(main): add foreach_loop_info to bpf_transport_context.
* stapbpf/bpfinterp.h (struct bpf_transport_context): add
field for storing foreach_loop_info data.
(bpf_transport_context::bpf_transport_context): add
field for storing foreach_loop_info data.

* stapbpf/bpfinterp.cxx (struct foreach_state): represent an
in-progress foreach loop iteration including sorted values.
(foreach_info): alias for bpf::globals::foreach_info.
(foreach_state_add): new function.
(foreach_cmp_{str,int}): new functions.
(foreach_state_sort): new function.
(foreach_state_empty): new function.
(convert_key): new function.
(_foreach_state_next,foreach_state_next): new functions.
(foreach_state_cleanup): new function. Avoid C++ destructor.
(typedef foreach_stack): stack of foreach_state, used for
handling nested foreach loop iteration.
(map_get_next_key): rewrite to use foreach_info,foreach_state
and handle multi-key arrays (storing large keys in map_values).
(bpf_interpret): pass map_values to map_get_next_key, to be
used for storing composite keys in addition to values.
(struct map_keys): replaced by struct foreach_state.
(convert_{int,str}_{key,kp}): deleted functions.
(convert_{key,kp}): deleted functions.
(computed_key_size): deleted function.
(map_sort,map_next): deleted functions.

5d89bb0... by Serguei Makarov <email address hidden>

stapbpf bugfix: missing in_block() in try-catch code

After emit_stmt(), we may not be in a block, e.g. if we do

try { return 0 } catch { return 1 }

Also added an assert to make the error more obvious
if it's missed anywhere else. Was a non obvious segfault.

04b43f4... by Frank Ch. Eigler

releng: ditch custom pie/ssp CFLAGS engine in configure.ac

Just inherit the desired c*flags from autoconf via environment
variables from the distro spec files. This lets us automatically
benefit from centralized hardening flags on some distros. OTOH
distros without that now will need to add such settings to the build
scripts that invoke this configure script.

b47d03c... by Frank Ch. Eigler

PR28079: Adapt to kernel 5.14 task_struct.__state change

In tapset, use @choose_defined() for old & new field names.

e66f3a8... by Frank Ch. Eigler

runtime: adapt to -Werror=implicit-fallthrough=5, dyninst runtime

The runtime/dyninst/runtime.h also needs a fallthrough macro def'n.

ea00c10... by Frank Ch. Eigler

PR28140: kernel 5.14-rc adaptation, jump_label_patch

Linux commit ab3257042c2 makes it necessary for us to stop overriding
CONFIG_STACK_VALIDATION= (originally a workaround for a 2016 rawhide
bug). This fixes the tracepoints.stp test case.