/tools/testing/selftests/openat2/ |
D | resolve_test.c | 112 const char *path; member 117 const char *path; member 139 .path = "/", .how.resolve = RESOLVE_BENEATH, in test_openat2_opath_tests() 142 .path = "cheeky/absself", .how.resolve = RESOLVE_BENEATH, in test_openat2_opath_tests() 145 .path = "abscheeky/absself", .how.resolve = RESOLVE_BENEATH, in test_openat2_opath_tests() 148 .path = "..", .how.resolve = RESOLVE_BENEATH, in test_openat2_opath_tests() 151 .path = "../root/", .how.resolve = RESOLVE_BENEATH, in test_openat2_opath_tests() 154 .path = "cheeky/self", .how.resolve = RESOLVE_BENEATH, in test_openat2_opath_tests() 157 .path = "abscheeky/self", .how.resolve = RESOLVE_BENEATH, in test_openat2_opath_tests() 160 .path = "cheeky/garbageself", .how.resolve = RESOLVE_BENEATH, in test_openat2_opath_tests() [all …]
|
D | helpers.c | 22 int raw_openat2(int dfd, const char *path, void *how, size_t size) in raw_openat2() argument 24 int ret = syscall(__NR_openat2, dfd, path, how, size); in raw_openat2() 28 int sys_openat2(int dfd, const char *path, struct open_how *how) in sys_openat2() argument 30 return raw_openat2(dfd, path, how, sizeof(*how)); in sys_openat2() 33 int sys_openat(int dfd, const char *path, struct open_how *how) in sys_openat() argument 35 int ret = openat(dfd, path, how->flags, how->mode); in sys_openat() 47 int touchat(int dfd, const char *path) in touchat() argument 49 int fd = openat(dfd, path, O_CREAT, 0700); in touchat() 71 bool fdequal(int fd, int dfd, const char *path) in fdequal() argument 79 if (!path) in fdequal() [all …]
|
/tools/perf/util/ |
D | trace-event-info.c | 98 char *path = get_events_file("header_page"); in record_header_files() local 102 if (!path) { in record_header_files() 107 if (stat(path, &st) < 0) { in record_header_files() 108 pr_debug("can't read '%s'", path); in record_header_files() 117 if (record_file(path, 8) < 0) { in record_header_files() 122 put_events_file(path); in record_header_files() 124 path = get_events_file("header_event"); in record_header_files() 125 if (!path) { in record_header_files() 131 if (stat(path, &st) < 0) { in record_header_files() 132 pr_debug("can't read '%s'", path); in record_header_files() [all …]
|
D | path.c | 37 static char *cleanup_path(char *path) in cleanup_path() argument 40 if (!memcmp(path, "./", 2)) { in cleanup_path() 41 path += 2; in cleanup_path() 42 while (*path == '/') in cleanup_path() 43 path++; in cleanup_path() 45 return path; in cleanup_path() 86 char path[PATH_MAX]; in is_directory() local 89 snprintf(path, sizeof(path), "%s/%s", base_path, dent->d_name); in is_directory() 90 if (stat(path, &st)) in is_directory() 98 char path[PATH_MAX]; in is_executable_file() local [all …]
|
D | data.c | 26 zfree(&files[nr].path); in close_dir() 51 ret = asprintf(&file->path, "%s/data.%d", data->path, i); in perf_data__create_dir() 57 ret = open(file->path, O_RDWR|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR); in perf_data__create_dir() 98 dir = opendir(data->path); in perf_data__open_dir() 104 char path[PATH_MAX]; in perf_data__open_dir() local 107 snprintf(path, sizeof(path), "%s/%s", data->path, dent->d_name); in perf_data__open_dir() 108 if (stat(path, &st)) in perf_data__open_dir() 123 file->path = strdup(path); in perf_data__open_dir() 124 if (!file->path) in perf_data__open_dir() 127 ret = open(file->path, O_RDONLY); in perf_data__open_dir() [all …]
|
D | util.c | 92 int mkdir_p(char *path, mode_t mode) in mkdir_p() argument 96 char *d = path; in mkdir_p() 101 if (stat(path, &st) == 0) in mkdir_p() 108 err = stat(path, &st) && mkdir(path, mode); in mkdir_p() 115 return (stat(path, &st) && mkdir(path, mode)) ? -1 : 0; in mkdir_p() 149 static int rm_rf_depth_pat(const char *path, int depth, const char **pat) in rm_rf_depth_pat() argument 158 ret = lstat(path, &statbuf); in rm_rf_depth_pat() 164 return unlink(path); in rm_rf_depth_pat() 167 dir = opendir(path); in rm_rf_depth_pat() 182 path, d->d_name); in rm_rf_depth_pat() [all …]
|
/tools/perf/tests/ |
D | builtin-test-list.c | 38 static const char *shell_tests__dir(char *path, size_t size) in shell_tests__dir() argument 48 scnprintf(path, size, "%s/shell", devel_dirs[i]); in shell_tests__dir() 50 return path; in shell_tests__dir() 56 scnprintf(path, size, "%s/tests/shell", exec_path); in shell_tests__dir() 58 return path; in shell_tests__dir() 62 const char *path, const char *name) in shell_test__description() argument 68 path__join(filename, sizeof(filename), path, name); in shell_test__description() 86 static bool is_shell_script(const char *path) in is_shell_script() argument 90 ext = strrchr(path, '.'); in is_shell_script() 94 if (access(path, R_OK | X_OK) == 0) /* Is executable */ in is_shell_script() [all …]
|
D | api-io.c | 36 static int make_test_file(char path[PATH_MAX], const char *contents) in make_test_file() 41 strcpy(path, TEMPL); in make_test_file() 42 fd = mkstemp(path); in make_test_file() 50 unlink(path); in make_test_file() 57 static int setup_test(char path[PATH_MAX], const char *contents, in setup_test() 60 if (make_test_file(path, contents)) in setup_test() 63 io->fd = open(path, O_RDONLY); in setup_test() 65 pr_debug("Failed to open '%s'\n", path); in setup_test() 66 unlink(path); in setup_test() 73 unlink(path); in setup_test() [all …]
|
D | genelf.c | 28 char path[PATH_MAX]; in test__jit_write_elf() local 31 strcpy(path, TEMPL); in test__jit_write_elf() 33 fd = mkstemp(path); in test__jit_write_elf() 39 pr_info("Writing jit code to: %s\n", path); in test__jit_write_elf() 45 unlink(path); in test__jit_write_elf()
|
/tools/hv/ |
D | vmbus_testing | 30 if not os.path.isdir(debugfs_hyperv_path): 78 path = args.path if "path" in arg_set else None 79 if (path and path[-1] == "/"): 80 path = path[:-1] 81 validate_args_path(path, arg_set, file_map) 82 if (path and "enable_single" in arg_set): 83 state_path = locate_state(path, file_map) 93 set_delay_values(path, file_map, args.delay_time, 98 disable_testing_single_device(path, file_map) 102 get_device_test_values(path, file_map) [all …]
|
/tools/lib/api/fs/ |
D | fs.c | 91 char path[PATH_MAX]; member 161 fs->path, type) == 2) { in fs__read_mounts() 192 strcpy(fs->path, *ptr); in fs__check_mounts() 232 strncpy(fs->path, override_path, sizeof(fs->path) - 1); in fs__env_override() 233 fs->path[sizeof(fs->path) - 1] = '\0'; in fs__env_override() 240 return fs->path; in fs__get_mountpoint() 243 return fs->path; in fs__get_mountpoint() 246 return fs->path; in fs__get_mountpoint() 256 return (const char *)fs->path; in fs__mountpoint() 287 return (const char *)fs->path; in fs__mount() [all …]
|
/tools/lib/subcmd/ |
D | exec-cmd.c | 34 static int is_absolute_path(const char *path) in is_absolute_path() argument 36 return path[0] == '/'; in is_absolute_path() 58 static const char *make_nonrelative_path(const char *path) in make_nonrelative_path() argument 62 if (is_absolute_path(path)) { in make_nonrelative_path() 63 if (strlcpy(buf, path, PATH_MAX) >= PATH_MAX) in make_nonrelative_path() 64 die("Too long path: %.*s", 60, path); in make_nonrelative_path() 69 if (snprintf(buf, PATH_MAX, "%s/%s", cwd, path) >= PATH_MAX) in make_nonrelative_path() 70 die("Too long path: %.*s", 60, path); in make_nonrelative_path() 75 char *system_path(const char *path) in system_path() argument 79 if (is_absolute_path(path)) in system_path() [all …]
|
/tools/power/cpupower/utils/helpers/ |
D | sysfs.c | 18 unsigned int sysfs_read_file(const char *path, char *buf, size_t buflen) in sysfs_read_file() argument 23 fd = open(path, O_RDONLY); in sysfs_read_file() 49 char path[SYSFS_PATH_MAX]; in sysfs_is_cpu_online() local 57 snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u", cpu); in sysfs_is_cpu_online() 59 if (stat(path, &statbuf) != 0) in sysfs_is_cpu_online() 66 snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/online", cpu); in sysfs_is_cpu_online() 67 if (stat(path, &statbuf) != 0) in sysfs_is_cpu_online() 70 fd = open(path, O_RDONLY); in sysfs_is_cpu_online() 107 char path[SYSFS_PATH_MAX]; in sysfs_idlestate_file_exists() local 111 snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/cpuidle/state%u/%s", in sysfs_idlestate_file_exists() [all …]
|
/tools/power/cpupower/lib/ |
D | cpupower.c | 17 unsigned int cpupower_read_sysfs(const char *path, char *buf, size_t buflen) in cpupower_read_sysfs() argument 22 fd = open(path, O_RDONLY); in cpupower_read_sysfs() 38 unsigned int cpupower_write_sysfs(const char *path, char *buf, size_t buflen) in cpupower_write_sysfs() argument 43 fd = open(path, O_WRONLY); in cpupower_write_sysfs() 49 perror(path); in cpupower_write_sysfs() 69 char path[SYSFS_PATH_MAX]; in cpupower_is_cpu_online() local 77 snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u", cpu); in cpupower_is_cpu_online() 79 if (stat(path, &statbuf) != 0) in cpupower_is_cpu_online() 86 snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/online", cpu); in cpupower_is_cpu_online() 87 if (stat(path, &statbuf) != 0) in cpupower_is_cpu_online() [all …]
|
D | cpuidle.c | 33 char path[SYSFS_PATH_MAX]; in cpuidle_state_file_exists() local 37 snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/cpuidle/state%u/%s", in cpuidle_state_file_exists() 39 if (stat(path, &statbuf) != 0) in cpuidle_state_file_exists() 56 char path[SYSFS_PATH_MAX]; in cpuidle_state_read_file() local 60 snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/cpuidle/state%u/%s", in cpuidle_state_read_file() 63 fd = open(path, O_RDONLY); in cpuidle_state_read_file() 91 char path[SYSFS_PATH_MAX]; in cpuidle_state_write_file() local 95 snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/cpuidle/state%u/%s", in cpuidle_state_write_file() 98 fd = open(path, O_WRONLY); in cpuidle_state_write_file() 317 char path[SYSFS_PATH_MAX]; in sysfs_cpuidle_read_file() local [all …]
|
/tools/testing/selftests/efivarfs/ |
D | open-unlink.c | 13 static int set_immutable(const char *path, int immutable) in set_immutable() argument 20 fd = open(path, O_RDONLY); in set_immutable() 44 static int get_immutable(const char *path) in get_immutable() argument 51 fd = open(path, O_RDONLY); in get_immutable() 70 const char *path; in main() local 79 path = argv[1]; in main() 89 fd = open(path, O_WRONLY | O_CREAT, 0600); in main() 103 rc = get_immutable(path); in main() 108 rc = set_immutable(path, 0); in main() 115 fd = open(path, O_RDONLY); in main() [all …]
|
/tools/testing/selftests/nsfs/ |
D | pidns.c | 44 char path[] = "/proc/0123456789/ns/pid"; in main() local 55 snprintf(path, sizeof(path), "/proc/%d/ns/%s", pid, ns_strs[i]); in main() 56 ns = open(path, O_RDONLY); in main() 58 return pr_err("Unable to open %s", path); in main() 64 snprintf(path, sizeof(path), "/proc/self/ns/%s", ns_strs[i]); in main() 65 if (stat(path, &st2)) in main() 66 return pr_err("Unable to stat %s", path); in main()
|
D | owner.c | 30 char path[128]; in main() local 55 snprintf(path, sizeof(path), "/proc/%d/ns/uts", pid); in main() 56 ns = open(path, O_RDONLY); in main() 58 return pr_err("Unable to open %s", path); in main() 67 snprintf(path, sizeof(path), "/proc/%d/ns/user", pid); in main() 68 if (stat(path, &st2)) in main()
|
/tools/testing/selftests/memfd/ |
D | fuse_mnt.c | 27 static int memfd_getattr(const char *path, struct stat *st) in memfd_getattr() argument 31 if (!strcmp(path, "/")) { in memfd_getattr() 34 } else if (!strcmp(path, memfd_path)) { in memfd_getattr() 45 static int memfd_readdir(const char *path, in memfd_readdir() argument 51 if (strcmp(path, "/")) in memfd_readdir() 61 static int memfd_open(const char *path, struct fuse_file_info *fi) in memfd_open() argument 63 if (strcmp(path, memfd_path)) in memfd_open() 75 static int memfd_read(const char *path, in memfd_read() argument 83 if (strcmp(path, memfd_path) != 0) in memfd_read()
|
/tools/verification/dot2/ |
D | dot2k.py | 34 if os.path.exists(self.monitor_templates_dir) == True: 42 if os.path.exists(kernel_path) == True: 46 if os.path.exists("/usr/share/dot2/dot2k_templates/") == True: 53 def __open_file(self, path): argument 55 fd = open(path) 57 raise Exception("Cannot open the file: %s" % path) 149 path = "%s/%s" % (self.name, file_name) 151 file = open(path, 'w') 155 print("Fail creating file: %s" % path) 162 path = "%s/%s" % (self.name, "main.c") [all …]
|
/tools/testing/selftests/bpf/prog_tests/ |
D | cgroup_hierarchical_stats.c | 48 #define CGROUP_PATH(p, n) {.path = p"/"n, .name = n} 51 const char *path, *name; member 71 static int read_from_file(const char *path, char *buf, size_t size) in read_from_file() argument 75 fd = open(path, O_RDONLY); in read_from_file() 133 fd = create_and_get_cgroup(cgroups[i].path); in setup_cgroups() 138 cgroups[i].id = get_cgroup_id(cgroups[i].path); in setup_cgroups() 175 if (join_parent_cgroup(cgroups[i].path)) in attach_processes() 196 static char buf[128], path[128]; in get_attach_counter() local 199 snprintf(path, 128, "%s%s", BPFFS_ATTACH_COUNTERS, file_name); in get_attach_counter() 200 if (!ASSERT_OK(read_from_file(path, buf, 128), "read cgroup_iter")) in get_attach_counter() [all …]
|
/tools/virtio/virtio-trace/ |
D | README | 43 of CPUs and a control path, so FIFO (named pipe) should be created as follows: 45 # mkfifo /tmp/virtio-trace/trace-path-cpu{0,1,2,...,X}.{in,out} 46 # mkfifo /tmp/virtio-trace/agent-ctl-path.{in,out} 49 trace-path-cpu{0,1,2}.{in.out} 51 agent-ctl-path.{in,out}. 58 ##control path## 59 -chardev pipe,id=charchannel0,path=/tmp/virtio-trace/agent-ctl-path\ 61 id=channel0,name=agent-ctl-path\ 62 ##data path## 63 -chardev pipe,id=charchannel1,path=/tmp/virtio-trace/trace-path-cpu0\ [all …]
|
/tools/testing/selftests/ia64/ |
D | aliasing-test.c | 24 static int map_mem(char *path, off_t offset, size_t length, int touch) in map_mem() argument 30 fd = open(path, O_RDWR); in map_mem() 32 perror(path); in map_mem() 36 if (fnmatch("/proc/bus/pci/*", path, 0) == 0) { in map_mem() 62 static int scan_tree(char *path, char *file, off_t offset, size_t length, int touch) in scan_tree() argument 69 n = scandir(path, &namelist, 0, alphasort); in scan_tree() 83 path2 = malloc(strlen(path) + strlen(name) + 3); in scan_tree() 84 strcpy(path2, path); in scan_tree() 119 static int read_rom(char *path) in read_rom() argument 124 fd = open(path, O_RDWR); in read_rom() [all …]
|
/tools/testing/selftests/bpf/ |
D | cgroup_helpers.c | 37 #define format_cgroup_path_pid(buf, path, pid) \ argument 39 CGROUP_WORK_DIR, pid, path) 41 #define format_cgroup_path(buf, path) \ argument 42 format_cgroup_path_pid(buf, path, getpid()) 44 #define format_parent_cgroup_path(buf, path) \ argument 45 format_cgroup_path_pid(buf, path, getppid()) 53 char path[PATH_MAX + 1]; in __enable_controllers() local 61 snprintf(path, sizeof(path), "%s/cgroup.controllers", in __enable_controllers() 63 fd = open(path, O_RDONLY); in __enable_controllers() 65 log_err("Opening cgroup.controllers: %s", path); in __enable_controllers() [all …]
|
/tools/perf/arch/ |
D | common.c | 95 char *path, *tmp = NULL; in lookup_path() local 106 path = strtok_r(env, ":", &tmp); in lookup_path() 107 while (path) { in lookup_path() 108 scnprintf(buf, sizeof(buf), "%s/%s", path, name); in lookup_path() 113 path = strtok_r(NULL, ":", &tmp); in lookup_path() 133 const char *name, const char **path) in perf_env__lookup_binutils_path() argument 197 *path = buf; in perf_env__lookup_binutils_path() 201 *path = NULL; in perf_env__lookup_binutils_path() 205 int perf_env__lookup_objdump(struct perf_env *env, const char **path) in perf_env__lookup_objdump() argument 214 return perf_env__lookup_binutils_path(env, "objdump", path); in perf_env__lookup_objdump()
|