pid, pid == -1 ? "Unknown" : thread__comm_str(t));
break;
case LOCK_AGGR_ADDR:
- pr_info(" %016llx %s\n", (unsigned long long)st->addr,
- (st->flags & LCD_F_MMAP_LOCK) ? "mmap_lock" : st->name);
+ pr_info(" %016llx %s\n", (unsigned long long)st->addr, st->name);
break;
default:
break;
static const char *lock_contention_get_name(struct lock_contention *con,
struct contention_key *key,
- u64 *stack_trace)
+ u64 *stack_trace, u32 flags)
{
int idx = 0;
u64 addr;
}
if (con->aggr_mode == LOCK_AGGR_ADDR) {
+ if (flags & LCD_F_MMAP_LOCK)
+ return "mmap_lock";
+ if (flags & LCD_F_SIGHAND_LOCK)
+ return "siglock";
sym = machine__find_kernel_symbol(machine, key->lock_addr, &kmap);
if (sym)
name = sym->name;
goto next;
}
- name = lock_contention_get_name(con, &key, stack_trace);
+ name = lock_contention_get_name(con, &key, stack_trace, data.flags);
st = lock_stat_findnew(ls_key, name, data.flags);
if (st == NULL)
break;
return LCD_F_MMAP_LOCK;
}
break;
+ case LCB_F_SPIN: /* spinlock */
+ curr = bpf_get_current_task_btf();
+ if (&curr->sighand->siglock == (void *)lock)
+ return LCD_F_SIGHAND_LOCK;
+ break;
default:
break;
}
* Upper bits of the flags in the contention_data are used to identify
* some well-known locks which do not have symbols (non-global locks).
*/
-#define LCD_F_MMAP_LOCK (1U << 31)
+#define LCD_F_MMAP_LOCK (1U << 31)
+#define LCD_F_SIGHAND_LOCK (1U << 30)
struct contention_data {
u64 total_time;