| /linux/tools/perf/tests/ |
| H A D | tests-scripts.c | 78 static char *shell_test__description(int dir_fd, const char *name) in shell_test__description() argument 84 io__init(&io, openat(dir_fd, name, O_RDONLY), buf, sizeof(buf)); in shell_test__description() 121 static bool is_shell_script(int dir_fd, const char *path) in is_shell_script() argument 129 if (faccessat(dir_fd, path, R_OK | X_OK, 0) == 0) /* Is executable */ in is_shell_script() 136 static bool is_test_script(int dir_fd, const char *name) in is_test_script() argument 138 return is_shell_script(dir_fd, name); in is_test_script() 170 static void append_script(int dir_fd, const char *name, char *desc, in append_script() argument 180 snprintf(link, sizeof(link), "/proc/%d/fd/%d", getpid(), dir_fd); in append_script() 226 static void append_scripts_in_dir(int dir_fd, in append_scripts_in_dir() argument 235 n_dirs = scandirat(dir_fd, ".", &entlist, NULL, alphasort); in append_scripts_in_dir() [all …]
|
| /linux/tools/testing/selftests/landlock/ |
| H A D | base_test.c | 392 int ruleset_fd_tx, dir_fd; in TEST() 434 dir_fd = open("/tmp", O_RDONLY | O_DIRECTORY | O_CLOEXEC); 435 ASSERT_LE(0, dir_fd); 436 ASSERT_EQ(0, close(dir_fd)); 444 dir_fd = open("/", O_RDONLY | O_DIRECTORY | O_CLOEXEC); 445 ASSERT_LE(0, dir_fd); 446 ASSERT_EQ(0, close(dir_fd)); 447 dir_fd = open("/tmp", O_RDONLY | O_DIRECTORY | O_CLOEXEC); 448 ASSERT_LE(0, dir_fd); 449 ASSERT_EQ(0, close(dir_fd)); 266 int ruleset_fd_tx, dir_fd; TEST() local 335 int ruleset_fd, dir_fd; TEST() local [all...] |
| H A D | net_test.c | 1611 int ruleset_fd, bind_fd, dir_fd; in TEST_F() local 1633 dir_fd = open("/dev", O_RDONLY); in TEST_F() 1634 EXPECT_LE(0, dir_fd); in TEST_F() 1635 EXPECT_EQ(0, close(dir_fd)); in TEST_F() 1637 dir_fd = open("/", O_RDONLY); in TEST_F() 1638 EXPECT_EQ(-1, dir_fd); in TEST_F()
|
| H A D | fs_test.c | 4503 int dir_fd, ruleset_fd; in TEST_F_FORK() local 4516 dir_fd = open("/dev", O_RDONLY); in TEST_F_FORK() 4517 if (dir_fd < 0) in TEST_F_FORK() 4526 EXPECT_EQ(0, test_fionread_ioctl(dir_fd)); in TEST_F_FORK() 4529 EXPECT_EQ(0, ioctl(dir_fd, FIOCLEX)); in TEST_F_FORK() 4530 EXPECT_EQ(0, ioctl(dir_fd, FIONCLEX)); in TEST_F_FORK() 4531 EXPECT_EQ(0, ioctl(dir_fd, FIONBIO, &flag)); in TEST_F_FORK() 4532 EXPECT_EQ(0, ioctl(dir_fd, FIOASYNC, &flag)); in TEST_F_FORK() 4533 EXPECT_EQ(0, ioctl(dir_fd, FIGETBSZ, &flag)); in TEST_F_FORK() 4535 ASSERT_EQ(0, close(dir_fd)); in TEST_F_FORK()
|
| /linux/tools/testing/selftests/proc/ |
| H A D | fd-003-kthread.c | 44 int dir_fd, fd; in kernel_thread_fd() local 48 dir_fd = open(buf, O_RDONLY|O_DIRECTORY); in kernel_thread_fd() 49 if (dir_fd == -1) in kernel_thread_fd() 56 fd = openat(dir_fd, "stat", O_RDONLY); in kernel_thread_fd() 58 close(dir_fd); in kernel_thread_fd() 90 fd = openat(dir_fd, "fd", O_RDONLY|O_DIRECTORY); in kernel_thread_fd() 92 close(dir_fd); in kernel_thread_fd()
|
| /linux/tools/perf/util/ |
| H A D | bpf-filter.c | 677 int dir_fd, ret = -1; in perf_bpf_filter__pin() local 713 dir_fd = open(path, O_PATH); in perf_bpf_filter__pin() 714 if (dir_fd < 0) { in perf_bpf_filter__pin() 716 ret = dir_fd; in perf_bpf_filter__pin() 721 if (fchmodat(dir_fd, "..", 01755, 0) < 0) { in perf_bpf_filter__pin() 728 if (fchmodat(dir_fd, ".", 0755, 0) < 0) { in perf_bpf_filter__pin() 735 if (fchmodat(dir_fd, "perf_sample_filter", 0777, 0) < 0) { in perf_bpf_filter__pin() 740 if (fchmodat(dir_fd, "filters", 0666, 0) < 0) { in perf_bpf_filter__pin() 744 if (fchmodat(dir_fd, "event_hash", 0666, 0) < 0) { in perf_bpf_filter__pin() 748 if (fchmodat(dir_fd, "idx_hash", 0666, 0) < 0) { in perf_bpf_filter__pin() [all …]
|
| /linux/tools/perf/ui/browsers/ |
| H A D | scripts.c | 91 static int check_ev_match(int dir_fd, const char *scriptname, struct perf_session *session) in check_ev_match() argument 101 fd = openat(dir_fd, filename, O_RDONLY); in check_ev_match()
|