Home
last modified time | relevance | path

Searched refs:sz (Results 1 – 25 of 94) sorted by relevance

1234

/tools/testing/selftests/bpf/prog_tests/
Dglobal_data_init.c12 size_t sz; in test_global_data_init() local
23 sz = bpf_map__def(map)->value_size; in test_global_data_init()
24 newval = malloc(sz); in test_global_data_init()
28 memset(newval, 0, sz); in test_global_data_init()
30 err = bpf_map__set_initial_value(map, newval, sz - 1); in test_global_data_init()
34 err = bpf_map__set_initial_value(map, newval, sz); in test_global_data_init()
46 buff = malloc(sz); in test_global_data_init()
49 if (CHECK(!buff || err || memcmp(buff, newval, sz), in test_global_data_init()
54 memset(newval, 1, sz); in test_global_data_init()
56 err = bpf_map__set_initial_value(map, newval, sz); in test_global_data_init()
Dtest_lsm.c25 long sz; in stack_mprotect() local
28 sz = sysconf(_SC_PAGESIZE); in stack_mprotect()
29 if (sz < 0) in stack_mprotect()
30 return sz; in stack_mprotect()
32 buf = alloca(sz * 3); in stack_mprotect()
33 ret = mprotect(GET_PAGE_ADDR(buf, sz), sz, in stack_mprotect()
/tools/perf/util/
Dmem-events.c131 int perf_mem__tlb_scnprintf(char *out, size_t sz, struct mem_info *mem_info) in perf_mem__tlb_scnprintf() argument
137 sz -= 1; /* -1 for null termination */ in perf_mem__tlb_scnprintf()
156 l += scnprintf(out + l, sz - l, tlb_access[i]); in perf_mem__tlb_scnprintf()
159 l += scnprintf(out, sz - l, "N/A"); in perf_mem__tlb_scnprintf()
161 l += scnprintf(out + l, sz - l, " hit"); in perf_mem__tlb_scnprintf()
163 l += scnprintf(out + l, sz - l, " miss"); in perf_mem__tlb_scnprintf()
193 int perf_mem__lvl_scnprintf(char *out, size_t sz, struct mem_info *mem_info) in perf_mem__lvl_scnprintf() argument
203 sz -= 1; /* -1 for null termination */ in perf_mem__lvl_scnprintf()
226 l += scnprintf(out + l, sz - l, mem_lvl[i]); in perf_mem__lvl_scnprintf()
236 l += scnprintf(out + l, sz - l, mem_lvlnum[lvl]); in perf_mem__lvl_scnprintf()
[all …]
Daffinity.c14 int sz = cpu__max_cpu() + 8 - 1; in get_cpu_set_size() local
19 if (sz < 4096) in get_cpu_set_size()
20 sz = 4096; in get_cpu_set_size()
21 return sz / 8; in get_cpu_set_size()
Dmem-events.h45 int perf_mem__tlb_scnprintf(char *out, size_t sz, struct mem_info *mem_info);
46 int perf_mem__lvl_scnprintf(char *out, size_t sz, struct mem_info *mem_info);
47 int perf_mem__snp_scnprintf(char *out, size_t sz, struct mem_info *mem_info);
48 int perf_mem__lck_scnprintf(char *out, size_t sz, struct mem_info *mem_info);
Dtime-utils.h38 int timestamp__scnprintf_usec(u64 timestamp, char *buf, size_t sz);
39 int timestamp__scnprintf_nsec(u64 timestamp, char *buf, size_t sz);
41 int fetch_current_timestamp(char *buf, size_t sz);
Dthread-stack.h88 size_t sz, u64 ip, u64 kernel_start);
90 struct ip_callchain *chain, size_t sz, u64 ip,
93 struct branch_stack *dst, unsigned int sz);
95 struct branch_stack *dst, unsigned int sz,
Dsynthetic-events.c1307 size_t sz, result = sizeof(struct perf_record_sample); in perf_event__sample_event_size() local
1344 sz = sample->read.group.nr * in perf_event__sample_event_size()
1346 result += sz; in perf_event__sample_event_size()
1353 sz = (sample->callchain->nr + 1) * sizeof(u64); in perf_event__sample_event_size()
1354 result += sz; in perf_event__sample_event_size()
1363 sz = sample->branch_stack->nr * sizeof(struct branch_entry); in perf_event__sample_event_size()
1365 sz += 2 * sizeof(u64); in perf_event__sample_event_size()
1366 result += sz; in perf_event__sample_event_size()
1372 sz = hweight64(sample->user_regs.mask) * sizeof(u64); in perf_event__sample_event_size()
1373 result += sz; in perf_event__sample_event_size()
[all …]
Dthread-stack.c91 size_t sz; member
121 size_t sz, new_sz; in thread_stack__grow() local
123 new_sz = ts->sz + STACK_GROWTH; in thread_stack__grow()
124 sz = new_sz * sizeof(struct thread_stack_entry); in thread_stack__grow()
126 new_stack = realloc(ts->stack, sz); in thread_stack__grow()
131 ts->sz = new_sz; in thread_stack__grow()
149 size_t sz = sizeof(struct branch_stack); in thread_stack__init() local
151 sz += br_stack_sz * sizeof(struct branch_entry); in thread_stack__init()
152 ts->br_stack_rb = zalloc(sz); in thread_stack__init()
243 if (ts->cnt == ts->sz) { in thread_stack__push()
[all …]
/tools/testing/selftests/bpf/
Dtest_btf.h15 #define BTF_TYPE_INT_ENC(name, encoding, bits_offset, bits, sz) \ argument
16 BTF_TYPE_ENC(name, BTF_INFO_ENC(BTF_KIND_INT, 0, 0), sz), \
28 #define BTF_STRUCT_ENC(name, nr_elems, sz) \ argument
29 BTF_TYPE_ENC(name, BTF_INFO_ENC(BTF_KIND_STRUCT, 0, nr_elems), sz)
31 #define BTF_UNION_ENC(name, nr_elems, sz) \ argument
32 BTF_TYPE_ENC(name, BTF_INFO_ENC(BTF_KIND_UNION, 0, nr_elems), sz)
Dtrace_helpers.c130 ssize_t sz; in read_trace_pipe() local
132 sz = read(trace_fd, buf, sizeof(buf) - 1); in read_trace_pipe()
133 if (sz > 0) { in read_trace_pipe()
134 buf[sz] = 0; in read_trace_pipe()
/tools/perf/arch/arm64/util/
Dheader.c17 static int _get_cpuid(char *buf, size_t sz, struct perf_cpu_map *cpus) in _get_cpuid() argument
23 if (!sysfs || sz < MIDR_SIZE) in _get_cpuid()
65 int get_cpuid(char *buf, size_t sz) in get_cpuid() argument
73 ret = _get_cpuid(buf, sz, cpus); in get_cpuid()
/tools/testing/selftests/bpf/progs/
Dringbuf_bench.c24 long sz; in get_flags() local
29 sz = bpf_ringbuf_query(&ringbuf, BPF_RB_AVAIL_DATA); in get_flags()
30 return sz >= wakeup_data_size ? BPF_RB_FORCE_WAKEUP : BPF_RB_NO_WAKEUP; in get_flags()
/tools/testing/selftests/net/
Dreuseport_addr_any.c40 int opt, i, sz; in build_rcv_fd() local
52 sz = sizeof(addr4); in build_rcv_fd()
62 sz = sizeof(addr6); in build_rcv_fd()
84 if (bind(rcv_fds[i], addr, sz)) in build_rcv_fd()
108 int fd, sz; in connect_and_send() local
121 sz = sizeof(saddr4); in connect_and_send()
134 sz = sizeof(saddr6); in connect_and_send()
156 if (bind(fd, saddr, sz)) in connect_and_send()
159 if (connect(fd, daddr, sz)) in connect_and_send()
Dtcp_fastopen_backup_key.c96 int opt = 1, i, sz; in build_rcv_fd() local
105 sz = sizeof(addr4); in build_rcv_fd()
112 sz = sizeof(addr6); in build_rcv_fd()
132 if (bind(rcv_fds[i], addr, sz)) in build_rcv_fd()
150 int fd, sz, ret; in connect_and_send() local
164 sz = sizeof(saddr4); in connect_and_send()
177 sz = sizeof(saddr6); in connect_and_send()
192 if (bind(fd, saddr, sz)) in connect_and_send()
195 ret = sendto(fd, data, 1, MSG_FASTOPEN, daddr, sz); in connect_and_send()
/tools/include/linux/
Dhashtable.h31 static inline void __hash_init(struct hlist_head *ht, unsigned int sz) in __hash_init() argument
35 for (i = 0; i < sz; i++) in __hash_init()
69 static inline bool __hash_empty(struct hlist_head *ht, unsigned int sz) in __hash_empty() argument
73 for (i = 0; i < sz; i++) in __hash_empty()
/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()
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()
Dintel-bts.c168 size_t sz = opts->auxtrace_snapshot_size; in intel_bts_recording_options() local
170 sz = round_up(sz, page_size) / page_size; in intel_bts_recording_options()
171 opts->auxtrace_mmap_pages = roundup_pow_of_two(sz); in intel_bts_recording_options()
201 size_t sz = opts->auxtrace_mmap_pages * (size_t)page_size; in intel_bts_recording_options() local
209 if (sz < min_sz || !is_power_of_2(sz)) { in intel_bts_recording_options()
281 const size_t sz = sizeof(struct intel_bts_snapshot_ref); in intel_bts_alloc_snapshot_refs() local
291 refs = calloc(new_cnt, sz); in intel_bts_alloc_snapshot_refs()
295 memcpy(refs, btsr->snapshot_refs, cnt * sz); in intel_bts_alloc_snapshot_refs()
/tools/perf/tests/
Dsample-parsing.c108 size_t sz = hweight_long(s1->user_regs.mask) * sizeof(u64); in samples_same() local
114 memcmp(s1->user_regs.regs, s2->user_regs.regs, sz))) { in samples_same()
139 size_t sz = hweight_long(s1->intr_regs.mask) * sizeof(u64); in samples_same() local
145 memcmp(s1->intr_regs.regs, s2->intr_regs.regs, sz))) { in samples_same()
244 size_t i, sz, bufsz; in do_test() local
267 sz = perf_event__sample_event_size(&sample, sample_type, read_format); in do_test()
268 bufsz = sz + 4096; /* Add a bit for overrun checking */ in do_test()
278 event->header.size = sz; in do_test()
293 if (i != sz) { in do_test()
295 i, sz); in do_test()
/tools/lib/subcmd/
Dpager.c74 struct winsize sz; in setup_pager() local
80 if (ioctl(1, TIOCGWINSZ, &sz) == 0) in setup_pager()
81 pager_columns = sz.ws_col; in setup_pager()
/tools/perf/pmu-events/
Djson.c88 unsigned sz; in parse_json() local
94 sz = *size * 16; in parse_json()
95 tokens = malloc(sz); in parse_json()
100 sz / sizeof(jsmntok_t)); in parse_json()
/tools/perf/arch/powerpc/util/
Dheader.c15 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()
/tools/testing/selftests/arm64/fp/
Dsve-ptrace.c73 size_t sz = sizeof *sve; in get_sve() local
77 if (*size < sz) { in get_sve()
78 p = realloc(*buf, sz); in get_sve()
85 *size = sz; in get_sve()
89 iov.iov_len = sz; in get_sve()
94 if (sve->size <= sz) in get_sve()
97 sz = sve->size; in get_sve()
/tools/perf/ui/tui/
Dhelpline.c22 const size_t sz = sizeof(ui_helpline__current); in tui_helpline__push() local
28 strlcpy(ui_helpline__current, msg, sz); in tui_helpline__push()
/tools/perf/arch/s390/util/
Dheader.c30 int get_cpuid(char *buffer, size_t sz) in get_cpuid() argument
131 nbytes = snprintf(buffer, sz, "%s,%s,%s,%s,%s", in get_cpuid()
135 nbytes = snprintf(buffer, sz, "%s,%s,%s", manufacturer, type, in get_cpuid()
137 return (nbytes >= sz) ? ENOBUFS : 0; in get_cpuid()

1234