Home
last modified time | relevance | path

Searched refs:buffer (Results 1 – 25 of 93) sorted by relevance

1234

/tools/wmi/
Ddell-smbios-example.c32 static void show_buffer(struct dell_wmi_smbios_buffer *buffer) in show_buffer() argument
35 buffer->std.cmd_class, buffer->std.cmd_select, in show_buffer()
36 buffer->std.input[0], buffer->std.input[1], in show_buffer()
37 buffer->std.input[2], buffer->std.input[3], in show_buffer()
38 buffer->std.output[0], buffer->std.output[1], in show_buffer()
39 buffer->std.output[2], buffer->std.output[3]); in show_buffer()
42 static int run_wmi_smbios_cmd(struct dell_wmi_smbios_buffer *buffer) in run_wmi_smbios_cmd() argument
48 ret = ioctl(fd, DELL_WMI_SMBIOS_CMD, buffer); in run_wmi_smbios_cmd()
95 struct dell_wmi_smbios_buffer *buffer) in token_is_active() argument
99 buffer->std.cmd_class = CLASS_TOKEN_READ; in token_is_active()
[all …]
/tools/testing/selftests/pidfd/
Dpidfd_open_test.c47 static int char_left_gc(const char *buffer, size_t len) in char_left_gc() argument
52 if (buffer[i] == ' ' || in char_left_gc()
53 buffer[i] == '\t') in char_left_gc()
62 static int char_right_gc(const char *buffer, size_t len) in char_right_gc() argument
67 if (buffer[i] == ' ' || in char_right_gc()
68 buffer[i] == '\t' || in char_right_gc()
69 buffer[i] == '\n' || in char_right_gc()
70 buffer[i] == '\0') in char_right_gc()
79 static char *trim_whitespace_in_place(char *buffer) in trim_whitespace_in_place() argument
81 buffer += char_left_gc(buffer, strlen(buffer)); in trim_whitespace_in_place()
[all …]
/tools/testing/selftests/powerpc/cache_shape/
Dcache_shape.c53 static char buffer[4096]; in test_cache_shape() local
57 FAIL_IF(read_auxv(buffer, sizeof(buffer))); in test_cache_shape()
61 p = find_auxv_entry(AT_L1I_CACHESIZE, buffer); in test_cache_shape()
67 p = find_auxv_entry(AT_L1I_CACHEGEOMETRY, buffer); in test_cache_shape()
73 p = find_auxv_entry(AT_L1D_CACHESIZE, buffer); in test_cache_shape()
79 p = find_auxv_entry(AT_L1D_CACHEGEOMETRY, buffer); in test_cache_shape()
85 p = find_auxv_entry(AT_L2_CACHESIZE, buffer); in test_cache_shape()
91 p = find_auxv_entry(AT_L2_CACHEGEOMETRY, buffer); in test_cache_shape()
97 p = find_auxv_entry(AT_L3_CACHESIZE, buffer); in test_cache_shape()
103 p = find_auxv_entry(AT_L3_CACHEGEOMETRY, buffer); in test_cache_shape()
/tools/lib/traceevent/
Dtrace-seq.c24 if (WARN_ONCE((s)->buffer == TRACE_SEQ_POISON, \
48 s->buffer = malloc(s->buffer_size); in trace_seq_init()
49 if (s->buffer != NULL) in trace_seq_init()
79 free(s->buffer); in trace_seq_destroy()
80 s->buffer = TRACE_SEQ_POISON; in trace_seq_destroy()
87 buf = realloc(s->buffer, s->buffer_size + TRACE_SEQ_BUF_SIZE); in expand_buffer()
93 s->buffer = buf; in expand_buffer()
125 ret = vsnprintf(s->buffer + s->len, len, fmt, ap); in trace_seq_printf()
165 ret = vsnprintf(s->buffer + s->len, len, fmt, args); in trace_seq_vprintf()
201 memcpy(s->buffer + s->len, str, len); in trace_seq_puts()
[all …]
/tools/testing/selftests/rseq/
Dparam_test.c684 bool this_cpu_buffer_push(struct percpu_buffer *buffer, in this_cpu_buffer_push() argument
698 offset = RSEQ_READ_ONCE(buffer->c[cpu].offset); in this_cpu_buffer_push()
699 if (offset == buffer->c[cpu].buflen) in this_cpu_buffer_push()
702 targetptr_spec = (intptr_t *)&buffer->c[cpu].array[offset]; in this_cpu_buffer_push()
704 targetptr_final = &buffer->c[cpu].offset; in this_cpu_buffer_push()
724 struct percpu_buffer_node *this_cpu_buffer_pop(struct percpu_buffer *buffer, in this_cpu_buffer_pop() argument
737 offset = RSEQ_READ_ONCE(buffer->c[cpu].offset); in this_cpu_buffer_pop()
742 head = RSEQ_READ_ONCE(buffer->c[cpu].array[offset - 1]); in this_cpu_buffer_pop()
744 targetptr = (intptr_t *)&buffer->c[cpu].offset; in this_cpu_buffer_pop()
746 (intptr_t *)&buffer->c[cpu].array[offset - 1], in this_cpu_buffer_pop()
[all …]
/tools/testing/selftests/android/ion/
DREADME3 File: ion_test.sh : Utility to test ION driver buffer sharing mechanism.
8 This is a test utility to verify ION buffer sharing in user space
11 another process to share the same buffer.
12 This utility demonstrates how ION buffer sharing can be implemented between
24 The server part (ionapp_export) is the exporter of the buffer.
25 It is responsible for creating an ION client, allocating the buffer based on
26 the heap id, writing some data to this buffer and then exporting the FD
27 (associated with this buffer) to another process using socket IPC.
28 This FD is called as buffer FD (which is different than the ION client FD).
30 The client part (ionapp_import) is the importer of the buffer.
[all …]
Dionutils.h25 unsigned char *buffer; member
30 void write_buffer(void *buffer, unsigned long len);
33 void read_buffer(void *buffer, unsigned long len);
Dionutils.c13 void write_buffer(void *buffer, unsigned long len) in write_buffer() argument
16 unsigned char *ptr = (unsigned char *)buffer; in write_buffer()
30 void read_buffer(void *buffer, unsigned long len) in read_buffer() argument
33 unsigned char *ptr = (unsigned char *)buffer; in read_buffer()
127 ion_info->buffer = map_buffer; in ion_export_buffer_fd()
178 ion_info->buffer = map_buf; in ion_import_buffer_fd()
195 munmap(ion_info->buffer, ion_info->buflen); in ion_close_buffer_fd()
/tools/perf/util/
Ds390-cpumsf.c184 struct auxtrace_buffer *buffer; member
602 unsigned char *buf = sfq->buffer->use_data; in s390_cpumsf_samples()
603 size_t len = sfq->buffer->use_size; in s390_cpumsf_samples()
624 (s64)sfq->buffer->data_offset); in s390_cpumsf_samples()
659 sfq->buffer->use_data += pos; in s390_cpumsf_samples()
660 sfq->buffer->use_size -= pos; in s390_cpumsf_samples()
667 sfq->buffer->use_size = 0; in s390_cpumsf_samples()
668 sfq->buffer->use_data = NULL; in s390_cpumsf_samples()
696 struct auxtrace_buffer *buffer; in s390_cpumsf_run_decoder() local
708 if (sfq->buffer == NULL) { in s390_cpumsf_run_decoder()
[all …]
Dordered-events.c138 size = sizeof(*oe->buffer) + MAX_SAMPLE_BUFFER * sizeof(*new); in alloc_event()
143 } else if (oe->buffer) { in alloc_event()
144 new = &oe->buffer->event[oe->buffer_idx]; in alloc_event()
146 oe->buffer = NULL; in alloc_event()
148 oe->buffer = malloc(size); in alloc_event()
149 if (!oe->buffer) { in alloc_event()
158 list_add(&oe->buffer->list, &oe->to_free); in alloc_event()
161 new = &oe->buffer->event[0]; in alloc_event()
373 ordered_events_buffer__free(struct ordered_events_buffer *buffer, in ordered_events_buffer__free() argument
380 __free_dup_event(oe, buffer->event[i].event); in ordered_events_buffer__free()
[all …]
Dintel-bts.c69 struct auxtrace_buffer *buffer; member
189 if (!btsq->on_heap && !btsq->buffer) { in intel_bts_setup_queue()
192 btsq->buffer = auxtrace_buffer__next(queue, NULL); in intel_bts_setup_queue()
193 if (!btsq->buffer) in intel_bts_setup_queue()
197 btsq->buffer->reference); in intel_bts_setup_queue()
407 struct auxtrace_buffer *buffer, in intel_bts_process_buffer() argument
415 if (buffer->use_data) { in intel_bts_process_buffer()
416 sz = buffer->use_size; in intel_bts_process_buffer()
417 branch = buffer->use_data; in intel_bts_process_buffer()
419 sz = buffer->size; in intel_bts_process_buffer()
[all …]
Dauxtrace.c238 struct auxtrace_buffer *buffer) in auxtrace_queues__queue_buffer() argument
253 queue->tid = buffer->tid; in auxtrace_queues__queue_buffer()
254 queue->cpu = buffer->cpu; in auxtrace_queues__queue_buffer()
257 buffer->buffer_nr = queues->next_buffer_nr++; in auxtrace_queues__queue_buffer()
259 list_add_tail(&buffer->list, &queue->head); in auxtrace_queues__queue_buffer()
272 struct auxtrace_buffer *buffer) in auxtrace_queues__split_buffer() argument
274 u64 sz = buffer->size; in auxtrace_queues__split_buffer()
280 b = memdup(buffer, sizeof(struct auxtrace_buffer)); in auxtrace_queues__split_buffer()
290 buffer->data_offset += BUFFER_LIMIT_FOR_32_BIT; in auxtrace_queues__split_buffer()
295 buffer->size = sz; in auxtrace_queues__split_buffer()
[all …]
Darm-spe.c41 struct auxtrace_buffer *buffer; member
109 struct auxtrace_buffer *buffer; in arm_spe_process_auxtrace_event() local
123 data_offset, &buffer); in arm_spe_process_auxtrace_event()
129 if (auxtrace_buffer__get_data(buffer, fd)) { in arm_spe_process_auxtrace_event()
130 arm_spe_dump_event(spe, buffer->data, in arm_spe_process_auxtrace_event()
131 buffer->size); in arm_spe_process_auxtrace_event()
132 auxtrace_buffer__put_data(buffer); in arm_spe_process_auxtrace_event()
/tools/perf/arch/powerpc/util/
Dheader.c20 get_cpuid(char *buffer, size_t sz) in get_cpuid() argument
27 nb = scnprintf(buffer, sz, "%lu,%lu$", PVR_VER(pvr), PVR_REV(pvr)); in get_cpuid()
30 if (strchr(buffer, '$')) { in get_cpuid()
31 buffer[nb-1] = '\0'; in get_cpuid()
/tools/power/acpi/tools/acpidump/
Dapfiles.c182 struct acpi_table_header *buffer = NULL; in ap_get_table_from_file() local
206 buffer = ACPI_ALLOCATE_ZEROED(file_size); in ap_get_table_from_file()
207 if (!buffer) { in ap_get_table_from_file()
216 actual = fread(buffer, 1, file_size, file); in ap_get_table_from_file()
219 ACPI_FREE(buffer); in ap_get_table_from_file()
220 buffer = NULL; in ap_get_table_from_file()
228 return (buffer); in ap_get_table_from_file()
/tools/hv/
Dhv_fcopy_daemon.c143 } buffer = { }; in main() local
196 len = pread(fcopy_fd, &buffer, sizeof(buffer), 0); in main()
203 if (len != sizeof(buffer.kernel_modver)) { in main()
209 buffer.kernel_modver); in main()
213 switch (buffer.hdr.operation) { in main()
215 error = hv_start_fcopy(&buffer.start); in main()
218 error = hv_copy_data(&buffer.copy); in main()
230 buffer.hdr.operation); in main()
Dhv_vss_daemon.c64 char *buffer; in is_dev_loop() local
69 buffer = malloc(PATH_MAX); in is_dev_loop()
70 if (!buffer) { in is_dev_loop()
75 snprintf(buffer, PATH_MAX, "%s/loop", blkname); in is_dev_loop()
76 if (!access(buffer, R_OK | X_OK)) { in is_dev_loop()
81 buffer, errno, strerror(errno)); in is_dev_loop()
84 snprintf(buffer, PATH_MAX, "%s/slaves", blkname); in is_dev_loop()
85 dir = opendir(buffer); in is_dev_loop()
89 buffer, errno, strerror(errno)); in is_dev_loop()
98 snprintf(buffer, PATH_MAX, "%s/slaves/%s", blkname, in is_dev_loop()
[all …]
/tools/perf/arch/x86/util/
Dheader.c27 __get_cpuid(char *buffer, size_t sz, const char *fmt) in __get_cpuid() argument
55 nb = scnprintf(buffer, sz, fmt, vendor, family, model, step); in __get_cpuid()
58 if (strchr(buffer, '$')) { in __get_cpuid()
59 buffer[nb-1] = '\0'; in __get_cpuid()
66 get_cpuid(char *buffer, size_t sz) in get_cpuid() argument
68 return __get_cpuid(buffer, sz, "%s,%u,%u,%u$"); in get_cpuid()
Dauxtrace.c56 char buffer[64]; in auxtrace_record__init() local
61 ret = get_cpuid(buffer, sizeof(buffer)); in auxtrace_record__init()
67 if (!strncmp(buffer, "GenuineIntel,", 13)) in auxtrace_record__init()
/tools/testing/selftests/vm/
Dcompaction_test.c30 char buffer[256] = {0}; in read_memory_info() local
34 if (!(fgets(buffer, sizeof(buffer), cmdfile))) { in read_memory_info()
41 *memfree = atoll(buffer); in read_memory_info()
45 if (!(fgets(buffer, sizeof(buffer), cmdfile))) { in read_memory_info()
51 *hugepagesize = atoll(buffer); in read_memory_info()
/tools/testing/selftests/net/
Dtcp_mmap.c128 char *buffer = NULL; in child_thread() local
139 buffer = malloc(chunk_size); in child_thread()
140 if (!buffer) { in child_thread()
175 lu = read(fd, buffer, zc.recv_skip_hint); in child_thread()
178 hash_zone(buffer, lu); in child_thread()
186 lu = read(fd, buffer + sub, chunk_size - sub); in child_thread()
192 hash_zone(buffer + sub, lu); in child_thread()
222 free(buffer); in child_thread()
308 char *buffer; in main() local
384 buffer = mmap(NULL, chunk_size, PROT_READ | PROT_WRITE, in main()
[all …]
Dtxring_overwrite.c41 static void build_packet(void *buffer, size_t blen, char payload_char) in build_packet() argument
48 memset(buffer, 0, blen); in build_packet()
50 eth = buffer; in build_packet()
54 iph = buffer + off; in build_packet()
65 udph = buffer + off; in build_packet()
72 memset(buffer + off, payload_char, blen - off); in build_packet()
/tools/firewire/
Ddecode-fcp.c151 char buffer[32]; in decode_avc() local
156 snprintf(buffer, sizeof(buffer), in decode_avc()
158 name = buffer; in decode_avc()
/tools/usb/usbip/libsrc/
Dvhci_driver.c193 char *buffer, *start, *end; in read_record() local
198 buffer = malloc(buffer_len); in read_record()
199 if (!buffer) in read_record()
207 free(buffer); in read_record()
211 if (fgets(buffer, buffer_len, file) == NULL) { in read_record()
213 free(buffer); in read_record()
220 start = buffer; in read_record()
224 free(buffer); in read_record()
230 if (sscanf(buffer, "%s %s %s\n", host, port, busid) != 3) { in read_record()
232 free(buffer); in read_record()
[all …]
/tools/vm/
Dslabinfo.c63 char buffer[4096]; variable
161 buffer[0] = 0; in read_obj()
163 if (!fgets(buffer, sizeof(buffer), f)) in read_obj()
164 buffer[0] = 0; in read_obj()
166 if (buffer[strlen(buffer)] == '\n') in read_obj()
167 buffer[strlen(buffer)] = 0; in read_obj()
169 return strlen(buffer); in read_obj()
181 return atol(buffer); in get_obj()
195 result = strtoul(buffer, &p, 10); in get_obj_and_str()
226 buffer[0] = 0; in read_slab_obj()
[all …]

1234