On Thu, Sep 10, 2020 at 12:59 PM Andrii Nakryiko
[off-list ref] wrote:
On Wed, Sep 9, 2020 at 11:25 AM Stanislav Fomichev [off-list ref] wrote:
quoted
From: YiFei Zhu <redacted>
This is a simple test to check that loading and dumping metadata
in btftool works, whether or not metadata contents are used by the
program.
A C test is also added to make sure the skeleton code can read the
metadata values.
Cc: YiFei Zhu <redacted>
Signed-off-by: YiFei Zhu <redacted>
Signed-off-by: Stanislav Fomichev <redacted>
---
It would be good to test that libbpf does bind .rodata even if BPF
program doesn't use it. So for metadata_unused you can get
bpf_prog_info and check that it does contain the id of .rodata?
Good idea, will add that.
quoted
+const char bpf_metadata_a[] SEC(".rodata") = "foo";
+const int bpf_metadata_b SEC(".rodata") = 1;
please add volatile to ensure these are not optimized away
Ack, ty!