Home
last modified time | relevance | path

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

12345678910>>...14

/tools/perf/util/
Dstrbuf.c22 sb->alloc = sb->len = 0; in strbuf_init()
41 *sz = sb->len; in strbuf_detach()
49 size_t nr = sb->len + extra + 1; in strbuf_grow()
54 if (nr <= sb->len) in strbuf_grow()
79 sb->buf[sb->len++] = c; in strbuf_addch()
80 sb->buf[sb->len] = '\0'; in strbuf_addch()
84 int strbuf_add(struct strbuf *sb, const void *data, size_t len) in strbuf_add() argument
86 int ret = strbuf_grow(sb, len); in strbuf_add()
90 memcpy(sb->buf + sb->len, data, len); in strbuf_add()
91 return strbuf_setlen(sb, sb->len + len); in strbuf_add()
[all …]
Darm-spe-pkt-decoder.c85 static int arm_spe_get_payload(const unsigned char *buf, size_t len, in arm_spe_get_payload() argument
90 if (len < 1 + payload_len) in arm_spe_get_payload()
112 static int arm_spe_get_alignment(const unsigned char *buf, size_t len, in arm_spe_get_alignment() argument
117 if (len < alignment) in arm_spe_get_alignment()
130 static int arm_spe_get_timestamp(const unsigned char *buf, size_t len, in arm_spe_get_timestamp() argument
134 return arm_spe_get_payload(buf, len, packet); in arm_spe_get_timestamp()
137 static int arm_spe_get_events(const unsigned char *buf, size_t len, in arm_spe_get_events() argument
140 int ret = arm_spe_get_payload(buf, len, packet); in arm_spe_get_events()
154 static int arm_spe_get_data_source(const unsigned char *buf, size_t len, in arm_spe_get_data_source() argument
158 return arm_spe_get_payload(buf, len, packet); in arm_spe_get_data_source()
[all …]
Dstrbuf.h52 size_t len; member
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
76 assert(len < sb->alloc); in strbuf_setlen()
77 sb->len = len; in strbuf_setlen()
78 sb->buf[len] = '\0'; in strbuf_setlen()
Dstrfilter.c251 int len; in strfilter_node__sprint_pt() local
256 len = strfilter_node__sprint(node, buf); in strfilter_node__sprint_pt()
257 if (len < 0) in strfilter_node__sprint_pt()
258 return len; in strfilter_node__sprint_pt()
260 *(buf + len) = ')'; in strfilter_node__sprint_pt()
261 return len + pt; in strfilter_node__sprint_pt()
266 int len = 0, rlen; in strfilter_node__sprint() local
274 len = strfilter_node__sprint_pt(node->l, buf); in strfilter_node__sprint()
275 if (len < 0) in strfilter_node__sprint()
276 return len; in strfilter_node__sprint()
[all …]
Dprint_binary.c6 int binary__fprintf(unsigned char *data, size_t len, in binary__fprintf() argument
20 for (i = 0; i < len; i++) { in binary__fprintf()
28 if (((i & mask) == mask) || i == len - 1) { in binary__fprintf()
44 int is_printable_array(char *p, unsigned int len) in is_printable_array() argument
48 if (!p || !len || p[len - 1] != 0) in is_printable_array()
51 len--; in is_printable_array()
53 for (i = 0; i < len; i++) { in is_printable_array()
/tools/lib/traceevent/
Dtrace-seq.c45 s->len = 0; in trace_seq_init()
64 s->len = 0; in trace_seq_reset()
116 int len; in trace_seq_printf() local
122 len = (s->buffer_size - 1) - s->len; in trace_seq_printf()
125 ret = vsnprintf(s->buffer + s->len, len, fmt, ap); in trace_seq_printf()
128 if (ret >= len) { in trace_seq_printf()
134 s->len += ret; in trace_seq_printf()
157 int len; in trace_seq_vprintf() local
163 len = (s->buffer_size - 1) - s->len; in trace_seq_vprintf()
165 ret = vsnprintf(s->buffer + s->len, len, fmt, args); in trace_seq_vprintf()
[all …]
/tools/testing/selftests/powerpc/ptrace/
Dptrace-hwbreak.c111 static void write_var(int len) in write_var() argument
118 switch (len) { in write_var()
138 static void read_var(int len) in read_var() argument
145 switch (len) { in read_var()
167 int len, ret; in trigger_tests() local
179 for (len = 1; len <= sizeof(long); len <<= 1) in trigger_tests()
180 write_var(len); in trigger_tests()
183 for (len = 1; len <= sizeof(long); len <<= 1) in trigger_tests()
184 read_var(len); in trigger_tests()
189 for (len = 1; len <= sizeof(long); len <<= 1) in trigger_tests()
[all …]
/tools/perf/util/intel-pt-decoder/
Dintel-pt-pkt-decoder.c76 static int intel_pt_get_long_tnt(const unsigned char *buf, size_t len, in intel_pt_get_long_tnt() argument
82 if (len < 8) in intel_pt_get_long_tnt()
99 static int intel_pt_get_pip(const unsigned char *buf, size_t len, in intel_pt_get_pip() argument
104 if (len < 8) in intel_pt_get_pip()
122 static int intel_pt_get_cbr(const unsigned char *buf, size_t len, in intel_pt_get_cbr() argument
125 if (len < 4) in intel_pt_get_cbr()
132 static int intel_pt_get_vmcs(const unsigned char *buf, size_t len, in intel_pt_get_vmcs() argument
140 if (len < count + 2) in intel_pt_get_vmcs()
156 static int intel_pt_get_psb(const unsigned char *buf, size_t len, in intel_pt_get_psb() argument
161 if (len < 16) in intel_pt_get_psb()
[all …]
/tools/testing/selftests/proc/
Dproc-uptime-002.c33 static inline int sys_sched_getaffinity(pid_t pid, unsigned int len, unsigned long *m) in sys_sched_getaffinity() argument
35 return syscall(SYS_sched_getaffinity, pid, len, m); in sys_sched_getaffinity()
38 static inline int sys_sched_setaffinity(pid_t pid, unsigned int len, unsigned long *m) in sys_sched_setaffinity() argument
40 return syscall(SYS_sched_setaffinity, pid, len, m); in sys_sched_setaffinity()
45 unsigned int len; in main() local
53 len = 0; in main()
55 len += sizeof(unsigned long); in main()
57 m = malloc(len); in main()
58 } while (sys_sched_getaffinity(0, len, m) == -EINVAL); in main()
64 for (cpu = 0; cpu < len * 8; cpu++) { in main()
[all …]
/tools/power/acpi/tools/acpidbg/
Dacpidbg.c126 int len; in acpi_aml_read() local
129 len = circ_space_to_end(crc); in acpi_aml_read()
130 len = read(fd, p, len); in acpi_aml_read()
131 if (len < 0) in acpi_aml_read()
133 else if (len > 0) in acpi_aml_read()
134 crc->head = (crc->head + len) & (ACPI_AML_BUF_SIZE - 1); in acpi_aml_read()
135 return len; in acpi_aml_read()
141 int len; in acpi_aml_read_batch_cmd() local
145 len = circ_space_to_end(crc); in acpi_aml_read_batch_cmd()
146 if (len > remained) { in acpi_aml_read_batch_cmd()
[all …]
/tools/spi/
Dspidev_fdx.c18 static void do_read(int fd, int len) in do_read() argument
24 if (len < 2) in do_read()
25 len = 2; in do_read()
26 else if (len > sizeof(buf)) in do_read()
27 len = sizeof(buf); in do_read()
30 status = read(fd, buf, len); in do_read()
35 if (status != len) { in do_read()
40 printf("read(%2d, %2d): %02x %02x,", len, status, in do_read()
49 static void do_msg(int fd, int len) in do_msg() argument
58 if (len > sizeof buf) in do_msg()
[all …]
/tools/testing/selftests/powerpc/copyloops/
Dvalidate.c18 unsigned long dst_off, unsigned long len, void *redzone, in do_one() argument
30 memcpy(srcp, fill, len); in do_one()
32 ret = COPY_LOOP(dstp, srcp, len); in do_one()
34 printf("(%p,%p,%ld) returned %ld\n", dstp, srcp, len, ret); in do_one()
38 if (memcmp(dstp, srcp, len)) { in do_one()
39 printf("(%p,%p,%ld) miscompare\n", dstp, srcp, len); in do_one()
41 for (i = 0; i < len; i++) in do_one()
44 for (i = 0; i < len; i++) in do_one()
52 dstp, srcp, len); in do_one()
56 if (memcmp(dstp+len, redzone, dst+BUFLEN-(dstp+len))) { in do_one()
[all …]
/tools/testing/selftests/bpf/prog_tests/
Dtask_fd_query_rawtp.c8 __u32 len, prog_id, fd_type; in test_task_fd_query_rawtp() local
23 len = sizeof(buf); in test_task_fd_query_rawtp()
24 err = bpf_task_fd_query(getpid(), efd, 0, buf, &len, &prog_id, in test_task_fd_query_rawtp()
37 len = 0; in test_task_fd_query_rawtp()
38 err = bpf_task_fd_query(getpid(), efd, 0, buf, &len, &prog_id, in test_task_fd_query_rawtp()
44 len == strlen("sys_enter"); in test_task_fd_query_rawtp()
45 if (CHECK(!err, "check_results", "fd_type %d len %u\n", fd_type, len)) in test_task_fd_query_rawtp()
49 len = sizeof(buf); in test_task_fd_query_rawtp()
50 err = bpf_task_fd_query(getpid(), efd, 0, 0, &len, &prog_id, in test_task_fd_query_rawtp()
56 len == strlen("sys_enter"); in test_task_fd_query_rawtp()
[all …]
/tools/lib/symbol/
Dkallsyms.c47 int line_len, len; in kallsyms__parse() local
57 len = hex2u64(line, &start); in kallsyms__parse()
60 if (!len) in kallsyms__parse()
63 len++; in kallsyms__parse()
64 if (len + 2 >= line_len) in kallsyms__parse()
67 symbol_type = line[len]; in kallsyms__parse()
68 len += 2; in kallsyms__parse()
69 symbol_name = line + len; in kallsyms__parse()
70 len = line_len - len; in kallsyms__parse()
72 if (len >= KSYM_NAME_LEN) { in kallsyms__parse()
/tools/testing/selftests/breakpoints/
Dbreakpoint_test.c53 static void toggle_breakpoint(int n, int type, int len, in toggle_breakpoint() argument
73 switch (len) { in toggle_breakpoint()
147 static void write_var(int len) in write_var() argument
153 switch (len) { in write_var()
175 static void read_var(int len) in read_var() argument
181 switch (len) { in read_var()
205 int len, local, global, i; in trigger_tests() local
232 for (len = 1; len <= sizeof(long); len <<= 1) { in trigger_tests()
237 write_var(len); in trigger_tests()
243 for (len = 1; len <= sizeof(long); len <<= 1) { in trigger_tests()
[all …]
/tools/include/uapi/linux/
Dnetlink.h90 #define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) ) argument
92 #define NLMSG_LENGTH(len) ((len) + NLMSG_HDRLEN) argument
93 #define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len)) argument
95 #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \ argument
97 #define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \ argument
99 (nlh)->nlmsg_len <= (len))
100 #define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len))) argument
231 #define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1)) argument
/tools/testing/selftests/cgroup/
Dcgroup_util.c21 ssize_t len; in read_text() local
28 len = read(fd, buf, max_len - 1); in read_text()
29 if (len < 0) in read_text()
32 buf[len] = 0; in read_text()
35 return len; in read_text()
38 static ssize_t write_text(const char *path, char *buf, ssize_t len) in write_text() argument
46 len = write(fd, buf, len); in write_text()
47 if (len < 0) { in write_text()
49 return len; in write_text()
54 return len; in write_text()
[all …]
/tools/lib/traceevent/plugins/
Dplugin_scsi.c157 scsi_trace_rw6(struct trace_seq *p, unsigned char *cdb, int len) in scsi_trace_rw6() argument
159 const char *ret = p->buffer + p->len; in scsi_trace_rw6()
174 scsi_trace_rw10(struct trace_seq *p, unsigned char *cdb, int len) in scsi_trace_rw10() argument
176 const char *ret = p->buffer + p->len; in scsi_trace_rw10()
198 scsi_trace_rw12(struct trace_seq *p, unsigned char *cdb, int len) in scsi_trace_rw12() argument
200 const char *ret = p->buffer + p->len; in scsi_trace_rw12()
220 scsi_trace_rw16(struct trace_seq *p, unsigned char *cdb, int len) in scsi_trace_rw16() argument
222 const char *ret = p->buffer + p->len; in scsi_trace_rw16()
250 scsi_trace_rw32(struct trace_seq *p, unsigned char *cdb, int len) in scsi_trace_rw32() argument
252 const char *ret = p->buffer + p->len, *cmd; in scsi_trace_rw32()
[all …]
/tools/perf/examples/bpf/
Daugmented_raw_syscalls.c90 static inline int augmented__output(void *ctx, struct augmented_args_payload *args, int len) in augmented__output() argument
93 return perf_event_output(ctx, &__augmented_syscalls__, BPF_F_CURRENT_CPU, args, len); in augmented__output()
141 unsigned int len = sizeof(augmented_args->args); in sys_enter_connect() local
151 return augmented__output(args, augmented_args, len + socklen); in sys_enter_connect()
160 unsigned int len = sizeof(augmented_args->args); in sys_enter_sendto() local
170 return augmented__output(args, augmented_args, len + socklen); in sys_enter_sendto()
178 unsigned int len = sizeof(augmented_args->args); in sys_enter_open() local
183len += augmented_arg__read_str(&augmented_args->arg, filename_arg, sizeof(augmented_args->arg.valu… in sys_enter_open()
185 return augmented__output(args, augmented_args, len); in sys_enter_open()
193 unsigned int len = sizeof(augmented_args->args); in sys_enter_openat() local
[all …]
/tools/perf/ui/tui/
Dutil.c74 int x, y, len, key; in ui_browser__input_window() local
85 len = sep - t; in ui_browser__input_window()
86 if (max_len < len) in ui_browser__input_window()
87 max_len = len; in ui_browser__input_window()
113 len = 5; in ui_browser__input_window()
114 while (len--) { in ui_browser__input_window()
115 SLsmg_gotorc(y + len - 1, x); in ui_browser__input_window()
127 len = 0; in ui_browser__input_window()
133 if (len == 0) { in ui_browser__input_window()
137 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/bpf/
Dbpf_jit_disasm.c38 ssize_t len; in get_exec_path() local
46 len = readlink(path, tpath, size); in get_exec_path()
47 tpath[len] = 0; in get_exec_path()
52 static void get_asm_insns(uint8_t *image, size_t len, int opcodes) in get_asm_insns() argument
71 info.buffer_length = len; in get_asm_insns()
98 } while(count > 0 && pc < len); in get_asm_insns()
105 int ret, len; in get_klog_buff() local
108 len = klogctl(CMD_ACTION_SIZE_BUFFER, NULL, 0); in get_klog_buff()
109 if (len < 0) in get_klog_buff()
112 buff = malloc(len); in get_klog_buff()
[all …]
/tools/perf/bench/
Dmem-memcpy-x86-64-lib.c9 unsigned long mcsafe_handle_tail(char *to, char *from, unsigned len);
11 unsigned long mcsafe_handle_tail(char *to, char *from, unsigned len) in mcsafe_handle_tail() argument
13 for (; len; --len, to++, from++) { in mcsafe_handle_tail()
23 return len; in mcsafe_handle_tail()
/tools/testing/selftests/tpm2/
Dtpm2.py258 fmt = '>I H%us B H%us' % (len(self.nonce), len(self.hmac))
259 return struct.pack(fmt, self.session_handle, len(self.nonce),
260 self.nonce, self.session_attributes, len(self.hmac),
264 fmt = '>I H%us B H%us' % (len(self.nonce), len(self.hmac))
276 fmt = '>H%us H%us' % (len(self.user_auth), len(self.data))
277 return struct.pack(fmt, len(self.user_auth), self.user_auth,
278 len(self.data), self.data)
281 fmt = '>H%us H%us' % (len(self.user_auth), len(self.data))
297 (len(self.auth_policy), len(self.parameters), len(self.unique))
313 len(self.auth_policy),
[all …]
/tools/testing/radix-tree/
Dbitmap.c5 void bitmap_clear(unsigned long *map, unsigned int start, int len) in bitmap_clear() argument
8 const unsigned int size = start + len; in bitmap_clear()
12 while (len - bits_to_clear >= 0) { in bitmap_clear()
14 len -= bits_to_clear; in bitmap_clear()
19 if (len) { in bitmap_clear()

12345678910>>...14