Home
last modified time | relevance | path

Searched refs:len (Results 1 – 25 of 111) sorted by relevance

12345

/tools/perf/util/
Dstrbuf.c22 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 …]
Dpath.c34 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 …]
Dstrbuf.h46 size_t len; member
59 return sb->alloc ? sb->alloc - sb->len - 1 : 0; in strbuf_avail()
64 static inline void strbuf_setlen(struct strbuf *sb, size_t len) { in strbuf_setlen() argument
67 assert(len < sb->alloc); in strbuf_setlen()
68 sb->len = len; in strbuf_setlen()
69 sb->buf[len] = '\0'; in strbuf_setlen()
75 sb->buf[sb->len++] = c; in strbuf_addch()
76 sb->buf[sb->len] = '\0'; in strbuf_addch()
79 extern void strbuf_remove(struct strbuf *, size_t pos, size_t len);
Dcolor.c8 static int parse_color(const char *name, int len) in parse_color() argument
19 if (!strncasecmp(name, str, len) && !str[len]) in parse_color()
23 if (end - name == len && i >= -1 && i <= 255) in parse_color()
28 static int parse_attr(const char *name, int len) in parse_attr() argument
38 if (!strncasecmp(name, str, len) && !str[len]) in parse_attr()
53 int len = value_len; in color_parse_mem() local
58 if (!strncasecmp(value, "reset", len)) { in color_parse_mem()
64 while (len > 0) { in color_parse_mem()
68 while (len > 0 && !isspace(word[wordlen])) { in color_parse_mem()
70 len--; in color_parse_mem()
[all …]
Dhelp.c8 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 …]
Dquote.c29 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/
Dtrace-seq.c57 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 …]
Dplugin_scsi.c152 scsi_trace_rw6(struct trace_seq *p, unsigned char *cdb, int len) in scsi_trace_rw6() argument
154 const char *ret = p->buffer + p->len; in scsi_trace_rw6()
169 scsi_trace_rw10(struct trace_seq *p, unsigned char *cdb, int len) in scsi_trace_rw10() argument
171 const char *ret = p->buffer + p->len; in scsi_trace_rw10()
193 scsi_trace_rw12(struct trace_seq *p, unsigned char *cdb, int len) in scsi_trace_rw12() argument
195 const char *ret = p->buffer + p->len; in scsi_trace_rw12()
215 scsi_trace_rw16(struct trace_seq *p, unsigned char *cdb, int len) in scsi_trace_rw16() argument
217 const char *ret = p->buffer + p->len; in scsi_trace_rw16()
245 scsi_trace_rw32(struct trace_seq *p, unsigned char *cdb, int len) in scsi_trace_rw32() argument
247 const char *ret = p->buffer + p->len, *cmd; in scsi_trace_rw32()
[all …]
/tools/testing/selftests/powerpc/copyloops/
Dvalidate.c17 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/
Dbreakpoint_test.c49 static void toggle_breakpoint(int n, int type, int len, in toggle_breakpoint() argument
69 switch (len) { in toggle_breakpoint()
143 static void write_var(int len) in write_var() argument
149 switch (len) { in write_var()
171 static void read_var(int len) in read_var() argument
177 switch (len) { in read_var()
201 int len, local, global, i; in trigger_tests() local
228 for (len = 1; len <= sizeof(long); len <<= 1) { in trigger_tests()
233 write_var(len); in trigger_tests()
239 for (len = 1; len <= sizeof(long); len <<= 1) { in trigger_tests()
[all …]
/tools/lib/symbol/
Dkallsyms.c21 int line_len, len; in kallsyms__parse() local
31 len = hex2u64(line, &start); in kallsyms__parse()
33 len++; in kallsyms__parse()
34 if (len + 2 >= line_len) in kallsyms__parse()
37 symbol_type = line[len]; in kallsyms__parse()
38 len += 2; in kallsyms__parse()
39 symbol_name = line + len; in kallsyms__parse()
40 len = line_len - len; in kallsyms__parse()
42 if (len >= KSYM_NAME_LEN) { in kallsyms__parse()
/tools/perf/bench/
Dmem-memset.c120 static u64 do_memset_cycle(memset_t fn, size_t len, bool prefault) in do_memset_cycle() argument
126 alloc_mem(&dst, len); in do_memset_cycle()
129 fn(dst, -1, len); in do_memset_cycle()
133 fn(dst, i, len); in do_memset_cycle()
140 static double do_memset_gettimeofday(memset_t fn, size_t len, bool prefault) in do_memset_gettimeofday() argument
146 alloc_mem(&dst, len); in do_memset_gettimeofday()
149 fn(dst, -1, len); in do_memset_gettimeofday()
153 fn(dst, i, len); in do_memset_gettimeofday()
159 return (double)((double)len / timeval2double(&tv_diff)); in do_memset_gettimeofday()
179 size_t len; in bench_mem_memset() local
[all …]
Dmem-memcpy.c126 static u64 do_memcpy_cycle(memcpy_t fn, size_t len, bool prefault) in do_memcpy_cycle() argument
132 alloc_mem(&src, &dst, len); in do_memcpy_cycle()
135 fn(dst, src, len); in do_memcpy_cycle()
139 fn(dst, src, len); in do_memcpy_cycle()
147 static double do_memcpy_gettimeofday(memcpy_t fn, size_t len, bool prefault) in do_memcpy_gettimeofday() argument
153 alloc_mem(&src, &dst, len); in do_memcpy_gettimeofday()
156 fn(dst, src, len); in do_memcpy_gettimeofday()
160 fn(dst, src, len); in do_memcpy_gettimeofday()
167 return (double)((double)len / timeval2double(&tv_diff)); in do_memcpy_gettimeofday()
187 size_t len; in bench_mem_memcpy() local
[all …]
/tools/perf/ui/tui/
Dutil.c75 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/testing/selftests/vm/
Dtranshuge-stress.c60 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/
Dbitmask.c248 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/net/
Dbpf_jit_disasm.c32 ssize_t len; in get_exec_path() local
40 len = readlink(path, tpath, size); in get_exec_path()
41 tpath[len] = 0; in get_exec_path()
46 static void get_asm_insns(uint8_t *image, size_t len, int opcodes) in get_asm_insns() argument
65 info.buffer_length = len; in get_asm_insns()
85 } while(count > 0 && pc < len); in get_asm_insns()
92 int ret, len = klogctl(10, NULL, 0); in get_klog_buff() local
93 char *buff = malloc(len); in get_klog_buff()
96 ret = klogctl(3, buff, len); in get_klog_buff()
172 int len, klen, opcodes = 0; in main() local
[all …]
/tools/perf/ui/
Dhist.c19 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/
Dsysfs.c64 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/lguest/
Dlguest.c215 void *dest, unsigned len) in iov_consume() argument
222 used = iov[i].iov_len < len ? iov[i].iov_len : len; in iov_consume()
229 len -= used; in iov_consume()
231 if (len != 0) in iov_consume()
328 static void map_at(int fd, void *addr, unsigned long offset, unsigned long len) in map_at() argument
341 if (mmap(addr, len, PROT_READ|PROT_WRITE, in map_at()
346 r = pread(fd, addr, len, offset); in map_at()
347 if (r != len) in map_at()
348 err(1, "Reading offset %lu len %lu gave %zi", offset, len, r); in map_at()
495 unsigned long len; in load_initrd() local
[all …]
/tools/perf/tests/
Dcode-reading.c37 size_t *len) in read_objdump_line() argument
49 while (*len) { in read_objdump_line()
70 *len -= 1; in read_objdump_line()
74 static int read_objdump_output(FILE *f, void **buf, size_t *len) in read_objdump_output() argument
90 read_objdump_line(line, ret, buf, len); in read_objdump_output()
99 size_t len) in read_via_objdump() argument
107 ret = snprintf(cmd, sizeof(cmd), fmt, "objdump", addr, addr + len, in read_via_objdump()
123 ret = read_objdump_output(f, &buf, &len); in read_via_objdump()
124 if (len) { in read_via_objdump()
127 ret = len; in read_via_objdump()
[all …]
/tools/power/cpupower/bench/
Dparse.c67 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/memfd/
Dfuse_mnt.c80 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/
Dbuiltin-help.c177 size_t len = strlen(name); in add_man_viewer() local
181 *p = zalloc(sizeof(**p) + len + 1); in add_man_viewer()
182 strncpy((*p)->name, name, len); 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()
[all …]
/tools/perf/scripts/python/
Dnetdev-times.py91 for i in range(len(irq_list)):
102 for i in range(len(irq_list)):
108 for j in range(len(irq_event_list)):
119 for i in range(len(event_list)):
124 if i == len(event_list) - 1:
156 for i in range(len(sys.argv)):
177 for i in range(len(all_event_list)):
208 for i in range(len(receive_hunk_list)):
214 for i in range(len(tx_free_list)):
220 (len(tx_queue_list), of_count_tx_queue_list)
[all …]

12345