/tools/testing/selftests/vm/ |
D | hmm-tests.c | 126 struct hmm_buffer *buffer, in hmm_dmirror_cmd() argument 133 cmd.addr = (__u64)buffer->ptr; in hmm_dmirror_cmd() 134 cmd.ptr = (__u64)buffer->mirror; in hmm_dmirror_cmd() 145 buffer->cpages = cmd.cpages; in hmm_dmirror_cmd() 146 buffer->faults = cmd.faults; in hmm_dmirror_cmd() 151 static void hmm_buffer_free(struct hmm_buffer *buffer) in hmm_buffer_free() argument 153 if (buffer == NULL) in hmm_buffer_free() 156 if (buffer->ptr) in hmm_buffer_free() 157 munmap(buffer->ptr, buffer->size); in hmm_buffer_free() 158 free(buffer->mirror); in hmm_buffer_free() [all …]
|
D | compaction_test.c | 31 char buffer[256] = {0}; in read_memory_info() local 35 if (!(fgets(buffer, sizeof(buffer), cmdfile))) { in read_memory_info() 42 *memfree = atoll(buffer); in read_memory_info() 46 if (!(fgets(buffer, sizeof(buffer), cmdfile))) { in read_memory_info() 52 *hugepagesize = atoll(buffer); in read_memory_info()
|
/tools/wmi/ |
D | dell-smbios-example.c | 32 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/ |
D | pidfd_open_test.c | 47 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/ |
D | cache_shape.c | 53 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/testing/selftests/drivers/net/mlxsw/ |
D | qos_headroom.sh | 34 dcb -j buffer show dev $swp | 58 dcb -j buffer show dev $swp | jq ".buffer_size[$idx]" 63 dcb -j buffer show dev $swp | jq '.total_size' 136 dcb buffer set dev $swp prio-buffer 0:1 1:3 2:5 3:7 4:0 5:2 6:4 7:6 2>/dev/null 252 dcb buffer set dev $swp prio-buffer 0:1 1:3 2:5 3:7 4:0 5:2 6:4 7:6 260 dcb buffer set dev $swp prio-buffer all:0 274 dcb buffer set dev $swp buffer-size all:0 0:$size 2>/dev/null 279 dcb buffer set dev $swp buffer-size all:0 0:$size 287 dcb buffer set dev $swp buffer-size all:0 293 dcb buffer set dev $swp buffer-size all:0 0:$size [all …]
|
D | qos_pfc.sh | 177 dcb buffer set dev $swp1 prio-buffer all:0 1:1 215 dcb buffer set dev $swp3 prio-buffer all:0 1:1 232 dcb buffer set dev $swp4 prio-buffer all:0 1:1 249 dcb buffer set dev $swp4 buffer-size all:0 1:$pg1_size 292 dcb buffer set dev $swp4 buffer-size all:0 294 dcb buffer set dev $swp4 prio-buffer all:0 308 dcb buffer set dev $swp3 prio-buffer all:0 334 dcb buffer set dev $swp1 prio-buffer all:0
|
/tools/lib/traceevent/ |
D | trace-seq.c | 24 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/ |
D | param_test.c | 686 bool this_cpu_buffer_push(struct percpu_buffer *buffer, in this_cpu_buffer_push() argument 700 offset = RSEQ_READ_ONCE(buffer->c[cpu].offset); in this_cpu_buffer_push() 701 if (offset == buffer->c[cpu].buflen) in this_cpu_buffer_push() 704 targetptr_spec = (intptr_t *)&buffer->c[cpu].array[offset]; in this_cpu_buffer_push() 706 targetptr_final = &buffer->c[cpu].offset; in this_cpu_buffer_push() 726 struct percpu_buffer_node *this_cpu_buffer_pop(struct percpu_buffer *buffer, in this_cpu_buffer_pop() argument 739 offset = RSEQ_READ_ONCE(buffer->c[cpu].offset); in this_cpu_buffer_pop() 744 head = RSEQ_READ_ONCE(buffer->c[cpu].array[offset - 1]); in this_cpu_buffer_pop() 746 targetptr = (intptr_t *)&buffer->c[cpu].offset; in this_cpu_buffer_pop() 748 (intptr_t *)&buffer->c[cpu].array[offset - 1], in this_cpu_buffer_pop() [all …]
|
/tools/perf/util/ |
D | s390-cpumsf.c | 184 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 …]
|
D | ordered-events.c | 138 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 …]
|
D | intel-bts.c | 69 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 …]
|
D | auxtrace.c | 279 struct auxtrace_buffer *buffer) in auxtrace_queues__queue_buffer() argument 294 queue->tid = buffer->tid; in auxtrace_queues__queue_buffer() 295 queue->cpu = buffer->cpu; in auxtrace_queues__queue_buffer() 298 buffer->buffer_nr = queues->next_buffer_nr++; in auxtrace_queues__queue_buffer() 300 list_add_tail(&buffer->list, &queue->head); in auxtrace_queues__queue_buffer() 313 struct auxtrace_buffer *buffer) in auxtrace_queues__split_buffer() argument 315 u64 sz = buffer->size; in auxtrace_queues__split_buffer() 321 b = memdup(buffer, sizeof(struct auxtrace_buffer)); in auxtrace_queues__split_buffer() 331 buffer->data_offset += BUFFER_LIMIT_FOR_32_BIT; in auxtrace_queues__split_buffer() 336 buffer->size = sz; in auxtrace_queues__split_buffer() [all …]
|
/tools/testing/selftests/net/ |
D | tcp_mmap.c | 129 void *buffer; in mmap_large_buffer() local 134 buffer = mmap(NULL, sz, PROT_READ | PROT_WRITE, in mmap_large_buffer() 137 if (buffer == (void *)-1) { in mmap_large_buffer() 139 buffer = mmap(NULL, sz, PROT_READ | PROT_WRITE, in mmap_large_buffer() 141 if (buffer != (void *)-1) in mmap_large_buffer() 145 return buffer; in mmap_large_buffer() 155 char *buffer = NULL; in child_thread() local 168 buffer = mmap_large_buffer(chunk_size, &buffer_sz); in child_thread() 169 if (buffer == (void *)-1) { in child_thread() 213 lu = read(fd, buffer, zc.recv_skip_hint); in child_thread() [all …]
|
D | fin_ack_lat.c | 35 int buffer; in client() local 64 send(sock, &buffer, sizeof(buffer), 0); in client() 65 if (read(sock, &buffer, sizeof(buffer)) == -1) in client() 90 int buffer; in server() local 98 if (read(accepted, &buffer, sizeof(buffer)) == -1) in server()
|
D | txring_overwrite.c | 41 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/power/acpi/tools/acpidump/ |
D | apfiles.c | 182 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/perf/arch/powerpc/util/ |
D | header.c | 15 get_cpuid(char *buffer, size_t sz) in get_cpuid() argument 22 nb = scnprintf(buffer, sz, "%lu,%lu$", PVR_VER(pvr), PVR_REV(pvr)); in get_cpuid() 25 if (strchr(buffer, '$')) { in get_cpuid() 26 buffer[nb-1] = '\0'; in get_cpuid()
|
/tools/hv/ |
D | hv_fcopy_daemon.c | 159 } buffer = { }; in main() local 218 len = pread(fcopy_fd, &buffer, sizeof(buffer), 0); in main() 225 if (len != sizeof(buffer.kernel_modver)) { in main() 231 buffer.kernel_modver); in main() 235 switch (buffer.hdr.operation) { in main() 237 error = hv_start_fcopy(&buffer.start); in main() 240 error = hv_copy_data(&buffer.copy); in main() 252 buffer.hdr.operation); in main()
|
D | hv_vss_daemon.c | 66 char *buffer; in is_dev_loop() local 71 buffer = malloc(PATH_MAX); in is_dev_loop() 72 if (!buffer) { in is_dev_loop() 77 snprintf(buffer, PATH_MAX, "%s/loop", blkname); in is_dev_loop() 78 if (!access(buffer, R_OK | X_OK)) { in is_dev_loop() 83 buffer, errno, strerror(errno)); in is_dev_loop() 86 snprintf(buffer, PATH_MAX, "%s/slaves", blkname); in is_dev_loop() 87 dir = opendir(buffer); in is_dev_loop() 91 buffer, errno, strerror(errno)); in is_dev_loop() 100 snprintf(buffer, PATH_MAX, "%s/slaves/%s", blkname, in is_dev_loop() [all …]
|
/tools/perf/arch/x86/util/ |
D | header.c | 27 __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()
|
D | auxtrace.c | 60 char buffer[64]; in auxtrace_record__init() local 65 ret = get_cpuid(buffer, sizeof(buffer)); in auxtrace_record__init() 71 if (!strncmp(buffer, "GenuineIntel,", 13)) in auxtrace_record__init()
|
/tools/usb/usbip/libsrc/ |
D | vhci_driver.c | 193 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/firewire/ |
D | decode-fcp.c | 151 char buffer[32]; in decode_avc() local 156 snprintf(buffer, sizeof(buffer), in decode_avc() 158 name = buffer; in decode_avc()
|
/tools/testing/selftests/sgx/ |
D | main.c | 221 op.buffer = MAGIC; in TEST_F() 229 op.buffer = 0; in TEST_F() 233 EXPECT_EQ(op.buffer, MAGIC); in TEST_F() 243 op.buffer = MAGIC; in TEST_F() 251 op.buffer = 0; in TEST_F() 255 EXPECT_EQ(op.buffer, MAGIC); in TEST_F() 276 op.buffer = MAGIC; in TEST_F() 284 op.buffer = 0; in TEST_F() 288 EXPECT_EQ(op.buffer, MAGIC); in TEST_F()
|