Lines Matching refs:con
20 int lock_contention_prepare(struct lock_contention *con)
24 struct evlist *evlist = con->evlist;
25 struct target *target = con->target;
33 bpf_map__set_value_size(skel->maps.stacks, con->max_stack * sizeof(u64));
34 bpf_map__set_max_entries(skel->maps.lock_stat, con->map_nr_entries);
35 bpf_map__set_max_entries(skel->maps.tstamp, con->map_nr_entries);
37 if (con->aggr_mode == LOCK_AGGR_TASK)
38 bpf_map__set_max_entries(skel->maps.task_data, con->map_nr_entries);
42 if (con->save_callstack)
43 bpf_map__set_max_entries(skel->maps.stacks, con->map_nr_entries);
51 if (con->filters->nr_types)
52 ntypes = con->filters->nr_types;
55 if (con->filters->nr_syms) {
60 for (i = 0; i < con->filters->nr_syms; i++) {
61 sym = machine__find_kernel_symbol_by_name(con->machine,
62 con->filters->syms[i],
66 con->filters->syms[i]);
70 addrs = realloc(con->filters->addrs,
71 (con->filters->nr_addrs + 1) * sizeof(*addrs));
77 addrs[con->filters->nr_addrs++] = map__unmap_ip(kmap, sym->start);
78 con->filters->addrs = addrs;
80 naddrs = con->filters->nr_addrs;
128 if (con->filters->nr_types) {
134 for (i = 0; i < con->filters->nr_types; i++)
135 bpf_map_update_elem(fd, &con->filters->types[i], &val, BPF_ANY);
138 if (con->filters->nr_addrs) {
144 for (i = 0; i < con->filters->nr_addrs; i++)
145 bpf_map_update_elem(fd, &con->filters->addrs[i], &val, BPF_ANY);
149 skel->bss->stack_skip = con->stack_skip;
150 skel->bss->aggr_mode = con->aggr_mode;
151 skel->bss->needs_callstack = con->save_callstack;
152 skel->bss->lock_owner = con->owner;
172 static const char *lock_contention_get_name(struct lock_contention *con,
182 struct machine *machine = con->machine;
184 if (con->aggr_mode == LOCK_AGGR_TASK) {
202 if (con->aggr_mode == LOCK_AGGR_ADDR) {
227 idx < con->max_stack - 1)
249 int lock_contention_read(struct lock_contention *con)
255 struct machine *machine = con->machine;
257 size_t stack_size = con->max_stack * sizeof(*stack_trace);
262 con->fails.task = skel->bss->task_fail;
263 con->fails.stack = skel->bss->stack_fail;
264 con->fails.time = skel->bss->time_fail;
265 con->fails.data = skel->bss->data_fail;
271 if (con->aggr_mode == LOCK_AGGR_TASK) {
278 if (con->aggr_mode == LOCK_AGGR_ADDR) {
299 if (con->save_callstack) {
303 con->nr_filtered += data.count;
308 switch (con->aggr_mode) {
336 name = lock_contention_get_name(con, &key, stack_trace, data.flags);
349 if (con->aggr_mode == LOCK_AGGR_CALLER && verbose > 0) {