staticvoid test_add(struct atomics_lskel *skel)
{ int err, prog_fd;
LIBBPF_OPTS(bpf_test_run_opts, topts);
/* No need to attach it, just run it directly */
prog_fd = skel->progs.add.prog_fd;
err = bpf_prog_test_run_opts(prog_fd, &topts); if (!ASSERT_OK(err, "test_run_opts err")) return; if (!ASSERT_OK(topts.retval, "test_run_opts retval")) return;
staticvoid test_sub(struct atomics_lskel *skel)
{ int err, prog_fd;
LIBBPF_OPTS(bpf_test_run_opts, topts);
/* No need to attach it, just run it directly */
prog_fd = skel->progs.sub.prog_fd;
err = bpf_prog_test_run_opts(prog_fd, &topts); if (!ASSERT_OK(err, "test_run_opts err")) return; if (!ASSERT_OK(topts.retval, "test_run_opts retval")) return;
staticvoid test_and(struct atomics_lskel *skel)
{ int err, prog_fd;
LIBBPF_OPTS(bpf_test_run_opts, topts);
/* No need to attach it, just run it directly */
prog_fd = skel->progs.and.prog_fd;
err = bpf_prog_test_run_opts(prog_fd, &topts); if (!ASSERT_OK(err, "test_run_opts err")) return; if (!ASSERT_OK(topts.retval, "test_run_opts retval")) return;
staticvoid test_or(struct atomics_lskel *skel)
{ int err, prog_fd;
LIBBPF_OPTS(bpf_test_run_opts, topts);
/* No need to attach it, just run it directly */
prog_fd = skel->progs.or.prog_fd;
err = bpf_prog_test_run_opts(prog_fd, &topts); if (!ASSERT_OK(err, "test_run_opts err")) return; if (!ASSERT_OK(topts.retval, "test_run_opts retval")) return;
staticvoid test_xor(struct atomics_lskel *skel)
{ int err, prog_fd;
LIBBPF_OPTS(bpf_test_run_opts, topts);
/* No need to attach it, just run it directly */
prog_fd = skel->progs.xor.prog_fd;
err = bpf_prog_test_run_opts(prog_fd, &topts); if (!ASSERT_OK(err, "test_run_opts err")) return; if (!ASSERT_OK(topts.retval, "test_run_opts retval")) return;
staticvoid test_cmpxchg(struct atomics_lskel *skel)
{ int err, prog_fd;
LIBBPF_OPTS(bpf_test_run_opts, topts);
/* No need to attach it, just run it directly */
prog_fd = skel->progs.cmpxchg.prog_fd;
err = bpf_prog_test_run_opts(prog_fd, &topts); if (!ASSERT_OK(err, "test_run_opts err")) return; if (!ASSERT_OK(topts.retval, "test_run_opts retval")) return;
staticvoid test_xchg(struct atomics_lskel *skel)
{ int err, prog_fd;
LIBBPF_OPTS(bpf_test_run_opts, topts);
/* No need to attach it, just run it directly */
prog_fd = skel->progs.xchg.prog_fd;
err = bpf_prog_test_run_opts(prog_fd, &topts); if (!ASSERT_OK(err, "test_run_opts err")) return; if (!ASSERT_OK(topts.retval, "test_run_opts retval")) return;
if (test__start_subtest("add"))
test_add(skel); if (test__start_subtest("sub"))
test_sub(skel); if (test__start_subtest("and"))
test_and(skel); if (test__start_subtest("or"))
test_or(skel); if (test__start_subtest("xor"))
test_xor(skel); if (test__start_subtest("cmpxchg"))
test_cmpxchg(skel); if (test__start_subtest("xchg"))
test_xchg(skel);
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.