Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 25 of 159) sorted by relevance

1234567

/tools/perf/util/intel-pt-decoder/
Dintel-pt-pkt-decoder.c74 static int intel_pt_get_long_tnt(const unsigned char *buf, size_t len, in intel_pt_get_long_tnt() argument
83 payload = le64_to_cpu(*(uint64_t *)buf); 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
106 memcpy_le64(&payload, buf + 2, 6); 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
126 packet->payload = buf[2]; 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
143 memcpy_le64(&packet->payload, buf + 2, count); 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
163 if (buf[i] != 2 || buf[i + 1] != 0x82) in intel_pt_get_psb()
[all …]
/tools/perf/util/
Dtrace-event-read.c45 static int __do_read(int fd, void *buf, int size) in __do_read() argument
50 int ret = read(fd, buf, size); in __do_read()
56 int retw = write(STDOUT_FILENO, buf, ret); in __do_read()
65 buf += ret; in __do_read()
90 char buf[BUFSIZ]; in skip() local
95 do_read(buf, r); in skip()
120 char buf[BUFSIZ]; in read_string() local
147 buf[size++] = c; in read_string()
157 memcpy(str, buf, size); in read_string()
188 char *buf; in read_ftrace_printk() local
[all …]
Dprobe-file.c74 char buf[PATH_MAX]; in open_probe_events() local
78 ret = e_snprintf(buf, PATH_MAX, "%s/%s%s", in open_probe_events()
81 pr_debug("Opening %s write=%d\n", buf, readwrite); in open_probe_events()
83 ret = open(buf, O_RDWR | O_APPEND, 0); in open_probe_events()
85 ret = open(buf, O_RDONLY, 0); in open_probe_events()
137 char buf[MAX_CMDLEN]; in probe_file__get_rawlist() local
148 p = fgets(buf, MAX_CMDLEN, fp); in probe_file__get_rawlist()
155 ret = strlist__add(sl, buf); in probe_file__get_rawlist()
169 char buf[128]; in __probe_file__get_namelist() local
185 ret = e_snprintf(buf, 128, "%s:%s", tev.group, in __probe_file__get_namelist()
[all …]
Dbpf-loader.h35 int err, char *buf, size_t size);
45 char *buf, size_t size);
49 char *buf, size_t size);
83 __bpf_strerror(char *buf, size_t size) in __bpf_strerror() argument
87 strncpy(buf, in __bpf_strerror()
90 buf[size - 1] = '\0'; in __bpf_strerror()
98 char *buf, size_t size) in bpf__strerror_prepare_load() argument
100 return __bpf_strerror(buf, size); in bpf__strerror_prepare_load()
106 char *buf, size_t size) in bpf__strerror_probe() argument
108 return __bpf_strerror(buf, size); in bpf__strerror_probe()
[all …]
Dtarget.c71 char buf[1024]; in target__parse_uid() local
79 getpwnam_r(str, &pwd, buf, sizeof(buf), &result); in target__parse_uid()
91 getpwuid_r(uid, &pwd, buf, sizeof(buf), &result); in target__parse_uid()
116 char *buf, size_t buflen) in target__strerror() argument
124 const char *err = strerror_r(errnum, buf, buflen); in target__strerror()
126 if (err != buf) in target__strerror()
127 scnprintf(buf, buflen, "%s", err); in target__strerror()
141 snprintf(buf, buflen, "%s", msg); in target__strerror()
146 snprintf(buf, buflen, msg, target->uid_str); in target__strerror()
Dbpf-loader.c346 bpf_loader_strerror(int err, char *buf, size_t size) in bpf_loader_strerror() argument
351 if (!buf || !size) in bpf_loader_strerror()
357 return libbpf_strerror(err, buf, size); in bpf_loader_strerror()
361 snprintf(buf, size, "%s", msg); in bpf_loader_strerror()
362 buf[size - 1] = '\0'; in bpf_loader_strerror()
367 snprintf(buf, size, "Unknown bpf loader error %d", err); in bpf_loader_strerror()
369 snprintf(buf, size, "%s", in bpf_loader_strerror()
372 buf[size - 1] = '\0'; in bpf_loader_strerror()
376 #define bpf__strerror_head(err, buf, size) \ argument
386 scnprintf(buf, size, "%s", emsg);\
[all …]
Dsymbol-minimal.c89 void *buf; in filename__read_build_id() local
122 buf = malloc(buf_size); in filename__read_build_id()
123 if (buf == NULL) in filename__read_build_id()
127 if (fread(buf, buf_size, 1, fp) != 1) in filename__read_build_id()
130 for (i = 0, phdr = buf; i < ehdr.e_phnum; i++, phdr++) { in filename__read_build_id()
145 tmp = realloc(buf, buf_size); in filename__read_build_id()
149 buf = tmp; in filename__read_build_id()
151 if (fread(buf, buf_size, 1, fp) != 1) in filename__read_build_id()
154 ret = read_build_id(buf, buf_size, bf, size, need_swap); in filename__read_build_id()
173 buf = malloc(buf_size); in filename__read_build_id()
[all …]
Dstrbuf.c23 sb->buf = strbuf_slopbuf; in strbuf_init()
31 zfree(&sb->buf); in strbuf_release()
38 char *res = sb->alloc ? sb->buf : NULL; in strbuf_detach()
50 sb->buf = NULL; in strbuf_grow()
51 ALLOC_GROW(sb->buf, sb->len + extra + 1, sb->alloc); in strbuf_grow()
66 memmove(sb->buf + pos + dlen, in strbuf_splice()
67 sb->buf + pos + len, in strbuf_splice()
69 memcpy(sb->buf + pos, data, dlen); in strbuf_splice()
81 memcpy(sb->buf + sb->len, data, len); in strbuf_add()
94 len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap); in strbuf_addv()
[all …]
/tools/usb/usbip/libsrc/
Dnames.c311 char buf[512], *cp; in parse() local
320 while (fgets(buf, sizeof(buf), f)) { in parse()
323 cp = strchr(buf, '\r'); in parse()
326 cp = strchr(buf, '\n'); in parse()
329 if (buf[0] == '#' || !buf[0]) in parse()
331 cp = buf; in parse()
332 if (buf[0] == 'P' && buf[1] == 'H' && buf[2] == 'Y' && in parse()
333 buf[3] == 'S' && buf[4] == 'D' && in parse()
334 buf[5] == 'E' && buf[6] == 'S' && /*isspace(buf[7])*/ in parse()
335 buf[7] == ' ') { in parse()
[all …]
/tools/perf/arch/arm64/tests/
Ddwarf-unwind.c17 u64 stack_size, *buf; in sample_ustack() local
19 buf = malloc(STACK_SIZE); in sample_ustack()
20 if (!buf) { in sample_ustack()
30 free(buf); in sample_ustack()
37 memcpy(buf, (void *) sp, stack_size); in sample_ustack()
38 stack->data = (char *) buf; in sample_ustack()
47 u64 *buf; in test__arch_unwind_sample() local
49 buf = calloc(1, sizeof(u64) * PERF_REGS_MAX); in test__arch_unwind_sample()
50 if (!buf) { in test__arch_unwind_sample()
55 perf_regs_load(buf); in test__arch_unwind_sample()
[all …]
/tools/perf/arch/arm/tests/
Ddwarf-unwind.c17 u64 stack_size, *buf; in sample_ustack() local
19 buf = malloc(STACK_SIZE); in sample_ustack()
20 if (!buf) { in sample_ustack()
30 free(buf); in sample_ustack()
37 memcpy(buf, (void *) sp, stack_size); in sample_ustack()
38 stack->data = (char *) buf; in sample_ustack()
47 u64 *buf; in test__arch_unwind_sample() local
49 buf = calloc(1, sizeof(u64) * PERF_REGS_MAX); in test__arch_unwind_sample()
50 if (!buf) { in test__arch_unwind_sample()
55 perf_regs_load(buf); in test__arch_unwind_sample()
[all …]
/tools/perf/arch/x86/tests/
Ddwarf-unwind.c18 u64 stack_size, *buf; in sample_ustack() local
20 buf = malloc(STACK_SIZE); in sample_ustack()
21 if (!buf) { in sample_ustack()
31 free(buf); in sample_ustack()
38 memcpy(buf, (void *) sp, stack_size); in sample_ustack()
39 stack->data = (char *) buf; in sample_ustack()
48 u64 *buf; in test__arch_unwind_sample() local
50 buf = malloc(sizeof(u64) * PERF_REGS_MAX); in test__arch_unwind_sample()
51 if (!buf) { in test__arch_unwind_sample()
56 perf_regs_load(buf); in test__arch_unwind_sample()
[all …]
/tools/perf/arch/
Dcommon.c65 char buf[PATH_MAX]; in lookup_path() local
77 scnprintf(buf, sizeof(buf), "%s/%s", path, name); in lookup_path()
78 if (access(buf, F_OK) == 0) { in lookup_path()
91 char buf[PATH_MAX]; in lookup_triplets() local
94 scnprintf(buf, sizeof(buf), "%s%s", triplets[i], name); in lookup_triplets()
95 if (lookup_path(buf)) in lookup_triplets()
138 char *buf = NULL; in perf_env__lookup_binutils_path() local
154 if (asprintf(&buf, "%s%s", cross_env, name) < 0) in perf_env__lookup_binutils_path()
156 if (buf[0] == '/') { in perf_env__lookup_binutils_path()
157 if (access(buf, F_OK) == 0) in perf_env__lookup_binutils_path()
[all …]
/tools/testing/selftests/powerpc/dscr/
Ddscr.h80 char buf[16]; in get_default_dscr() local
90 memset(buf, 0, sizeof(buf)); in get_default_dscr()
92 ret = read(fd, buf, sizeof(buf)); in get_default_dscr()
97 sscanf(buf, "%lx", &val); in get_default_dscr()
105 char buf[16]; in set_default_dscr() local
114 sprintf(buf, "%lx\n", val); in set_default_dscr()
115 ret = write(fd, buf, strlen(buf)); in set_default_dscr()
Ddscr_sysfs_test.c18 char buf[10]; in check_cpu_dscr_default() local
27 rc = read(fd, buf, sizeof(buf)); in check_cpu_dscr_default()
34 buf[rc] = '\0'; in check_cpu_dscr_default()
35 if (strtol(buf, NULL, 16) != val) { in check_cpu_dscr_default()
37 val, strtol(buf, NULL, 16)); in check_cpu_dscr_default()
/tools/perf/tests/
Ddso-data.c21 unsigned char *buf; in test_file() local
32 buf = malloc(size); in test_file()
33 if (!buf) { in test_file()
39 buf[i] = (unsigned char) ((int) i % 10); in test_file()
41 if (size != write(fd, buf, size)) in test_file()
44 free(buf); in test_file()
133 u8 buf[10]; in test__dso_data() local
135 memset(buf, 0, 10); in test__dso_data()
137 buf, 10); in test__dso_data()
140 TEST_ASSERT_VAL("Wrong data", !memcmp(buf, data->data, 10)); in test__dso_data()
[all …]
/tools/testing/selftests/timers/
Dclocksource-switch.c55 char buf[512]; in get_clocksources() local
60 size = read(fd, buf, 512); in get_clocksources()
67 head = buf; in get_clocksources()
69 while (head - buf < size) { in get_clocksources()
86 int get_cur_clocksource(char *buf, size_t size) in get_cur_clocksource() argument
92 size = read(fd, buf, size); in get_cur_clocksource()
120 char buf[255]; in run_tests() local
122 sprintf(buf, "./inconsistency-check -t %i", secs); in run_tests()
123 ret = system(buf); in run_tests()
/tools/testing/selftests/efivarfs/
Dopen-unlink.c70 char buf[5]; in main() local
84 *(uint32_t *)buf = 0x7; in main()
85 buf[4] = 0; in main()
94 rc = write(fd, buf, sizeof(buf)); in main()
95 if (rc != sizeof(buf)) { in main()
125 rc = read(fd, buf, sizeof(buf)); in main()
/tools/vm/
Dpage_owner_sort.c31 int read_block(char *buf, int buf_size, FILE *fin) in read_block() argument
33 char *curr = buf, *const buf_end = buf + buf_size; in read_block()
37 return curr - buf; in read_block()
58 static void add_list(char *buf, int len) in add_list() argument
62 memcmp(buf, list[list_size-1].txt, len) == 0) { in add_list()
73 memcpy(list[list_size].txt, buf, len); in add_list()
87 char buf[BUF_SIZE]; in main() local
112 ret = read_block(buf, BUF_SIZE, fin); in main()
116 add_list(buf, ret); in main()
Dpage-types.c248 uint64_t *buf, in do_u64_read() argument
257 bytes = pread(fd, buf, count * 8, (off_t)index * 8); in do_u64_read()
268 static unsigned long kpageflags_read(uint64_t *buf, in kpageflags_read() argument
272 return do_u64_read(kpageflags_fd, PROC_KPAGEFLAGS, buf, index, pages); in kpageflags_read()
275 static unsigned long pagemap_read(uint64_t *buf, in pagemap_read() argument
279 return do_u64_read(pagemap_fd, "/proc/pid/pagemap", buf, index, pages); in pagemap_read()
301 static char buf[65]; in page_flag_name() local
312 buf[j++] = present ? page_flag_names[i][0] : '_'; in page_flag_name()
315 return buf; in page_flag_name()
320 static char buf[1024]; in page_flag_longname() local
[all …]
/tools/lib/api/fs/
Dtracing_path.c88 static int strerror_open(int err, char *buf, size_t size, const char *filename) in strerror_open() argument
101 snprintf(buf, size, in strerror_open()
107 snprintf(buf, size, "%s", in strerror_open()
114 snprintf(buf, size, in strerror_open()
121 snprintf(buf, size, "%s", strerror_r(err, sbuf, sizeof(sbuf))); in strerror_open()
128 int tracing_path__strerror_open_tp(int err, char *buf, size_t size, const char *sys, const char *na… in tracing_path__strerror_open_tp() argument
134 return strerror_open(err, buf, size, path); in tracing_path__strerror_open_tp()
/tools/virtio/virtio-trace/
Dtrace-agent-ctl.c94 char buf[HOST_MSG_SIZE]; in rw_ctl_loop() local
108 rlen = read(ctl_fd, buf, sizeof(buf)); in rw_ctl_loop()
114 if (rlen == 2 && buf[0] == '1') { in rw_ctl_loop()
122 } else if (rlen == 2 && buf[0] == '0') { in rw_ctl_loop()
130 pr_info("Invalid host notification: %s\n", buf); in rw_ctl_loop()
/tools/perf/ui/browsers/
Dscripts.c49 char *buf, *names[SCRIPT_MAX_NO], *paths[SCRIPT_MAX_NO]; in list_scripts() local
53 buf = malloc(SCRIPT_MAX_NO * (SCRIPT_NAMELEN + SCRIPT_FULLPATH_LEN)); in list_scripts()
54 if (!buf) in list_scripts()
58 names[i] = buf + i * (SCRIPT_NAMELEN + SCRIPT_FULLPATH_LEN); in list_scripts()
71 free(buf); in list_scripts()
115 void *buf; in script_browse() local
130 buf = zalloc((sizeof(*sline)) * MAX_LINES); in script_browse()
131 if (!buf) in script_browse()
133 sline = buf; in script_browse()
185 free(buf); in script_browse()
/tools/testing/selftests/net/
Dpsock_lib.h109 char buf[DATA_LEN], rbuf[DATA_LEN]; in pair_udp_send_char() local
111 memset(buf, payload, sizeof(buf)); in pair_udp_send_char()
114 if (write(fds[0], buf, sizeof(buf)) != sizeof(buf)) { in pair_udp_send_char()
122 if (memcmp(buf, rbuf, sizeof(buf))) { in pair_udp_send_char()
/tools/testing/selftests/memfd/
Dfuse_mnt.c45 void *buf, in memfd_readdir() argument
53 filler(buf, ".", NULL, 0); in memfd_readdir()
54 filler(buf, "..", NULL, 0); in memfd_readdir()
55 filler(buf, memfd_path + 1, NULL, 0); in memfd_readdir()
75 char *buf, in memfd_read() argument
92 memcpy(buf, memfd_content + offset, size); in memfd_read()

1234567