/* We need to cast access to traced function argument values with * proper type cast, because trampoline uses type specific instruction * to save it, like for 'int a' with 32-bit mov like: * * mov %edi,-0x8(%rbp) * * so the upper 4 bytes are not zeroed.
*/
test1_result &= err == 0 && ((int) a == 1);
/* return value */
err = bpf_get_func_ret(ctx, &ret);
test2_result &= err == 0 && ret == 5; return 0;
}
__u64 test3_result = 0;
SEC("fmod_ret/bpf_modify_return_test") int BPF_PROG(fmod_ret_test, int _a, int *_b, int _ret)
{
__u64 cnt = bpf_get_func_arg_cnt(ctx);
__u64 a = 0, b = 0, z = 0, ret = 0;
__s64 err;
/* return value */
err = bpf_get_func_ret(ctx, &ret);
test3_result &= err == 0 && ret == 0;
/* change return value, it's checked in fexit_test program */ return 1234;
}
__u64 test4_result = 0;
SEC("fexit/bpf_modify_return_test") int BPF_PROG(fexit_test, int _a, int *_b, int _ret)
{
__u64 cnt = bpf_get_func_arg_cnt(ctx);
__u64 a = 0, b = 0, z = 0, ret = 0;
__s64 err;
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.