| /tools/testing/selftests/ftrace/ |
| A D | poll.c | 24 struct pollfd pfd = {.events = POLLIN}; in main() local 32 pfd.events = POLLIN; in main() 35 pfd.events = POLLPRI; in main() 51 pfd.fd = open(argv[optind], O_RDONLY); in main() 52 if (pfd.fd < 0) { in main() 59 if (pfd.events & POLLIN) in main() 60 do {} while (read(pfd.fd, buf, BUFSIZE) == BUFSIZE); in main() 62 ret = poll(&pfd, 1, timeout); in main() 67 close(pfd.fd); in main()
|
| /tools/testing/selftests/bpf/prog_tests/ |
| A D | find_vma.c | 28 int pfd; in open_pe() local 36 pfd = syscall(__NR_perf_event_open, &attr, 0, -1, -1, PERF_FLAG_FD_CLOEXEC); in open_pe() 38 return pfd >= 0 ? pfd : -errno; in open_pe() 53 int pfd, i; in test_find_vma_pe() local 56 pfd = open_pe(); in test_find_vma_pe() 57 if (pfd < 0) { in test_find_vma_pe() 58 if (pfd == -ENOENT || pfd == -EOPNOTSUPP) { in test_find_vma_pe() 63 if (!ASSERT_GE(pfd, 0, "perf_event_open")) in test_find_vma_pe() 67 link = bpf_program__attach_perf_event(skel->progs.handle_pe, pfd); in test_find_vma_pe() 77 close(pfd); in test_find_vma_pe()
|
| A D | perf_branches.c | 106 int pfd; in test_perf_branches_hw() local 116 pfd = syscall(__NR_perf_event_open, &attr, -1, 0, -1, PERF_FLAG_FD_CLOEXEC); in test_perf_branches_hw() 122 if (pfd < 0) { in test_perf_branches_hw() 129 if (CHECK(pfd < 0, "perf_event_open", "err %d errno %d\n", in test_perf_branches_hw() 130 pfd, errno)) in test_perf_branches_hw() 134 test_perf_branches_common(pfd, check_good_sample); in test_perf_branches_hw() 136 close(pfd); in test_perf_branches_hw() 147 int pfd; in test_perf_branches_no_hw() local 156 if (CHECK(pfd < 0, "perf_event_open", "err %d\n", pfd)) in test_perf_branches_no_hw() 159 test_perf_branches_common(pfd, check_bad_sample); in test_perf_branches_no_hw() [all …]
|
| A D | perf_link.c | 35 int pfd = -1, link_fd = -1, err; in serial_test_perf_link() local 48 pfd = syscall(__NR_perf_event_open, &attr, -1, 0, -1, PERF_FLAG_FD_CLOEXEC); in serial_test_perf_link() 49 if (!ASSERT_GE(pfd, 0, "perf_fd")) in serial_test_perf_link() 56 link_fd = bpf_link_create(bpf_program__fd(skel->progs.handler), pfd, in serial_test_perf_link() 98 if (pfd >= 0) in serial_test_perf_link() 99 close(pfd); in serial_test_perf_link()
|
| A D | pe_preserve_elems.c | 12 int err, key = 0, pfd = -1, mfd = bpf_map__fd(map); in test_one_map() local 20 pfd = syscall(__NR_perf_event_open, &attr, 0 /* pid */, in test_one_map() 22 if (CHECK(pfd < 0, "perf_event_open", "failed\n")) in test_one_map() 25 err = bpf_map_update_elem(mfd, &key, &pfd, BPF_ANY); in test_one_map() 26 close(pfd); in test_one_map()
|
| A D | crypto_sanity.c | 91 int sockfd, err, pfd; in test_crypto_sanity() local 120 pfd = bpf_program__fd(skel->progs.skb_crypto_setup); in test_crypto_sanity() 121 if (!ASSERT_GT(pfd, 0, "skb_crypto_setup fd")) in test_crypto_sanity() 124 err = bpf_prog_test_run_opts(pfd, &opts); in test_crypto_sanity()
|
| A D | test_csum_diff.c | 348 int pfd; in trigger_csum_diff() local 357 pfd = bpf_program__fd(skel->progs.compute_checksum); in trigger_csum_diff() 358 err = bpf_prog_test_run_opts(pfd, &topts); in trigger_csum_diff()
|
| A D | bpf_cookie.c | 446 int pfd = -1; in pe_subtest() local 455 pfd = syscall(__NR_perf_event_open, &attr, -1, 0, -1, PERF_FLAG_FD_CLOEXEC); in pe_subtest() 456 if (!ASSERT_GE(pfd, 0, "perf_fd")) in pe_subtest() 460 link = bpf_program__attach_perf_event_opts(skel->progs.handle_pe, pfd, &opts); in pe_subtest() 479 link = bpf_program__attach_perf_event_opts(skel->progs.handle_pe, pfd, &opts); in pe_subtest() 488 close(pfd); in pe_subtest()
|
| A D | fill_link_info.c | 212 int link_fd, err, pfd; in test_event_fill_link_info() local 221 pfd = syscall(__NR_perf_event_open, &attr, -1 /* pid */, 0 /* cpu 0 */, in test_event_fill_link_info() 223 if (!ASSERT_GE(pfd, 0, "perf_event_open")) in test_event_fill_link_info() 226 link = bpf_program__attach_perf_event_opts(skel->progs.event_run, pfd, &opts); in test_event_fill_link_info() 236 close(pfd); in test_event_fill_link_info()
|
| /tools/testing/selftests/filesystems/nsfs/ |
| A D | owner.c | 28 int pfd[2], ns, uns, init_uns; in main() local 34 if (pipe(pfd)) in main() 44 close(pfd[0]); in main() 45 close(pfd[1]); in main() 50 close(pfd[1]); in main() 51 if (read(pfd[0], &c, 1) != 0) in main() 53 close(pfd[0]); in main()
|
| /tools/gpio/ |
| A D | gpio-watch.c | 27 struct pollfd pfd; in main() local 55 pfd.fd = fd; in main() 56 pfd.events = POLLIN | POLLPRI; in main() 59 ret = poll(&pfd, 1, 5000); in main() 65 rd = read(pfd.fd, &chg, sizeof(chg)); in main()
|
| /tools/testing/selftests/bpf/benchs/ |
| A D | bench_bpf_crypto.c | 12 int pfd; member 81 int err, pfd; in crypto_setup() local 119 pfd = bpf_program__fd(ctx.skel->progs.crypto_setup); in crypto_setup() 120 if (pfd < 0) { in crypto_setup() 126 err = bpf_prog_test_run_opts(pfd, &opts); in crypto_setup() 138 ctx.pfd = bpf_program__fd(ctx.skel->progs.crypto_encrypt); in crypto_encrypt_setup() 144 ctx.pfd = bpf_program__fd(ctx.skel->progs.crypto_decrypt); in crypto_decrypt_setup() 161 (void)bpf_prog_test_run_opts(ctx.pfd, &opts); in crypto_producer()
|
| A D | bench_sockmap.c | 159 int err, cfd, pfd; in create_pair() local 179 pfd = accept(ctx.sfd, NULL, NULL); in create_pair() 180 if (pfd < 0) { in create_pair() 185 *p = pfd; in create_pair()
|
| /tools/testing/selftests/filesystems/epoll/ |
| A D | epoll_wakeup_test.c | 63 struct pollfd pfd; in waiter_entry1ap() local 90 struct pollfd pfd; in waiter_entry1op() local 117 struct pollfd pfd; in waiter_entry2ap() local 318 pfd.fd = efd; in TEST() 323 pfd.fd = efd; in TEST() 357 pfd.fd = efd; in TEST() 362 pfd.fd = efd; in TEST() 402 pfd.fd = efd; in TEST() 407 pfd.fd = efd; in TEST() 448 pfd.fd = efd; in TEST() [all …]
|
| /tools/testing/selftests/pidfd/ |
| A D | pidfd_wait.c | 87 int pfd[2]; in TEST() local 93 ASSERT_EQ(pipe(pfd), 0); in TEST() 100 close(pfd[1]); in TEST() 102 ASSERT_EQ(read(pfd[0], buf, 1), 1); in TEST() 103 close(pfd[0]); in TEST() 108 close(pfd[0]); in TEST() 117 ASSERT_EQ(write(pfd[1], "C", 1), 1); in TEST() 118 close(pfd[1]); in TEST()
|
| /tools/testing/selftests/net/ |
| A D | psock_tpacket.c | 222 struct pollfd pfd; in walk_v1_v2_rx() local 231 memset(&pfd, 0, sizeof(pfd)); in walk_v1_v2_rx() 232 pfd.fd = sock; in walk_v1_v2_rx() 234 pfd.revents = 0; in walk_v1_v2_rx() 265 poll(&pfd, 1, 1); in walk_v1_v2_rx() 410 memset(&pfd, 0, sizeof(pfd)); in walk_tx() 411 pfd.fd = sock; in walk_tx() 413 pfd.revents = 0; in walk_tx() 592 memset(&pfd, 0, sizeof(pfd)); in walk_v3_rx() 593 pfd.fd = sock; in walk_v3_rx() [all …]
|
| A D | udpgso_bench_rx.c | 94 struct pollfd pfd; in do_poll() local 97 pfd.events = POLLIN; in do_poll() 98 pfd.revents = 0; in do_poll() 99 pfd.fd = fd; in do_poll() 102 ret = poll(&pfd, 1, 10); in do_poll() 120 if (pfd.revents != POLLIN) in do_poll() 122 pfd.revents, POLLIN); in do_poll()
|
| A D | psock_fanout.c | 189 int pfd; in sock_fanout_set_ebpf() local 200 pfd = syscall(__NR_bpf, BPF_PROG_LOAD, &attr, sizeof(attr)); in sock_fanout_set_ebpf() 201 if (pfd < 0) { in sock_fanout_set_ebpf() 207 if (setsockopt(fd, SOL_PACKET, PACKET_FANOUT_DATA, &pfd, sizeof(pfd))) { in sock_fanout_set_ebpf() 212 if (close(pfd)) { in sock_fanout_set_ebpf()
|
| A D | tls.c | 2093 pfd.fd = self->cfd; in TEST_F() 2094 pfd.events = POLLIN; in TEST_F() 2113 pfd.fd = self->cfd; in TEST_F() 2114 pfd.events = POLLIN; in TEST_F() 2160 pfd.fd = self->cfd; in TEST_F() 2363 pfd.fd = self->cfd2; in TEST_F() 2364 pfd.events = POLLIN; in TEST_F() 2375 pfd.fd = self->cfd2; in TEST_F() 2376 pfd.events = POLLIN; in TEST_F() 2380 pfd.fd = self->cfd2; in TEST_F() [all …]
|
| A D | msg_zerocopy.c | 146 struct pollfd pfd; in do_poll() local 149 pfd.events = events; in do_poll() 150 pfd.revents = 0; in do_poll() 151 pfd.fd = fd; in do_poll() 153 ret = poll(&pfd, 1, cfg_waittime_ms); in do_poll() 157 return ret && (pfd.revents & events); in do_poll()
|
| /tools/testing/selftests/sched/ |
| A D | cs_prctl_test.c | 68 int pfd[2]; member 157 close(ca->pfd[0]); in child_func_process() 161 ret = write(ca->pfd[1], &ca->thr_tids, sizeof(int) * ca->num_threads); in child_func_process() 164 ca->pfd[1], strerror(errno)); in child_func_process() 166 close(ca->pfd[1]); in child_func_process() 183 if (pipe(proc[i].pfd) == -1) in create_processes() 189 close(proc[i].pfd[1]); in create_processes() 193 ret = read(proc[i].pfd[0], &proc[i].thr_tids, sizeof(int) * proc[i].num_threads); in create_processes() 197 close(proc[i].pfd[0]); in create_processes()
|
| /tools/testing/selftests/bpf/ |
| A D | test_lirc_mode2_user.c | 114 struct pollfd pfd = { .fd = inputfd, .events = POLLIN }; in main() local 118 poll(&pfd, 1, 100); in main() 141 poll(&pfd, 1, 100); in main()
|
| /tools/testing/selftests/net/af_unix/ |
| A D | scm_pidfd.c | 491 int pfd; in TEST_F() local 527 pfd = accept(self->server, NULL, NULL); in TEST_F() 528 ASSERT_NE(-1, pfd); in TEST_F() 530 pfd = self->server; in TEST_F() 538 …err = sendto(pfd, "x", sizeof(char), 0, (struct sockaddr *)&self->client_addr->listen_addr, self->… in TEST_F() 541 err = send(pfd, "x", sizeof(char), 0); in TEST_F() 549 err = sk_enable_cred_pass(pfd); in TEST_F() 552 err = cmsg_check_dead(pfd, self->client_pid); in TEST_F() 555 close(pfd); in TEST_F()
|
| /tools/hv/ |
| A D | hv_vss_daemon.c | 213 struct pollfd pfd; in main() local 278 pfd.fd = vss_fd; in main() 281 pfd.events = POLLIN; in main() 282 pfd.revents = 0; in main() 284 if (poll(&pfd, 1, -1) < 0) { in main()
|
| /tools/testing/selftests/ir/ |
| A D | ir_loopback.c | 176 struct pollfd pfd = { .fd = rlircfd, .events = POLLIN }; in main() local 179 poll(&pfd, 1, 1000); in main()
|