Lines Matching refs:pelem
324 struct tstamp_data *pelem; in get_tstamp_elem() local
330 pelem = bpf_map_lookup_elem(&tstamp_cpu, &idx); in get_tstamp_elem()
332 if (pelem && pelem->lock) in get_tstamp_elem()
333 pelem = NULL; in get_tstamp_elem()
334 return pelem; in get_tstamp_elem()
338 pelem = bpf_map_lookup_elem(&tstamp, &pid); in get_tstamp_elem()
340 if (pelem && pelem->lock) in get_tstamp_elem()
343 if (pelem == NULL) { in get_tstamp_elem()
351 pelem = bpf_map_lookup_elem(&tstamp, &pid); in get_tstamp_elem()
352 if (pelem == NULL) { in get_tstamp_elem()
357 return pelem; in get_tstamp_elem()
363 struct tstamp_data *pelem; in contention_begin() local
368 pelem = get_tstamp_elem(ctx[1]); in contention_begin()
369 if (pelem == NULL) in contention_begin()
372 pelem->timestamp = bpf_ktime_get_ns(); in contention_begin()
373 pelem->lock = (__u64)ctx[0]; in contention_begin()
374 pelem->flags = (__u32)ctx[1]; in contention_begin()
377 pelem->stack_id = bpf_get_stackid(ctx, &stacks, in contention_begin()
379 if (pelem->stack_id < 0) in contention_begin()
385 task = get_lock_owner(pelem->lock, pelem->flags); in contention_begin()
389 pelem->flags = BPF_CORE_READ(task, pid); in contention_begin()
391 pelem->flags = -1U; in contention_begin()
399 pelem->flags = -1U; in contention_begin()
410 struct tstamp_data *pelem; in contention_end() local
428 pelem = bpf_map_lookup_elem(&tstamp_cpu, &idx); in contention_end()
429 if (pelem && pelem->lock) { in contention_end()
430 if (pelem->lock != ctx[0]) in contention_end()
434 pelem = bpf_map_lookup_elem(&tstamp, &pid); in contention_end()
435 if (!pelem || pelem->lock != ctx[0]) in contention_end()
440 duration = bpf_ktime_get_ns() - pelem->timestamp; in contention_end()
448 key.stack_id = pelem->stack_id; in contention_end()
452 key.pid = pelem->flags; in contention_end()
459 key.stack_id = pelem->stack_id; in contention_end()
462 key.lock_addr_or_cgroup = pelem->lock; in contention_end()
464 key.stack_id = pelem->stack_id; in contention_end()
486 .flags = pelem->flags, in contention_end()
491 first.flags |= check_lock_type(pelem->lock, pelem->flags); in contention_end()
519 pelem->lock = 0; in contention_end()