Home
last modified time | relevance | path

Searched refs:perf_fd (Results 1 – 5 of 5) sorted by relevance

/linux/tools/testing/selftests/bpf/prog_tests/
H A Dperf_skip.c42 int perf_fd = -1; in serial_test_perf_skip() local
75 perf_fd = syscall(__NR_perf_event_open, &attr, 0, -1, -1, 0); in serial_test_perf_skip()
76 if (perf_fd < 0 && (errno == ENOENT || errno == EOPNOTSUPP)) { in serial_test_perf_skip()
81 if (!ASSERT_OK(perf_fd < 0, "perf_event_open")) in serial_test_perf_skip()
85 err = fcntl(perf_fd, F_SETFL, O_ASYNC); in serial_test_perf_skip()
91 err = fcntl(perf_fd, F_SETOWN_EX, &owner); in serial_test_perf_skip()
98 err = ioctl(perf_fd, PERF_EVENT_IOC_REFRESH, 1); in serial_test_perf_skip()
102 prog_link = bpf_program__attach_perf_event(skel->progs.handler, perf_fd); in serial_test_perf_skip()
130 if (perf_fd >= 0) in serial_test_perf_skip()
131 close(perf_fd); in serial_test_perf_skip()
H A Dunpriv_bpf_disabled.c60 __u32 prog_id, int prog_fd, int perf_fd, in test_unpriv_bpf_disabled_positive() argument
129 link_fd = bpf_link_create(bpf_program__fd(skel->progs.handle_perf_event), perf_fd, in test_unpriv_bpf_disabled_positive()
143 __u32 prog_id, int prog_fd, int perf_fd, in test_unpriv_bpf_disabled_negative() argument
237 int prog_fd, perf_fd = -1, i, ret; in test_unpriv_bpf_disabled() local
287 perf_fd = syscall(__NR_perf_event_open, &attr, -1, 0, -1, PERF_FLAG_FD_CLOEXEC); in test_unpriv_bpf_disabled()
288 if (!ASSERT_GE(perf_fd, 0, "perf_fd")) in test_unpriv_bpf_disabled()
298 test_unpriv_bpf_disabled_positive(skel, prog_id, prog_fd, perf_fd, map_paths, in test_unpriv_bpf_disabled()
302 test_unpriv_bpf_disabled_negative(skel, prog_id, prog_fd, perf_fd, map_paths, in test_unpriv_bpf_disabled()
306 close(perf_fd); in test_unpriv_bpf_disabled()
H A Dperf_branches.c60 static void test_perf_branches_common(int perf_fd, in test_perf_branches_common() argument
76 link = bpf_program__attach_perf_event(skel->progs.perf_branches, perf_fd); in test_perf_branches_common()
/linux/tools/testing/selftests/powerpc/ptrace/
H A Dptrace-perf-hwbreak.c143 static int perf_read_counter(int perf_fd, u64 *count) in perf_read_counter() argument
149 ssize_t len = read(perf_fd, count, sizeof(*count)); in perf_read_counter()
229 int perf_fd; /* File descriptor of perf performance counter */ in same_watch_addr_test() local
251 perf_fd = perf_watchpoint_open(pid, &value, sizeof(value)); in same_watch_addr_test()
252 FAIL_IF_MSG(perf_fd < 0, "Failed to open perf performance counter"); in same_watch_addr_test()
271 FAIL_IF_MSG(perf_read_counter(perf_fd, &perf_count), "Failed to read perf counter"); in same_watch_addr_test()
281 FAIL_IF_MSG(perf_read_counter(perf_fd, &perf_count), "Failed to read perf counter"); in same_watch_addr_test()
299 FAIL_IF_MSG(perf_read_counter(perf_fd, &perf_count), "Failed to read perf counter"); in same_watch_addr_test()
309 FAIL_IF_MSG(perf_read_counter(perf_fd, &perf_count), "Failed to read perf counter"); in same_watch_addr_test()
324 FAIL_IF_MSG(perf_read_counter(perf_fd, &perf_count), "Failed to read perf counter"); in same_watch_addr_test()
[all …]
/linux/tools/perf/Documentation/
H A Dtopdown.txt286 ioctl(perf_fd, PERF_EVENT_IOC_RESET, 0);