/tools/power/acpi/tools/acpidump/ |
D | apfiles.c | 106 char filename[ACPI_NAMESEG_SIZE + 16]; in ap_write_to_binary_file() local 119 ACPI_COPY_NAMESEG(filename, ACPI_RSDP_NAME); in ap_write_to_binary_file() 121 ACPI_COPY_NAMESEG(filename, table->signature); in ap_write_to_binary_file() 124 filename[0] = (char)tolower((int)filename[0]); in ap_write_to_binary_file() 125 filename[1] = (char)tolower((int)filename[1]); in ap_write_to_binary_file() 126 filename[2] = (char)tolower((int)filename[2]); in ap_write_to_binary_file() 127 filename[3] = (char)tolower((int)filename[3]); in ap_write_to_binary_file() 128 filename[ACPI_NAMESEG_SIZE] = 0; in ap_write_to_binary_file() 134 strcat(filename, instance_str); in ap_write_to_binary_file() 137 strcat(filename, FILE_SUFFIX_BINARY_TABLE); in ap_write_to_binary_file() [all …]
|
/tools/iio/ |
D | iio_utils.c | 93 char *scan_el_dir, *builtname, *builtname_generic, *filename = 0; in iioutils_get_type() local 123 ret = asprintf(&filename, in iioutils_get_type() 130 sysfsfp = fopen(filename, "r"); in iioutils_get_type() 134 filename); in iioutils_get_type() 167 filename); in iioutils_get_type() 172 free(filename); in iioutils_get_type() 173 filename = 0; in iioutils_get_type() 189 if (filename) in iioutils_get_type() 190 free(filename); in iioutils_get_type() 224 char *filename = NULL; in iioutils_get_param_float() local [all …]
|
D | iio_utils.h | 71 int write_sysfs_int(const char *filename, const char *basedir, int val); 72 int write_sysfs_int_and_verify(const char *filename, const char *basedir, 74 int write_sysfs_string_and_verify(const char *filename, const char *basedir, 76 int write_sysfs_string(const char *filename, const char *basedir, 78 int read_sysfs_posint(const char *filename, const char *basedir); 79 int read_sysfs_float(const char *filename, const char *basedir, float *val); 80 int read_sysfs_string(const char *filename, const char *basedir, char *str);
|
/tools/perf/examples/bpf/ |
D | etcsnoop.c | 36 struct augmented_filename filename; \ 41 struct augmented_enter_##syscall##_args augmented_args = { .filename.reserved = 0, }; \ 43 augmented_args.filename.size = probe_read_str(&augmented_args.filename.value, \ 44 sizeof(augmented_args.filename.value), \ 46 if (__builtin_memcmp(augmented_args.filename.value, etc, 4) != 0) \ 51 (sizeof(augmented_args) - sizeof(augmented_args.filename.value) + \ 52 augmented_args.filename.size)); \
|
D | augmented_syscalls.c | 40 struct augmented_filename filename; \ 44 struct augmented_enter_##syscall##_args augmented_args = { .filename.reserved = 0, }; \ 47 augmented_args.filename.size = probe_read_str(&augmented_args.filename.value, \ 48 sizeof(augmented_args.filename.value), \ 50 if (augmented_args.filename.size < sizeof(augmented_args.filename.value)) { \ 51 len -= sizeof(augmented_args.filename.value) - augmented_args.filename.size; \ 52 len &= sizeof(augmented_args.filename.value) - 1; \
|
/tools/power/cpupower/bench/ |
D | parse.c | 55 char *filename, *filename_tmp; in prepare_output() local 70 filename = malloc(sizeof(char) * len); in prepare_output() 71 if (!filename) { in prepare_output() 78 filename_tmp = realloc(filename, sizeof(*filename) * len); in prepare_output() 81 free(filename); in prepare_output() 86 filename = filename_tmp; in prepare_output() 87 snprintf(filename, len - 1, "%s/benchmark_%s_%s_%li.log", in prepare_output() 90 snprintf(filename, len - 1, "%s/benchmark_%li.log", in prepare_output() 94 dprintf("logfilename: %s\n", filename); in prepare_output() 96 output = fopen(filename, "w+"); in prepare_output() [all …]
|
/tools/testing/selftests/kvm/lib/ |
D | elf.c | 16 static void elfhdr_get(const char *filename, Elf64_Ehdr *hdrp) in elfhdr_get() argument 22 fd = open(filename, O_RDONLY); in elfhdr_get() 25 " rv: %i errno: %i", filename, fd, errno); in elfhdr_get() 42 filename, in elfhdr_get() 50 filename, in elfhdr_get() 73 filename, ident[EI_VERSION], EV_CURRENT); in elfhdr_get() 114 void kvm_vm_elf_load(struct kvm_vm *vm, const char *filename, in kvm_vm_elf_load() argument 122 fd = open(filename, O_RDONLY); in kvm_vm_elf_load() 125 " rv: %i errno: %i", filename, fd, errno); in kvm_vm_elf_load() 128 elfhdr_get(filename, &hdr); in kvm_vm_elf_load() [all …]
|
/tools/testing/selftests/splice/ |
D | short_splice_read.sh | 73 filename="$1" 78 out=$("$DIR"/splice_read "$filename" "$bytes" | cat) 90 filename="$1" 92 echo " checking $filename ..." >&2 94 full=$(cat "$filename") 104 if ! do_splice "$filename" 4096 "$full" "full read" ; then 110 if ! do_splice "$filename" 2 "$two" "'$two'" ; then
|
/tools/perf/ |
D | builtin-buildid-cache.c | 117 static int build_id_cache__add_kcore(const char *filename, bool force) in build_id_cache__add_kcore() argument 123 strlcpy(from_dir, filename, sizeof(from_dir)); in build_id_cache__add_kcore() 174 static int build_id_cache__add_file(const char *filename, struct nsinfo *nsi) in build_id_cache__add_file() argument 182 err = filename__read_build_id(filename, &bid); in build_id_cache__add_file() 185 pr_debug("Couldn't read a build-id in %s\n", filename); in build_id_cache__add_file() 190 err = build_id_cache__add_s(sbuild_id, filename, nsi, in build_id_cache__add_file() 192 pr_debug("Adding %s %s: %s\n", sbuild_id, filename, in build_id_cache__add_file() 197 static int build_id_cache__remove_file(const char *filename, struct nsinfo *nsi) in build_id_cache__remove_file() argument 206 err = filename__read_build_id(filename, &bid); in build_id_cache__remove_file() 209 pr_debug("Couldn't read a build-id in %s\n", filename); in build_id_cache__remove_file() [all …]
|
/tools/lib/api/fs/ |
D | fs.h | 45 int filename__read_int(const char *filename, int *value); 46 int filename__read_ull(const char *filename, unsigned long long *value); 47 int filename__read_xll(const char *filename, unsigned long long *value); 48 int filename__read_str(const char *filename, char **buf, size_t *sizep); 50 int filename__write_int(const char *filename, int value);
|
D | tracing_path.c | 120 char filename[PATH_MAX]; in tracing_path__strerror_open_tp() local 122 snprintf(filename, PATH_MAX, "%s/%s", sys, name ?: "*"); in tracing_path__strerror_open_tp() 134 if (!strncmp(filename, "sdt_", 4)) { in tracing_path__strerror_open_tp() 139 tracing_events_path, filename, sys, name); in tracing_path__strerror_open_tp() 144 tracing_events_path, filename); in tracing_path__strerror_open_tp() 158 tracing_events_path, filename, tracing_path_mount()); in tracing_path__strerror_open_tp()
|
D | fs.c | 320 int filename__read_int(const char *filename, int *value) in filename__read_int() argument 323 int fd = open(filename, O_RDONLY), err = -1; in filename__read_int() 337 static int filename__read_ull_base(const char *filename, in filename__read_ull_base() argument 341 int fd = open(filename, O_RDONLY), err = -1; in filename__read_ull_base() 360 int filename__read_xll(const char *filename, unsigned long long *value) in filename__read_xll() argument 362 return filename__read_ull_base(filename, value, 16); in filename__read_xll() 370 int filename__read_ull(const char *filename, unsigned long long *value) in filename__read_ull() argument 372 return filename__read_ull_base(filename, value, 0); in filename__read_ull() 377 int filename__read_str(const char *filename, char **buf, size_t *sizep) in filename__read_str() argument 384 fd = open(filename, O_RDONLY); in filename__read_str() [all …]
|
/tools/testing/selftests/mount/ |
D | nosymfollow-test.c | 40 static void vmaybe_write_file(bool enoent_ok, char *filename, char *fmt, in vmaybe_write_file() argument 55 fd = open(filename, O_WRONLY); in vmaybe_write_file() 59 die("open of %s failed: %s\n", filename, strerror(errno)); in vmaybe_write_file() 65 die("short write to %s\n", filename); in vmaybe_write_file() 68 filename, strerror(errno)); in vmaybe_write_file() 73 die("close of %s failed: %s\n", filename, strerror(errno)); in vmaybe_write_file() 76 static void maybe_write_file(char *filename, char *fmt, ...) in maybe_write_file() argument 81 vmaybe_write_file(true, filename, fmt, ap); in maybe_write_file() 85 static void write_file(char *filename, char *fmt, ...) in write_file() argument 90 vmaybe_write_file(false, filename, fmt, ap); in write_file()
|
D | unprivileged-remount-test.c | 57 static void vmaybe_write_file(bool enoent_ok, char *filename, char *fmt, va_list ap) in vmaybe_write_file() argument 73 fd = open(filename, O_WRONLY); in vmaybe_write_file() 78 filename, strerror(errno)); in vmaybe_write_file() 83 die("short write to %s\n", filename); in vmaybe_write_file() 86 filename, strerror(errno)); in vmaybe_write_file() 91 filename, strerror(errno)); in vmaybe_write_file() 95 static void maybe_write_file(char *filename, char *fmt, ...) in maybe_write_file() argument 100 vmaybe_write_file(true, filename, fmt, ap); in maybe_write_file() 105 static void write_file(char *filename, char *fmt, ...) in write_file() argument 110 vmaybe_write_file(false, filename, fmt, ap); in write_file()
|
/tools/testing/selftests/cpufreq/ |
D | cpufreq.sh | 217 filename="mem" 219 filename="disk" 225 if [ -n $filename ]; then 226 present=$(cat $SYSFS/power/state | grep $filename) 229 printf "Tried to $1 but $filename isn't present in $SYSFS/power/state\n" 235 echo $filename > $SYSFS/power/state
|
/tools/perf/util/ |
D | srcline.c | 135 const char *filename; member 225 &a2l->filename, &a2l->funcname, in find_address_in_section() 228 if (a2l->filename && !strlen(a2l->filename)) in find_address_in_section() 229 a2l->filename = NULL; in find_address_in_section() 286 if (a2l->filename) in inline_list__append_dso_a2l() 287 srcline = srcline_from_fileline(a2l->filename, a2l->line); in inline_list__append_dso_a2l() 325 while (bfd_find_inliner_info(a2l->abfd, &a2l->filename, in addr2line() 329 if (a2l->filename && !strlen(a2l->filename)) in addr2line() 330 a2l->filename = NULL; in addr2line() 342 *file = a2l->filename ? strdup(a2l->filename) : NULL; in addr2line() [all …]
|
D | map.h | 110 char *filename, struct thread *thread); 175 static inline int is_anon_memory(const char *filename) in is_anon_memory() argument 177 return !strcmp(filename, "//anon") || in is_anon_memory() 178 !strncmp(filename, "/dev/zero", sizeof("/dev/zero") - 1) || in is_anon_memory() 179 !strncmp(filename, "/anon_hugepage", sizeof("/anon_hugepage") - 1); in is_anon_memory() 182 static inline int is_no_dso_memory(const char *filename) in is_no_dso_memory() argument 184 return !strncmp(filename, "[stack", 6) || in is_no_dso_memory() 185 !strncmp(filename, "/SYSV", 5) || in is_no_dso_memory() 186 !strcmp(filename, "[heap]"); in is_no_dso_memory()
|
D | build-id.c | 558 char *realname = (char *)name, *filename; in build_id_cache__cachedir() local 567 if (asprintf(&filename, "%s%s%s%s%s", buildid_dir, slash ? "/" : "", in build_id_cache__cachedir() 570 filename = NULL; in build_id_cache__cachedir() 575 return filename; in build_id_cache__cachedir() 670 char *realname = NULL, *filename = NULL, *dir_name = NULL, in build_id_cache__add_s() local 698 if (asprintf(&filename, "%s/%s", dir_name, in build_id_cache__add_s() 701 filename = NULL; in build_id_cache__add_s() 705 if (access(filename, F_OK)) { in build_id_cache__add_s() 707 if (copyfile("/proc/kallsyms", filename)) in build_id_cache__add_s() 710 if (copyfile_ns(name, filename, nsi)) in build_id_cache__add_s() [all …]
|
D | cputopo.c | 34 char filename[MAXPATHLEN]; in build_cpu_topology() local 41 scnprintf(filename, MAXPATHLEN, CORE_SIB_FMT, in build_cpu_topology() 43 fp = fopen(filename, "r"); in build_cpu_topology() 72 scnprintf(filename, MAXPATHLEN, DIE_SIB_FMT, in build_cpu_topology() 74 fp = fopen(filename, "r"); in build_cpu_topology() 100 scnprintf(filename, MAXPATHLEN, THRD_SIB_FMT_NEW, in build_cpu_topology() 102 if (access(filename, F_OK) == -1) { in build_cpu_topology() 103 scnprintf(filename, MAXPATHLEN, THRD_SIB_FMT, in build_cpu_topology() 106 fp = fopen(filename, "r"); in build_cpu_topology() 157 char filename[MAXPATHLEN]; in has_die_topology() local [all …]
|
/tools/perf/tests/ |
D | pe-file-parsing.c | 25 char filename[PATH_MAX]; in run_dir() local 38 scnprintf(filename, PATH_MAX, "%s/pe-file.exe", d); in run_dir() 39 ret = filename__read_build_id(filename, &bid); in run_dir() 45 ret = filename__read_debuglink(filename, debuglink, PATH_MAX); in run_dir() 57 dso = dso__new(filename); in run_dir()
|
D | sdt.c | 28 static int build_id_cache__add_file(const char *filename) in build_id_cache__add_file() argument 34 err = filename__read_build_id(filename, &bid); in build_id_cache__add_file() 36 pr_debug("Failed to read build id of %s\n", filename); in build_id_cache__add_file() 41 err = build_id_cache__add_s(sbuild_id, filename, NULL, false, false); in build_id_cache__add_file() 43 pr_debug("Failed to add build id cache of %s\n", filename); in build_id_cache__add_file()
|
/tools/testing/selftests/proc/ |
D | read.c | 38 static void f_reg(DIR *d, const char *filename) in f_reg() argument 45 fd = openat(dirfd(d), filename, O_RDONLY|O_NONBLOCK); in f_reg() 53 static void f_reg_write(DIR *d, const char *filename, const char *buf, size_t len) in f_reg_write() argument 58 fd = openat(dirfd(d), filename, O_WRONLY); in f_reg_write() 66 static void f_lnk(DIR *d, const char *filename) in f_lnk() argument 71 rv = readlinkat(dirfd(d), filename, buf, sizeof(buf)); in f_lnk()
|
/tools/usb/ |
D | ffs-test.c | 344 const char *const filename; member 384 t->fd = open(t->filename, O_RDWR); in init_thread() 385 die_on(t->fd < 0, "%s", t->filename); in init_thread() 404 err("%s: get fifo status", t->filename); in cleanup_thread() 406 warn("%s: unclaimed = %d\n", t->filename, ret); in cleanup_thread() 408 err("%s: fifo flush", t->filename); in cleanup_thread() 413 err("%s: close", t->filename); in cleanup_thread() 425 info("%s: starts\n", t->filename); in start_thread_helper() 426 in_name = t->in_name ? t->in_name : t->filename; in start_thread_helper() 427 out_name = t->out_name ? t->out_name : t->filename; in start_thread_helper() [all …]
|
/tools/testing/selftests/resctrl/ |
D | cache.c | 153 static int print_results_cache(char *filename, int bm_pid, in print_results_cache() argument 158 if (strcmp(filename, "stdio") == 0 || strcmp(filename, "stderr") == 0) { in print_results_cache() 162 fp = fopen(filename, "a"); in print_results_cache() 199 ret = print_results_cache(param->filename, bm_pid, llc_value); in measure_cache_vals() 219 if (strcmp(param->filename, "") == 0) in cat_val() 220 sprintf(param->filename, "stdio"); in cat_val()
|
/tools/testing/selftests/filesystems/incfs/ |
D | incfs_test.c | 576 static loff_t read_whole_file(const char *filename) in read_whole_file() argument 583 fd = open(filename, O_RDONLY | O_CLOEXEC); in read_whole_file() 606 static int read_test_file(uint8_t *buf, size_t len, char *filename, in read_test_file() argument 615 fd = open(filename, O_RDONLY | O_CLOEXEC); in read_test_file() 683 char *filename = concat_file_name(mount_dir, file->name); in validate_test_file_content_with_seed() local 685 loff_t actual_size = get_file_size(filename); in validate_test_file_content_with_seed() 700 filename, size, actual_size); in validate_test_file_content_with_seed() 715 filename, block_idx); in validate_test_file_content_with_seed() 719 block_idx, filename, strerror(-read_result)); in validate_test_file_content_with_seed() 732 free(filename); in validate_test_file_content_with_seed() [all …]
|