my_res = bpf_map_lookup_elem(&res_map, &zero); if (!my_res) return 1;
if (*my_res == 0) /* use bpf_printk() in combination with BPF_NO_GLOBAL_DATA to * force .rodata.str1.1 section that previously caused * problems on old kernels due to libbpf always tried to * create a global data map for it
*/
bpf_printk("Legacy-case bpf_printk test, pid %d\n", cur_pid);
*my_res = 1;
return *my_res;
}
SEC("tp/raw_syscalls/sys_enter") int handle_modern(void *ctx)
{ int cur_pid;
if (res_var == 0) /* we need bpf_printk() to validate libbpf logic around unused * global maps and legacy kernels; see comment in handle_legacy()
*/
bpf_printk("Modern-case bpf_printk test, pid %d\n", cur_pid);
res_var = 1;
return res_var;
}
Messung V0.5
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.3Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.