MCPcopy Create free account
hub / github.com/F-Stack/f-stack / lock_profile_object_lookup

Function lock_profile_object_lookup

freebsd/kern/subr_lock.c:566–593  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

564}
565
566static struct lock_profile_object *
567lock_profile_object_lookup(struct lock_object *lo, int spin, const char *file,
568 int line)
569{
570 struct lock_profile_object *l;
571 struct lock_prof_type *type;
572 struct lpohead *head;
573
574 head = &curthread->td_lprof[spin];
575 LIST_FOREACH(l, head, lpo_link)
576 if (l->lpo_obj == lo && l->lpo_file == file &&
577 l->lpo_line == line)
578 return (l);
579 type = &LP_CPU_SELF->lpc_types[spin];
580 l = LIST_FIRST(&type->lpt_lpoalloc);
581 if (l == NULL) {
582 lock_prof_rejected++;
583 return (NULL);
584 }
585 LIST_REMOVE(l, lpo_link);
586 l->lpo_obj = lo;
587 l->lpo_file = file;
588 l->lpo_line = line;
589 l->lpo_cnt = 0;
590 LIST_INSERT_HEAD(head, l, lpo_link);
591
592 return (l);
593}
594
595void
596lock_profile_obtain_lock_success(struct lock_object *lo, int contested,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected