Home
last modified time | relevance | path

Searched refs:pfd (Results 1 – 25 of 25) sorted by relevance

/tools/testing/selftests/net/af_unix/
Dtest_unix_oob.c94 int read_data(int pfd, char *buf, int size) in read_data() argument
99 len = read(pfd, buf, size); in read_data()
107 static void wait_for_data(int pfd, int event) in wait_for_data() argument
111 pfds[0].fd = pfd; in wait_for_data()
177 int lfd, pfd; in main() local
213 pfd = accept(lfd, (struct sockaddr *) &paddr, &len); in main()
214 fcntl(pfd, F_SETOWN, getpid()); in main()
224 wait_for_data(pfd, POLLPRI); in main()
225 read_oob(pfd, &oob); in main()
226 len = read_data(pfd, buf, 1024); in main()
[all …]
/tools/testing/selftests/bpf/prog_tests/
Dperf_branches.c106 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
155 pfd = syscall(__NR_perf_event_open, &attr, -1, 0, -1, PERF_FLAG_FD_CLOEXEC); in test_perf_branches_no_hw()
156 if (CHECK(pfd < 0, "perf_event_open", "err %d\n", pfd)) in test_perf_branches_no_hw()
[all …]
Dperf_link.c30 int pfd = -1, link_fd = -1, err; in test_perf_link() local
42 pfd = syscall(__NR_perf_event_open, &attr, -1, 0, -1, PERF_FLAG_FD_CLOEXEC); in test_perf_link()
43 if (!ASSERT_GE(pfd, 0, "perf_fd")) in test_perf_link()
50 link_fd = bpf_link_create(bpf_program__fd(skel->progs.handler), pfd, in test_perf_link()
86 if (pfd >= 0) in test_perf_link()
87 close(pfd); in test_perf_link()
Dpe_preserve_elems.c12 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()
Dbpf_cookie.c188 int pfd = -1; in pe_subtest() local
197 pfd = syscall(__NR_perf_event_open, &attr, -1, 0, -1, PERF_FLAG_FD_CLOEXEC); in pe_subtest()
198 if (!ASSERT_GE(pfd, 0, "perf_fd")) in pe_subtest()
202 link = bpf_program__attach_perf_event_opts(skel->progs.handle_pe, pfd, &opts); in pe_subtest()
221 link = bpf_program__attach_perf_event_opts(skel->progs.handle_pe, pfd, &opts); in pe_subtest()
230 close(pfd); in pe_subtest()
/tools/testing/selftests/nsfs/
Downer.c28 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/
Dgpio-watch.c27 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/filesystems/epoll/
Depoll_wakeup_test.c63 struct pollfd pfd; in waiter_entry1ap() local
67 pfd.fd = ctx->efd[0]; in waiter_entry1ap()
68 pfd.events = POLLIN; in waiter_entry1ap()
69 if (poll(&pfd, 1, -1) > 0) { in waiter_entry1ap()
90 struct pollfd pfd; in waiter_entry1op() local
94 pfd.fd = ctx->efd[0]; in waiter_entry1op()
95 pfd.events = POLLIN; in waiter_entry1op()
96 if (poll(&pfd, 1, -1) > 0) { in waiter_entry1op()
117 struct pollfd pfd; in waiter_entry2ap() local
121 pfd.fd = ctx->efd[0]; in waiter_entry2ap()
[all …]
/tools/testing/selftests/net/
Dpsock_tpacket.c222 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()
233 pfd.events = POLLIN | POLLERR; in walk_v1_v2_rx()
234 pfd.revents = 0; in walk_v1_v2_rx()
265 poll(&pfd, 1, 1); in walk_v1_v2_rx()
371 struct pollfd pfd; in walk_tx() local
410 memset(&pfd, 0, sizeof(pfd)); in walk_tx()
411 pfd.fd = sock; in walk_tx()
412 pfd.events = POLLOUT | POLLERR; in walk_tx()
[all …]
Dudpgso_bench_rx.c94 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()
Dpsock_fanout.c160 int pfd; in sock_fanout_set_ebpf() local
171 pfd = syscall(__NR_bpf, BPF_PROG_LOAD, &attr, sizeof(attr)); in sock_fanout_set_ebpf()
172 if (pfd < 0) { in sock_fanout_set_ebpf()
178 if (setsockopt(fd, SOL_PACKET, PACKET_FANOUT_DATA, &pfd, sizeof(pfd))) { in sock_fanout_set_ebpf()
183 if (close(pfd)) { in sock_fanout_set_ebpf()
Dmsg_zerocopy.c143 struct pollfd pfd; in do_poll() local
146 pfd.events = events; in do_poll()
147 pfd.revents = 0; in do_poll()
148 pfd.fd = fd; in do_poll()
150 ret = poll(&pfd, 1, cfg_waittime_ms); in do_poll()
154 return ret && (pfd.revents & events); in do_poll()
Dso_txtime.c228 struct pollfd pfd = { .fd = fdt, .events = POLLERR }; in recv_errqueue_msgs() local
233 ret = poll(&pfd, 1, timeout_ms); in recv_errqueue_msgs()
237 if (ret && (pfd.revents & POLLERR)) in recv_errqueue_msgs()
Dtcp_mmap.c183 struct pollfd pfd = { .fd = fd, .events = POLLIN, }; in child_thread() local
186 poll(&pfd, 1, 10000); in child_thread()
/tools/testing/selftests/sched/
Dcs_prctl_test.c67 int pfd[2]; member
155 close(ca->pfd[0]); in child_func_process()
159 write(ca->pfd[1], &ca->thr_tids, sizeof(int) * ca->num_threads); in child_func_process()
160 close(ca->pfd[1]); in child_func_process()
177 if (pipe(proc[i].pfd) == -1) in create_processes()
183 close(proc[i].pfd[1]); in create_processes()
187 read(proc[i].pfd[0], &proc[i].thr_tids, sizeof(int) * proc[i].num_threads); in create_processes()
188 close(proc[i].pfd[0]); in create_processes()
/tools/testing/selftests/bpf/
Dtest_lirc_mode2_user.c113 struct pollfd pfd = { .fd = inputfd, .events = POLLIN }; in main() local
117 poll(&pfd, 1, 100); in main()
140 poll(&pfd, 1, 100); in main()
Dtest_flow_dissector.c477 struct pollfd pfd; in do_poll() local
480 pfd.fd = fd; in do_poll()
481 pfd.events = events; in do_poll()
483 ret = poll(&pfd, 1, timeout); in do_poll()
486 if (ret && !(pfd.revents & POLLIN)) in do_poll()
487 error(1, errno, "poll: unexpected event 0x%x\n", pfd.revents); in do_poll()
Dtest_lru_map.c64 int mfd, pfd, ret, zero = 0; in bpf_map_lookup_elem_with_ref_bit() local
85 pfd = bpf_load_program_xattr(&prog, NULL, 0); in bpf_map_lookup_elem_with_ref_bit()
86 if (pfd < 0) { in bpf_map_lookup_elem_with_ref_bit()
91 ret = bpf_prog_test_run(pfd, 1, data, sizeof(data), in bpf_map_lookup_elem_with_ref_bit()
99 close(pfd); in bpf_map_lookup_elem_with_ref_bit()
/tools/hv/
Dhv_vss_daemon.c213 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()
Dhv_kvp_daemon.c1365 struct pollfd pfd; in main() local
1442 pfd.fd = kvp_fd; in main()
1445 pfd.events = POLLIN; in main()
1446 pfd.revents = 0; in main()
1448 if (poll(&pfd, 1, -1) < 0) { in main()
/tools/testing/selftests/ir/
Dir_loopback.c167 struct pollfd pfd = { .fd = rlircfd, .events = POLLIN }; in main() local
170 poll(&pfd, 1, 1000); in main()
/tools/lib/bpf/
Dlibbpf.c6093 char *license, __u32 kern_version, int *pfd) in load_program() argument
6152 *pfd = -1; in load_program()
6185 *pfd = ret; in load_program()
6335 if (result.pfd) in bpf_program__load()
6336 *result.pfd = -1; in bpf_program__load()
6348 if (result.pfd) in bpf_program__load()
6349 *result.pfd = fd; in bpf_program__load()
9045 struct bpf_link *bpf_program__attach_perf_event_opts(struct bpf_program *prog, int pfd, in bpf_program__attach_perf_event_opts() argument
9055 if (pfd < 0) { in bpf_program__attach_perf_event_opts()
9057 prog->name, pfd); in bpf_program__attach_perf_event_opts()
[all …]
Dlibbpf.h257 bpf_program__attach_perf_event(struct bpf_program *prog, int pfd);
260 bpf_program__attach_perf_event_opts(struct bpf_program *prog, int pfd,
398 int *pfd; member
/tools/iio/
Diio_generic_buffer.c725 struct pollfd pfd = { in main() local
730 ret = poll(&pfd, 1, -1); in main()
/tools/perf/util/
Dbpf-loader.c463 res->pfd = NULL; in preproc_gen_prologue()