/tools/perf/util/ |
D | strbuf.c | 22 sb->alloc = sb->len = 0; in strbuf_init() 40 *sz = sb->len; in strbuf_detach() 47 if (sb->len + extra + 1 <= sb->len) in strbuf_grow() 51 ALLOC_GROW(sb->buf, sb->len + extra + 1, sb->alloc); in strbuf_grow() 54 static void strbuf_splice(struct strbuf *sb, size_t pos, size_t len, in strbuf_splice() argument 57 if (pos + len < pos) in strbuf_splice() 59 if (pos > sb->len) in strbuf_splice() 61 if (pos + len > sb->len) in strbuf_splice() 64 if (dlen >= len) in strbuf_splice() 65 strbuf_grow(sb, dlen - len); in strbuf_splice() [all …]
|
D | path.c | 34 size_t len = (ret >= size) ? size - 1 : ret; in strlcpy() local 36 memcpy(dest, src, len); in strlcpy() 37 dest[len] = '\0'; in strlcpy() 65 size_t len; in perf_vsnpath() local 67 len = strlen(perf_dir); in perf_vsnpath() 68 if (n < len + 1) in perf_vsnpath() 70 memcpy(buf, perf_dir, len); in perf_vsnpath() 71 if (len && !is_dir_sep(perf_dir[len-1])) in perf_vsnpath() 72 buf[len++] = '/'; in perf_vsnpath() 73 len += vsnprintf(buf + len, n - len, fmt, args); in perf_vsnpath() [all …]
|
D | strbuf.h | 47 size_t len; member 60 return sb->alloc ? sb->alloc - sb->len - 1 : 0; in strbuf_avail() 65 static inline void strbuf_setlen(struct strbuf *sb, size_t len) { in strbuf_setlen() argument 68 assert(len < sb->alloc); in strbuf_setlen() 69 sb->len = len; in strbuf_setlen() 70 sb->buf[len] = '\0'; in strbuf_setlen() 76 sb->buf[sb->len++] = c; in strbuf_addch() 77 sb->buf[sb->len] = '\0'; in strbuf_addch() 80 extern void strbuf_remove(struct strbuf *, size_t pos, size_t len);
|
D | strfilter.c | 246 int len; in strfilter_node__sprint_pt() local 251 len = strfilter_node__sprint(node, buf); in strfilter_node__sprint_pt() 252 if (len < 0) in strfilter_node__sprint_pt() 253 return len; in strfilter_node__sprint_pt() 255 *(buf + len) = ')'; in strfilter_node__sprint_pt() 256 return len + pt; in strfilter_node__sprint_pt() 261 int len = 0, rlen; in strfilter_node__sprint() local 269 len = strfilter_node__sprint_pt(node->l, buf); in strfilter_node__sprint() 270 if (len < 0) in strfilter_node__sprint() 271 return len; in strfilter_node__sprint() [all …]
|
D | help.c | 8 void add_cmdname(struct cmdnames *cmds, const char *name, size_t len) in add_cmdname() argument 10 struct cmdname *ent = malloc(sizeof(*ent) + len + 1); in add_cmdname() 12 ent->len = len; in add_cmdname() 13 memcpy(ent->name, name, len); in add_cmdname() 14 ent->name[len] = 0; in add_cmdname() 125 int len; in list_commands_in_dir() local 134 len = buf.len; in list_commands_in_dir() 142 strbuf_setlen(&buf, len); in list_commands_in_dir() 199 if (longest < main_cmds->names[i]->len) in list_commands() 200 longest = main_cmds->names[i]->len; in list_commands() [all …]
|
D | quote.c | 29 size_t len = strcspn(src, "'!"); in sq_quote_buf() local 30 strbuf_add(dst, src, len); in sq_quote_buf() 31 src += len; in sq_quote_buf() 51 if (maxlen && dst->len > maxlen) in sq_quote_argv()
|
/tools/lib/traceevent/ |
D | trace-seq.c | 57 s->len = 0; in trace_seq_init() 76 s->len = 0; in trace_seq_reset() 127 int len; in trace_seq_printf() local 133 len = (s->buffer_size - 1) - s->len; in trace_seq_printf() 136 ret = vsnprintf(s->buffer + s->len, len, fmt, ap); in trace_seq_printf() 139 if (ret >= len) { in trace_seq_printf() 144 s->len += ret; in trace_seq_printf() 163 int len; in trace_seq_vprintf() local 169 len = (s->buffer_size - 1) - s->len; in trace_seq_vprintf() 171 ret = vsnprintf(s->buffer + s->len, len, fmt, args); in trace_seq_vprintf() [all …]
|
D | plugin_scsi.c | 155 scsi_trace_rw6(struct trace_seq *p, unsigned char *cdb, int len) in scsi_trace_rw6() argument 157 const char *ret = p->buffer + p->len; in scsi_trace_rw6() 172 scsi_trace_rw10(struct trace_seq *p, unsigned char *cdb, int len) in scsi_trace_rw10() argument 174 const char *ret = p->buffer + p->len; in scsi_trace_rw10() 196 scsi_trace_rw12(struct trace_seq *p, unsigned char *cdb, int len) in scsi_trace_rw12() argument 198 const char *ret = p->buffer + p->len; in scsi_trace_rw12() 218 scsi_trace_rw16(struct trace_seq *p, unsigned char *cdb, int len) in scsi_trace_rw16() argument 220 const char *ret = p->buffer + p->len; in scsi_trace_rw16() 248 scsi_trace_rw32(struct trace_seq *p, unsigned char *cdb, int len) in scsi_trace_rw32() argument 250 const char *ret = p->buffer + p->len, *cmd; in scsi_trace_rw32() [all …]
|
/tools/perf/util/intel-pt-decoder/ |
D | intel-pt-pkt-decoder.c | 74 static int intel_pt_get_long_tnt(const unsigned char *buf, size_t len, in intel_pt_get_long_tnt() argument 80 if (len < 8) in intel_pt_get_long_tnt() 97 static int intel_pt_get_pip(const unsigned char *buf, size_t len, in intel_pt_get_pip() argument 102 if (len < 8) in intel_pt_get_pip() 120 static int intel_pt_get_cbr(const unsigned char *buf, size_t len, in intel_pt_get_cbr() argument 123 if (len < 4) in intel_pt_get_cbr() 130 static int intel_pt_get_vmcs(const unsigned char *buf, size_t len, in intel_pt_get_vmcs() argument 138 if (len < count + 2) in intel_pt_get_vmcs() 154 static int intel_pt_get_psb(const unsigned char *buf, size_t len, in intel_pt_get_psb() argument 159 if (len < 16) in intel_pt_get_psb() [all …]
|
D | intel-pt-log.c | 52 static void intel_pt_print_data(const unsigned char *buf, int len, uint64_t pos, in intel_pt_print_data() argument 61 for (i = 0; i < len; i++) in intel_pt_print_data() 117 size_t len = intel_pt_insn->length; in __intel_pt_log_insn() local 122 if (len > INTEL_PT_INSN_DBG_BUF_SZ) in __intel_pt_log_insn() 123 len = INTEL_PT_INSN_DBG_BUF_SZ; in __intel_pt_log_insn() 124 intel_pt_print_data(intel_pt_insn->buf, len, ip, 8); in __intel_pt_log_insn()
|
/tools/testing/selftests/powerpc/copyloops/ |
D | validate.c | 17 unsigned long dst_off, unsigned long len, void *redzone, in do_one() argument 29 memcpy(srcp, fill, len); in do_one() 31 ret = COPY_LOOP(dstp, srcp, len); in do_one() 33 printf("(%p,%p,%ld) returned %ld\n", dstp, srcp, len, ret); in do_one() 37 if (memcmp(dstp, srcp, len)) { in do_one() 38 printf("(%p,%p,%ld) miscompare\n", dstp, srcp, len); in do_one() 40 for (i = 0; i < len; i++) in do_one() 43 for (i = 0; i < len; i++) in do_one() 51 dstp, srcp, len); in do_one() 55 if (memcmp(dstp+len, redzone, dst+BUFLEN-(dstp+len))) { in do_one() [all …]
|
/tools/testing/selftests/breakpoints/ |
D | breakpoint_test.c | 51 static void toggle_breakpoint(int n, int type, int len, in toggle_breakpoint() argument 71 switch (len) { in toggle_breakpoint() 145 static void write_var(int len) in write_var() argument 151 switch (len) { in write_var() 173 static void read_var(int len) in read_var() argument 179 switch (len) { in read_var() 203 int len, local, global, i; in trigger_tests() local 230 for (len = 1; len <= sizeof(long); len <<= 1) { in trigger_tests() 235 write_var(len); in trigger_tests() 241 for (len = 1; len <= sizeof(long); len <<= 1) { in trigger_tests() [all …]
|
/tools/lib/symbol/ |
D | kallsyms.c | 27 int line_len, len; in kallsyms__parse() local 37 len = hex2u64(line, &start); in kallsyms__parse() 39 len++; in kallsyms__parse() 40 if (len + 2 >= line_len) in kallsyms__parse() 43 symbol_type = line[len]; in kallsyms__parse() 44 len += 2; in kallsyms__parse() 45 symbol_name = line + len; in kallsyms__parse() 46 len = line_len - len; in kallsyms__parse() 48 if (len >= KSYM_NAME_LEN) { in kallsyms__parse()
|
/tools/perf/ui/tui/ |
D | util.c | 75 int x, y, len, key; in ui_browser__input_window() local 86 len = sep - t; in ui_browser__input_window() 87 if (max_len < len) in ui_browser__input_window() 88 max_len = len; in ui_browser__input_window() 114 len = 5; in ui_browser__input_window() 115 while (len--) { in ui_browser__input_window() 116 SLsmg_gotorc(y + len - 1, x); in ui_browser__input_window() 128 len = 0; in ui_browser__input_window() 134 if (len == 0) { in ui_browser__input_window() 138 SLsmg_gotorc(y, x + --len); in ui_browser__input_window() [all …]
|
/tools/net/ |
D | bpf_jit_disasm.c | 37 ssize_t len; in get_exec_path() local 45 len = readlink(path, tpath, size); in get_exec_path() 46 tpath[len] = 0; in get_exec_path() 51 static void get_asm_insns(uint8_t *image, size_t len, int opcodes) in get_asm_insns() argument 70 info.buffer_length = len; in get_asm_insns() 90 } while(count > 0 && pc < len); in get_asm_insns() 97 int ret, len; in get_klog_buff() local 100 len = klogctl(CMD_ACTION_SIZE_BUFFER, NULL, 0); in get_klog_buff() 101 buff = malloc(len); in get_klog_buff() 105 ret = klogctl(CMD_ACTION_READ_ALL, buff, len); in get_klog_buff() [all …]
|
/tools/testing/selftests/vm/ |
D | transhuge-stress.c | 60 size_t ram, len; in main() local 74 len = ram; in main() 78 len = atoll(argv[1]) << 20; in main() 81 " and %zd MiB of ram", len >> HPAGE_SHIFT, len >> 20, in main() 82 len >> (20 + HPAGE_SHIFT - PAGE_SHIFT - 1)); in main() 88 len -= len % HPAGE_SIZE; in main() 89 ptr = mmap(NULL, len + HPAGE_SIZE, PROT_READ | PROT_WRITE, in main() 95 if (madvise(ptr, len, MADV_HUGEPAGE)) in main() 109 for (p = ptr; p < ptr + len; p += HPAGE_SIZE) { in main() 141 s, s * 1000 / (len >> HPAGE_SHIFT), len / s / (1 << 20), in main()
|
/tools/power/cpupower/utils/helpers/ |
D | bitmask.c | 248 static inline int emit(char *buf, int buflen, int rbot, int rtop, int len) in emit() argument 250 if (len > 0) in emit() 251 len += snprintf(buf + len, max(buflen - len, 0), ","); in emit() 253 len += snprintf(buf + len, max(buflen - len, 0), "%d", rbot); in emit() 255 len += snprintf(buf + len, max(buflen - len, 0), "%d-%d", in emit() 257 return len; in emit() 276 int len = 0; in bitmask_displaylist() local 287 len = emit(buf, buflen, rbot, rtop, len); in bitmask_displaylist() 291 return len; in bitmask_displaylist()
|
/tools/vm/ |
D | page_owner_sort.c | 20 int len; member 58 static void add_list(char *buf, int len) in add_list() argument 61 len == list[list_size-1].len && in add_list() 62 memcmp(buf, list[list_size-1].txt, len) == 0) { in add_list() 70 list[list_size].txt = malloc(len+1); in add_list() 71 list[list_size].len = len; in add_list() 73 memcpy(list[list_size].txt, buf, len); in add_list() 74 list[list_size].txt[len] = 0; in add_list()
|
/tools/perf/tests/ |
D | code-reading.c | 37 size_t len) in read_objdump_line() argument 49 while (j < len) { in read_objdump_line() 76 static int read_objdump_output(FILE *f, void *buf, size_t *len, u64 start_addr) in read_objdump_output() argument 84 while (off_last < *len) { in read_objdump_output() 113 if (off >= *len) in read_objdump_output() 115 written_bytes = MIN(read_bytes, *len - off); in read_objdump_output() 121 *len -= off_last; in read_objdump_output() 129 size_t len) in read_via_objdump() argument 137 ret = snprintf(cmd, sizeof(cmd), fmt, "objdump", addr, addr + len, in read_via_objdump() 153 ret = read_objdump_output(f, buf, &len, addr); in read_via_objdump() [all …]
|
/tools/perf/ui/ |
D | hist.c | 19 hpp_field_fn get_field, const char *fmt, int len, in __hpp__fmt() argument 35 ret = hpp__call_print_fn(hpp, print_fn, fmt, len, percent); in __hpp__fmt() 37 ret = hpp__call_print_fn(hpp, print_fn, fmt, len, get_field(he)); in __hpp__fmt() 63 fmt, len, 0.0); in __hpp__fmt() 66 fmt, len, 0ULL); in __hpp__fmt() 71 ret += hpp__call_print_fn(hpp, print_fn, fmt, len, in __hpp__fmt() 75 len, period); in __hpp__fmt() 89 fmt, len, 0.0); in __hpp__fmt() 92 fmt, len, 0ULL); in __hpp__fmt() 111 int len = fmt->user_len ?: fmt->len; in hpp__fmt() local [all …]
|
/tools/power/cpupower/lib/ |
D | sysfs.c | 64 const char *value, size_t len) in sysfs_cpufreq_write_file() argument 77 numwrite = write(fd, value, len); in sysfs_cpufreq_write_file() 118 unsigned int len; in sysfs_cpufreq_get_one_value() local 125 len = sysfs_cpufreq_read_file(cpu, cpufreq_value_files[which], in sysfs_cpufreq_get_one_value() 128 if (len == 0) in sysfs_cpufreq_get_one_value() 158 unsigned int len; in sysfs_cpufreq_get_one_string() local 163 len = sysfs_cpufreq_read_file(cpu, cpufreq_string_files[which], in sysfs_cpufreq_get_one_string() 165 if (len == 0) in sysfs_cpufreq_get_one_string() 197 const char *new_value, size_t len) in sysfs_cpufreq_write_one_value() argument 203 new_value, len) != len) in sysfs_cpufreq_write_one_value() [all …]
|
/tools/power/cpupower/bench/ |
D | parse.c | 67 int len; in prepare_output() local 82 len = strlen(dirname) + 30; in prepare_output() 83 filename = malloc(sizeof(char) * len); in prepare_output() 86 len += strlen(sysdata.nodename) + strlen(sysdata.release); in prepare_output() 87 filename = realloc(filename, sizeof(char) * len); in prepare_output() 94 snprintf(filename, len - 1, "%s/benchmark_%s_%s_%li.log", in prepare_output() 97 snprintf(filename, len - 1, "%s/benchmark_%li.log", in prepare_output() 160 size_t len = 0; in prepare_config() local 177 while (getline(&line, &len, configfile) != -1) { in prepare_config()
|
/tools/testing/selftests/powerpc/vphn/ |
D | test-vphn.c | 368 int i, len; in test_one() local 372 len = be32_to_cpu(output[0]); in test_one() 373 if (len != test->expected[0]) { in test_one() 375 len); in test_one() 379 for (i = 1; i < len; i++) { in test_one()
|
/tools/testing/selftests/memfd/ |
D | fuse_mnt.c | 80 size_t len; in memfd_read() local 87 len = strlen(memfd_content); in memfd_read() 88 if (offset < len) { in memfd_read() 89 if (offset + size > len) in memfd_read() 90 size = len - offset; in memfd_read()
|
/tools/perf/ |
D | builtin-help.c | 177 size_t len = strlen(name); in add_man_viewer() local 181 *p = zalloc(sizeof(**p) + len + 1); in add_man_viewer() 185 static int supported_man_viewer(const char *name, size_t len) in supported_man_viewer() argument 187 return (!strncasecmp("man", name, len) || in supported_man_viewer() 188 !strncasecmp("woman", name, len) || in supported_man_viewer() 189 !strncasecmp("konqueror", name, len)); in supported_man_viewer() 193 size_t len, in do_add_man_viewer_info() argument 196 struct man_viewer_info_list *new = zalloc(sizeof(*new) + len + 1); in do_add_man_viewer_info() 198 strncpy(new->name, name, len); in do_add_man_viewer_info() 205 size_t len, in add_man_viewer_path() argument [all …]
|