/tools/perf/util/ |
D | strbuf.c | 20 int strbuf_init(struct strbuf *sb, ssize_t hint) in strbuf_init() argument 22 sb->alloc = sb->len = 0; in strbuf_init() 23 sb->buf = strbuf_slopbuf; in strbuf_init() 25 return strbuf_grow(sb, hint); in strbuf_init() 29 void strbuf_release(struct strbuf *sb) in strbuf_release() argument 31 if (sb->alloc) { in strbuf_release() 32 zfree(&sb->buf); in strbuf_release() 33 strbuf_init(sb, 0); in strbuf_release() 37 char *strbuf_detach(struct strbuf *sb, size_t *sz) in strbuf_detach() argument 39 char *res = sb->alloc ? sb->buf : NULL; in strbuf_detach() [all …]
|
D | strbuf.h | 64 static inline ssize_t strbuf_avail(const struct strbuf *sb) { in strbuf_avail() argument 65 return sb->alloc ? sb->alloc - sb->len - 1 : 0; in strbuf_avail() 70 static inline int strbuf_setlen(struct strbuf *sb, size_t len) { in strbuf_setlen() argument 71 if (!sb->alloc) { in strbuf_setlen() 72 int ret = strbuf_grow(sb, 0); in strbuf_setlen() 76 assert(len < sb->alloc); in strbuf_setlen() 77 sb->len = len; in strbuf_setlen() 78 sb->buf[len] = '\0'; in strbuf_setlen() 83 int strbuf_addch(struct strbuf *sb, int c); 86 static inline int strbuf_addstr(struct strbuf *sb, const char *s) { in strbuf_addstr() argument [all …]
|
D | sort.c | 3116 static void add_key(struct strbuf *sb, const char *str, int *llen) in add_key() argument 3119 strbuf_addstr(sb, "\n\t\t\t "); in add_key() 3122 strbuf_addf(sb, " %s", str); in add_key() 3126 static void add_sort_string(struct strbuf *sb, struct sort_dimension *s, int n, in add_sort_string() argument 3132 add_key(sb, s[i].name, llen); in add_sort_string() 3135 static void add_hpp_sort_string(struct strbuf *sb, struct hpp_dimension *s, int n, in add_hpp_sort_string() argument 3141 add_key(sb, s[i].name, llen); in add_hpp_sort_string() 3146 struct strbuf sb; in sort_help() local 3150 strbuf_init(&sb, 300); in sort_help() 3151 strbuf_addstr(&sb, prefix); in sort_help() [all …]
|
D | header.c | 2199 struct strbuf sb; in process_cpu_topology() local 2214 if (strbuf_init(&sb, 128) < 0) in process_cpu_topology() 2223 if (strbuf_add(&sb, str, strlen(str) + 1) < 0) in process_cpu_topology() 2228 ph->env.sibling_cores = strbuf_detach(&sb, NULL); in process_cpu_topology() 2242 if (strbuf_add(&sb, str, strlen(str) + 1) < 0) in process_cpu_topology() 2247 ph->env.sibling_threads = strbuf_detach(&sb, NULL); in process_cpu_topology() 2306 if (strbuf_add(&sb, str, strlen(str) + 1) < 0) in process_cpu_topology() 2311 ph->env.sibling_dies = strbuf_detach(&sb, NULL); in process_cpu_topology() 2323 strbuf_release(&sb); in process_cpu_topology() 2380 struct strbuf sb; in process_pmu_mappings() local [all …]
|
/tools/testing/selftests/net/forwarding/ |
D | devlink_lib.sh | 114 devlink sb port pool show $port pool $pool -j \ 126 devlink sb port pool set $port pool $pool th $th 135 devlink sb port pool set $port pool $pool th ${DEVLINK_ORIG[$key]} 142 devlink sb pool show "$DEVLINK_DEV" pool $pool -j \ 154 devlink sb pool set "$DEVLINK_DEV" pool $pool size $size thtype $thtype 163 devlink sb pool set "$DEVLINK_DEV" pool $pool \ 173 devlink sb tc bind show $port tc $tc type $dir -j \ 187 devlink sb tc bind set $port tc $tc type $dir pool $pool th $th 198 devlink sb tc bind set $port tc $tc type $dir \
|
/tools/spi/ |
D | spidev_test.c | 320 struct stat sb; in transfer_file() local 325 if (stat(filename, &sb) == -1) in transfer_file() 332 tx = malloc(sb.st_size); in transfer_file() 336 rx = malloc(sb.st_size); in transfer_file() 340 bytes = read(tx_fd, tx, sb.st_size); in transfer_file() 341 if (bytes != sb.st_size) in transfer_file() 344 transfer(fd, tx, rx, sb.st_size); in transfer_file()
|
/tools/testing/selftests/filesystems/incfs/ |
D | utils.c | 78 struct signature_blob *sb = malloc(size); in format_signature() local 80 *sb = (struct signature_blob){ in format_signature() 93 memcpy(sb->hash_section.hash, root_hash, SHA256_DIGEST_SIZE); in format_signature() 94 memcpy((char *)sb->signing_section, add_data, strlen(add_data) + 1); in format_signature() 95 *buf = sb; in format_signature()
|
/tools/hv/ |
D | hv_vss_daemon.c | 116 struct stat sb; in vss_operate() local 140 if (stat(ent->mnt_fsname, &sb)) { in vss_operate() 145 major(sb.st_rdev), minor(sb.st_rdev)); in vss_operate()
|
/tools/usb/ |
D | testusb.c | 233 static int find_testdev(const char *name, const struct stat *sb, int flag) in find_testdev() argument 239 (void)sb; /* unused */ in find_testdev()
|
/tools/bpf/bpftool/ |
D | perf.c | 150 static int show_proc(const char *fpath, const struct stat *sb, in show_proc() argument
|
D | cgroup.c | 258 static int do_show_tree_fn(const char *fpath, const struct stat *sb, in do_show_tree_fn() argument
|
/tools/lib/subcmd/ |
D | parse-options.c | 786 int sa = tolower(a->short_name), sb = tolower(b->short_name), ret; in option__cmp() local 790 if (sb == 0) in option__cmp() 791 sb = 'z' + 1; in option__cmp() 793 ret = sa - sb; in option__cmp()
|
/tools/perf/pmu-events/ |
D | jevents.c | 928 static int preprocess_arch_std_files(const char *fpath, const struct stat *sb, in preprocess_arch_std_files() argument 935 return json_events(fpath, save_arch_std_events, (void *)sb); in preprocess_arch_std_files() 940 static int process_one_file(const char *fpath, const struct stat *sb, in process_one_file() argument 967 level, sb->st_size, bname, fpath); in process_one_file()
|
/tools/bpf/ |
D | bpf_dbg.c | 946 struct stat sb; in try_load_pcap() local 955 ret = fstat(pcap_fd, &sb); in try_load_pcap() 961 if (!S_ISREG(sb.st_mode)) { in try_load_pcap() 966 pcap_map_size = sb.st_size; in try_load_pcap()
|
/tools/power/x86/x86_energy_perf_policy/ |
D | x86_energy_perf_policy.c | 1255 struct stat sb; in probe_dev_msr() local 1259 if (stat(pathname, &sb)) in probe_dev_msr()
|
/tools/power/x86/turbostat/ |
D | turbostat.c | 3144 struct stat sb; in check_dev_msr() local 3148 if (stat(pathname, &sb)) in check_dev_msr()
|