| 564 | } |
| 565 | |
| 566 | static struct lock_profile_object * |
| 567 | lock_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 | |
| 595 | void |
| 596 | lock_profile_obtain_lock_success(struct lock_object *lo, int contested, |
no outgoing calls
no test coverage detected