From: Yang Bo <bo@xxxxxxxx> We (the antgroup) has a requirement to manipulate global variables. The platform to manage bpf bytecode has no idea about varaibles' type/size/address. It only has some strings (like key = value) passed from admin. We find a way to parse BTF and then query/update the variables. There may be better ways to do it. This approach is what we can find for now. Yang Bo (2): Add api to manipulate global variable mini test case. tools/lib/bpf/bpf.c | 808 ++++++++++++++++++++++++++++++++++++ tools/lib/bpf/bpf.h | 9 + tools/lib/bpf/libbpf.map | 2 + tools/lib/bpf/mini/Makefile | 2 + tools/lib/bpf/mini/main.c | 130 ++++++ 5 files changed, 951 insertions(+) create mode 100644 tools/lib/bpf/mini/Makefile create mode 100644 tools/lib/bpf/mini/main.c -- 2.40.0