Home
last modified time | relevance | path

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

12345678910>>...30

/tools/testing/selftests/hid/
A Dhid_bpf.c178 memset(buf, 0, sizeof(buf)); in TEST_F()
185 memset(buf, 0, sizeof(buf)); in TEST_F()
194 memset(buf, 0, sizeof(buf)); in TEST_F()
222 memset(buf, 0, sizeof(buf)); in TEST_F()
229 memset(buf, 0, sizeof(buf)); in TEST_F()
235 memset(buf, 0, sizeof(buf)); in TEST_F()
286 memset(buf, 0, sizeof(buf)); in TEST_F()
310 memset(buf, 0, sizeof(buf)); in TEST_F()
316 memset(buf, 0, sizeof(buf)); in TEST_F()
329 memset(buf, 0, sizeof(buf)); in TEST_F()
[all …]
A Dhidraw.c64 buf[0] = 1; in TEST_F()
65 buf[1] = 42; in TEST_F()
69 memset(buf, 0, sizeof(buf)); in TEST_F()
70 err = read(self->hidraw_fd, buf, sizeof(buf)); in TEST_F()
86 buf[0] = 1; in TEST_F()
91 memset(buf, 0, sizeof(buf)); in TEST_F()
92 err = read(self->hidraw_fd, buf, sizeof(buf)); in TEST_F()
107 memset(buf, 0, sizeof(buf)); in TEST_F()
108 err = read(self->hidraw_fd, buf, sizeof(buf)); in TEST_F()
155 memset(buf, 0, sizeof(buf)); in TEST_F()
[all …]
/tools/testing/selftests/bpf/prog_tests/
A Dxdp_adjust_frags.c12 __u8 *buf; in test_xdp_update_frags() local
26 buf = malloc(128); in test_xdp_update_frags()
30 memset(buf, 0, 128); in test_xdp_update_frags()
31 offset = (__u32 *)buf; in test_xdp_update_frags()
36 topts.data_in = buf; in test_xdp_update_frags()
37 topts.data_out = buf; in test_xdp_update_frags()
49 free(buf); in test_xdp_update_frags()
51 buf = malloc(9000); in test_xdp_update_frags()
61 topts.data_in = buf; in test_xdp_update_frags()
102 free(buf); in test_xdp_update_frags()
[all …]
A Dsockopt_multi.c13 __u8 buf; in run_getsockopt_test() local
18 buf = 0x80; in run_getsockopt_test()
25 buf = 0x00; in run_getsockopt_test()
49 buf = 0x00; in run_getsockopt_test()
74 buf = 0x00; in run_getsockopt_test()
94 buf = 0x40; in run_getsockopt_test()
101 buf = 0x00; in run_getsockopt_test()
117 buf = 0x00; in run_getsockopt_test()
130 buf = 0x90; in run_getsockopt_test()
137 buf = 0x00; in run_getsockopt_test()
[all …]
A Dxdp_adjust_tail.c11 char buf[128]; in test_xdp_adjust_tail_shrink() local
15 .data_out = buf, in test_xdp_adjust_tail_shrink()
109 memset(buf, 1, sizeof(buf)); in test_xdp_adjust_tail_grow2()
128 memset(buf, 2, sizeof(buf)); in test_xdp_adjust_tail_grow2()
156 __u8 *buf; in test_xdp_adjust_frags_tail_shrink() local
191 buf[0] = 1; in test_xdp_adjust_frags_tail_shrink()
211 free(buf); in test_xdp_adjust_frags_tail_shrink()
223 __u8 *buf; in test_xdp_adjust_frags_tail_grow_4k() local
282 free(buf); in test_xdp_adjust_frags_tail_grow_4k()
294 __u8 *buf; in test_xdp_adjust_frags_tail_grow_64k() local
[all …]
A Dsockopt_sk.c23 } buf = {}; in getsetsockopt() local
65 buf.u8[0] = 1; in getsetsockopt()
74 buf.u8[0] = 0x01; in getsetsockopt()
81 buf.u32 = 0x00; in getsetsockopt()
122 buf.u32 = 0x01010101; in getsetsockopt()
129 buf.u32 = 0x00; in getsetsockopt()
139 buf.u32); in getsetsockopt()
162 buf.cc, "cubic"); in getsetsockopt()
167 memset(&buf, 0, sizeof(buf)); in getsetsockopt()
176 memset(&buf, 0, sizeof(buf)); in getsetsockopt()
[all …]
/tools/testing/selftests/bpf/progs/
A Dread_vsyscall.c25 char buf[8]; in do_probe_read() local
30 read_ret[0] = bpf_probe_read_kernel(buf, sizeof(buf), user_ptr); in do_probe_read()
31 read_ret[1] = bpf_probe_read_kernel_str(buf, sizeof(buf), user_ptr); in do_probe_read()
32 read_ret[2] = bpf_probe_read(buf, sizeof(buf), user_ptr); in do_probe_read()
33 read_ret[3] = bpf_probe_read_str(buf, sizeof(buf), user_ptr); in do_probe_read()
34 read_ret[4] = bpf_probe_read_user(buf, sizeof(buf), user_ptr); in do_probe_read()
35 read_ret[5] = bpf_probe_read_user_str(buf, sizeof(buf), user_ptr); in do_probe_read()
43 char buf[8]; in do_copy_from_user() local
48 read_ret[6] = bpf_copy_from_user(buf, sizeof(buf), user_ptr); in do_copy_from_user()
49 read_ret[7] = bpf_copy_from_user_task(buf, sizeof(buf), user_ptr, in do_copy_from_user()
[all …]
/tools/perf/util/arm-spe-decoder/
A Darm-spe-pkt-decoder.c56 buf += 1 + ext_hdr; in arm_spe_get_payload()
110 packet->index = arm_spe_payload_len(buf[0]); in arm_spe_get_events()
144 packet->index = SPE_HDR_EXTENDED_INDEX(buf[0], buf[1]); in arm_spe_get_counter()
157 packet->index = SPE_HDR_EXTENDED_INDEX(buf[0], buf[1]); in arm_spe_get_addr()
175 hdr = buf[0]; in arm_spe_do_get_packet()
204 hdr = buf[1]; in arm_spe_do_get_packet()
280 char *buf, size_t buf_len) in arm_spe_pkt_desc_event() argument
322 char *buf, size_t buf_len) in arm_spe_pkt_desc_op_type() argument
423 char *buf, size_t buf_len) in arm_spe_pkt_desc_addr() argument
465 char *buf, size_t buf_len) in arm_spe_pkt_desc_counter() argument
[all …]
/tools/perf/util/intel-pt-decoder/
A Dintel-pt-pkt-decoder.c155 if (buf[i] != 2 || buf[i + 1] != 0x82) in intel_pt_get_psb()
176 packet->payload = buf[2] | (buf[3] << 8); in intel_pt_get_tma()
177 packet->count = buf[5] | ((buf[6] & BIT(0)) << 8); in intel_pt_get_tma()
203 switch (buf[2]) { in intel_pt_get_3byte()
357 switch (buf[1]) { in intel_pt_get_ext()
434 byte = buf[offs++]; in intel_pt_get_cyc()
495 switch (buf[1] >> 5) { in intel_pt_get_mode()
499 switch (buf[1] & 3) { in intel_pt_get_mode()
557 byte = buf[0]; in intel_pt_do_get_packet()
699 buf += ret; in intel_pt_pkt_desc()
[all …]
/tools/include/nolibc/sys/
A Dstat.h55 buf->st_ino = statx.stx_ino; in fstatat()
56 buf->st_mode = statx.stx_mode; in fstatat()
57 buf->st_nlink = statx.stx_nlink; in fstatat()
58 buf->st_uid = statx.stx_uid; in fstatat()
59 buf->st_gid = statx.stx_gid; in fstatat()
63 buf->st_size = statx.stx_size; in fstatat()
64 buf->st_blksize = statx.stx_blksize; in fstatat()
65 buf->st_blocks = statx.stx_blocks; in fstatat()
77 int stat(const char *path, struct stat *buf) in stat() argument
79 return fstatat(AT_FDCWD, path, buf, 0); in stat()
[all …]
/tools/verification/rvgen/rvgen/
A Dltl2k.py71 buf = [
80 return buf
89 return buf
92 buf = [
107 return buf
110 buf = []
138 buf = [
173 return buf
176 buf = [
202 return buf
[all …]
/tools/testing/selftests/cgroup/lib/
A Dcgroup_util.c103 char *buf; in cg_read_strcmp() local
113 if (!buf) in cg_read_strcmp()
122 free(buf); in cg_read_strcmp()
130 if (cg_read(cgroup, control, buf, sizeof(buf))) in cg_read_strstr()
140 if (cg_read(cgroup, control, buf, sizeof(buf))) in cg_read_long()
150 if (pread(fd, buf, sizeof(buf), 0) <= 0) in cg_read_long_fd()
161 if (cg_read(cgroup, control, buf, sizeof(buf))) in cg_read_key_long()
178 if (cg_read(cgroup, control, buf, sizeof(buf))) in cg_read_lc()
315 while (ptr < buf + sizeof(buf)) { in cg_killall()
381 snprintf(buf, sizeof(buf), "%d", getpid()); in cg_run()
[all …]
/tools/perf/util/
A Ddemangle-java.c111 buf[rlen++] = *q; in __demangle_java_sym()
140 buf[rlen] = '\0'; in __demangle_java_sym()
141 return buf; in __demangle_java_sym()
160 char *buf, *ptr; in java_demangle_sym() local
176 buf = malloc(len); in java_demangle_sym()
177 if (!buf) in java_demangle_sym()
180 buf[0] = '\0'; in java_demangle_sym()
190 l1 = strlen(buf); in java_demangle_sym()
191 buf[l1++] = ' '; in java_demangle_sym()
199 return buf; in java_demangle_sym()
[all …]
A Dtrace-event-read.c48 buf += ret; in __do_read()
73 char buf[BUFSIZ]; in skip() local
171 char *buf; in read_ftrace_printk() local
183 free(buf); in read_ftrace_printk()
191 free(buf); in read_ftrace_printk()
249 char *buf; in read_ftrace_file() local
267 free(buf); in read_ftrace_file()
275 char *buf; in read_event_file() local
291 free(buf); in read_event_file()
347 char *buf; in read_saved_cmdline() local
[all …]
/tools/testing/selftests/proc/
A Dfd-003-kthread.c43 char buf[4096]; in kernel_thread_fd() local
47 snprintf(buf, sizeof(buf), "/proc/%u", pid); in kernel_thread_fd()
61 rv = read(fd, buf, sizeof(buf)); in kernel_thread_fd()
69 buf[rv - 1] = '\0'; in kernel_thread_fd()
73 p = strrchr(buf, ' '); in kernel_thread_fd()
78 p = strrchr(buf, ' '); in kernel_thread_fd()
133 char buf[64]; in test_lookup() local
138 snprintf(buf, sizeof(buf), "%d", i); in test_lookup()
142 snprintf(buf, sizeof(buf), "%d", i); in test_lookup()
146 snprintf(buf, sizeof(buf), "%u", u); in test_lookup()
[all …]
A Dfd-001-lookup.c55 char buf[64]; in test_lookup() local
60 snprintf(buf, sizeof(buf), "/proc/self/fd/%u", fd); in test_lookup()
61 test_lookup_pass(buf); in test_lookup()
67 snprintf(buf, sizeof(buf), "/proc/self/fd/%c%u", c, fd); in test_lookup()
68 test_lookup_fail(buf); in test_lookup()
75 snprintf(buf, sizeof(buf), "/proc/self/fd/%u%c", fd, c); in test_lookup()
76 test_lookup_fail(buf); in test_lookup()
80 snprintf(buf, sizeof(buf), "/proc/self/fd/%d", i); in test_lookup()
84 snprintf(buf, sizeof(buf), "/proc/self/fd/%d", i); in test_lookup()
88 snprintf(buf, sizeof(buf), "/proc/self/fd/%u", u); in test_lookup()
[all …]
A Dproc-pid-vm.c162 char buf[64]; in make_exe() local
207 snprintf(buf, sizeof(buf), "/proc/self/fd/%u", fd); in make_exe()
361 snprintf(buf, sizeof(buf), "/proc/%u/maps", pid); in main()
366 rv = read(fd, buf, sizeof(buf)); in main()
380 snprintf(buf, sizeof(buf), "/proc/%u/smaps", pid); in main()
385 rv = read(fd, buf, sizeof(buf)); in main()
441 rv = read(fd, buf, sizeof(buf)); in main()
472 snprintf(buf, sizeof(buf), "/proc/%u/statm", pid); in main()
477 rv = read(fd, buf, sizeof(buf)); in main()
482 assert(buf[2] == '0' || buf[2] == '1'); /* rss */ in main()
[all …]
/tools/bpf/bpftool/
A Dperf.c28 char buf[256]; in has_perf_query_support() local
45 len = sizeof(buf); in has_perf_query_support()
83 if (buf[0] != '\0') { in print_perf_json()
92 if (buf[0] != '\0') { in print_perf_json()
124 printf("tracepoint %s\n", buf); in print_perf_plain()
127 if (buf[0] != '\0') in print_perf_plain()
134 if (buf[0] != '\0') in print_perf_plain()
160 char buf[4096]; in show_proc() local
178 err = snprintf(buf, sizeof(buf), "/proc/%s/fd", proc_de->d_name); in show_proc()
182 pid_fd = opendir(buf); in show_proc()
[all …]
/tools/arch/x86/dell-uart-backlight-emulator/
A Ddell-uart-backlight-emulator.c29 val += buf[len]; in dell_uart_checksum()
84 switch (buf[0]) { in main()
104 if (buf[len - 1] != csum) { in main()
106 buf[len - 1], csum); in main()
110 switch ((buf[0] << 8) | buf[1]) { in main()
117 if (buf[2] > 100) { in main()
123 brightness = buf[2]; in main()
132 if (buf[2] != 0 && buf[2] != 1) { in main()
138 printf("Set power %d\n", buf[2]); in main()
142 (buf[0] << 8) | buf[1]); in main()
[all …]
/tools/testing/selftests/sched_ext/
A Dutil.c14 static ssize_t read_text(const char *path, char *buf, size_t max_len) in read_text() argument
23 len = read(fd, buf, max_len - 1); in read_text()
26 buf[len] = 0; in read_text()
33 static ssize_t write_text(const char *path, char *buf, ssize_t len) in write_text() argument
42 written = write(fd, buf, len); in write_text()
49 char buf[128]; in file_read_long() local
52 if (read_text(path, buf, sizeof(buf)) <= 0) in file_read_long()
55 return atol(buf); in file_read_long()
60 char buf[64]; in file_write_long() local
63 ret = sprintf(buf, "%lu", val); in file_write_long()
[all …]
/tools/perf/arch/x86/tests/
A Ddwarf-unwind.c19 u64 stack_size, *buf; in sample_ustack() local
21 buf = malloc(STACK_SIZE); in sample_ustack()
22 if (!buf) { in sample_ustack()
32 free(buf); in sample_ustack()
40 memcpy(buf, (void *) sp, stack_size); in sample_ustack()
46 __msan_unpoison(buf, stack_size); in sample_ustack()
48 stack->data = (char *) buf; in sample_ustack()
57 u64 *buf; in test__arch_unwind_sample() local
60 if (!buf) { in test__arch_unwind_sample()
73 perf_regs_load(buf); in test__arch_unwind_sample()
[all …]
/tools/usb/usbip/libsrc/
A Dnames.c302 while (fgets(buf, sizeof(buf), f)) { in parse()
311 if (buf[0] == '#' || !buf[0]) in parse()
314 if (buf[0] == 'P' && buf[1] == 'H' && buf[2] == 'Y' && in parse()
315 buf[3] == 'S' && buf[4] == 'D' && in parse()
320 if (buf[0] == 'P' && buf[1] == 'H' && in parse()
324 if (buf[0] == 'B' && buf[1] == 'I' && buf[2] == 'A' && in parse()
361 if (buf[0] == 'A' && buf[1] == 'T' && isspace(buf[2])) { in parse()
365 if (buf[0] == 'H' && buf[1] == 'C' && buf[2] == 'C' in parse()
426 if (buf[0] == '\t' && buf[1] == '\t' && isxdigit(buf[2])) { in parse()
464 if (buf[0] == 'R' && buf[1] == ' ') in parse()
[all …]
/tools/lib/perf/
A Dlib.c12 void *buf_start = buf; in ion()
17 ssize_t ret = is_read ? read(fd, buf, left) : in ion()
18 write(fd, buf, left); in ion()
26 buf += ret; in ion()
29 BUG_ON((size_t)(buf - buf_start) != n); in ion()
36 ssize_t readn(int fd, void *buf, size_t n) in readn() argument
38 return ion(true, fd, buf, n); in readn()
46 ssize_t ret = pread(fd, buf, left, offs); in preadn()
54 buf += ret; in preadn()
64 ssize_t writen(int fd, const void *buf, size_t n) in writen() argument
[all …]
/tools/spi/
A Dspidev_fdx.c20 unsigned char buf[32], *bp; in do_read() local
26 else if (len > sizeof(buf)) in do_read()
27 len = sizeof(buf); in do_read()
28 memset(buf, 0, sizeof buf); in do_read()
30 status = read(fd, buf, len); in do_read()
41 buf[0], buf[1]); in do_read()
43 bp = buf + 2; in do_read()
56 memset(buf, 0, sizeof buf); in do_msg()
58 if (len > sizeof buf) in do_msg()
59 len = sizeof buf; in do_msg()
[all …]
/tools/testing/selftests/bpf/
A Dunpriv_helpers.c19 char buf[PATH_MAX]; in open_config() local
27 snprintf(buf, sizeof(buf), "/boot/config-%s", uts.release); in open_config()
28 config = gzopen(buf, "rb"); in open_config()
43 char buf[1024]; in config_contains() local
52 if (!gzgets(config, buf, sizeof(buf))) { in config_contains()
61 n = strlen(buf); in config_contains()
62 if (buf[n - 1] == '\n') in config_contains()
63 buf[n - 1] = 0; in config_contains()
64 if (strcmp(buf, pat) == 0) { in config_contains()
117 char buf[2]; in get_unpriv_disabled() local
[all …]

Completed in 47 milliseconds

12345678910>>...30