]> sourceware.org Git - systemtap.git/commit
stapbpf PR22330 WIP :: add interned strings section to the ELF file, invoke fprintf
authorSerhei Makarov <smakarov@redhat.com>
Fri, 8 Mar 2019 21:48:13 +0000 (16:48 -0500)
committerSerhei Makarov <smakarov@redhat.com>
Fri, 8 Mar 2019 22:37:44 +0000 (17:37 -0500)
commit94eadebb09e11b7b30a6527cccf2515199a72790
tree3343a30999ed33c424c378637418d1b67e5a662d
parent14845fc8226c13443aabc8af0e98fde39b8c5111
stapbpf PR22330 WIP :: add interned strings section to the ELF file, invoke fprintf

* bpf-internal.h (globals::intern_string): move from standalone intern_str() in bpf-translate.cxx.
(globals::interned_strings): rename from interned_str_map, change to vector.
(globals::interned_str_map): rename from interned_strings.
* bpf-translate.cxx (globals::intern_string): move from standalone intern_str() in bpf-translate.cxx,
adapt to changing fields in globals.
(bpf_unparser::emit_transport_msg): remove USE_INTERNED_STR define (we will always do this),
use BPF_TRANSPORT_ARG instead of magic number,
adapt to moved globals::intern_string.
(output_stapbpf_script_name): populate missing data->d_type.
(output_interned_strings): new function generating pseudo-STRTAB-ish section with format strings.
(bpf_unparser::add_prologue): call output_interned_strings() after codegen.

* stapbpf/stapbpf.cxx (interned_strings): new vector -- global table of interned strings.
(init_perf_transport): pass interned_strings at transport_context creation.
(load_bpf_file): locate and parse stapbpf_interned_strings pseudo-STRTAB-ish section,
populate global interned_strings.
(main): pass interned_strings at transport_context creation.
* stapbpf/bpfinterp.h (bpf_transport_context::interned_strings): new field referencing global strings table.
(bpf_transport_context::printf_format): delete unneeded field.
(bpf_transport_context::bpf_transport_context): adapt to changing fields.
* stapbpf/bpfinterp.cxx (bpf_handle_transport_msg): check for ctx->format_no out of bounds,
retrieve format_str from ctx->interned_strings,
generate an ugly hardcoded call to fprintf with 32 arguments.
bpf-internal.h
bpf-translate.cxx
stapbpf/bpfinterp.cxx
stapbpf/bpfinterp.h
stapbpf/stapbpf.cxx
This page took 0.024113 seconds and 5 git commands to generate.