Lines Matching +defs:obj +defs:o
155 struct debug_obj *obj;
161 obj = hlist_entry(first_batch, typeof(*obj), node);
162 last = obj->batch_last;
185 struct debug_obj *obj;
190 obj = hlist_entry(head->first, typeof(*obj), node);
191 last = obj->batch_last;
201 struct debug_obj *obj;
209 obj = hlist_entry(head->first, typeof(*obj), node);
210 last = obj->batch_last;
226 struct debug_obj *obj;
231 obj = hlist_entry(list->first, typeof(*obj), node);
232 hlist_del(&obj->node);
233 return obj;
256 struct debug_obj *obj = __alloc_object(&pcp->objects);
258 if (likely(obj)) {
278 return obj;
290 static void pcpu_free(struct debug_obj *obj)
298 obj->batch_last = &obj->node;
301 obj->batch_last = first->batch_last;
303 hlist_add_head(&obj->node, &pcp->objects);
321 struct debug_obj *obj;
324 hlist_for_each_entry_safe(obj, tmp, head, node) {
325 hlist_del(&obj->node);
326 kmem_cache_free(obj_cache, obj);
368 struct debug_obj *obj;
371 obj = kmem_cache_zalloc(cache, gfp);
372 if (!obj) {
379 last = &obj->node;
380 obj->batch_last = last;
382 hlist_add_head(&obj->node, head);
435 struct debug_obj *obj;
438 hlist_for_each_entry(obj, &b->list, node) {
440 if (obj->object == addr)
441 return obj;
470 struct debug_obj *obj;
475 obj = pcpu_alloc();
477 obj = __alloc_object(&pool_boot);
479 if (likely(obj)) {
480 obj->object = addr;
481 obj->descr = descr;
482 obj->state = ODEBUG_STATE_NONE;
483 obj->astate = 0;
484 hlist_add_head(&obj->node, &b->list);
486 return obj;
534 static void __free_object(struct debug_obj *obj)
538 pcpu_free(obj);
540 hlist_add_head(&obj->node, &pool_boot);
547 static void free_object(struct debug_obj *obj)
549 __free_object(obj);
559 struct debug_obj *obj;
565 hlist_for_each_entry_safe(obj, tmp, list, node) {
566 hlist_del(&obj->node);
567 free_object(obj);
611 static void debug_print_object(struct debug_obj *obj, char *msg)
613 const struct debug_obj_descr *descr = obj->descr;
627 descr->debug_hint(obj->object) : NULL;
631 msg, obj_states[obj->state], obj->astate,
632 obj->object, descr->name, hint);
679 struct debug_obj *obj = lookup_object(addr, b);
682 if (likely(obj))
683 return obj;
702 obj = alloc_object(addr, b, descr);
703 if (likely(obj)) {
704 obj->state = state;
706 return obj;
788 struct debug_obj *obj, o;
798 obj = lookup_object_or_alloc(addr, db, descr, onstack, false);
799 if (unlikely(!obj)) {
805 switch (obj->state) {
809 obj->state = ODEBUG_STATE_INIT;
816 o = *obj;
818 debug_print_object(&o, "init");
820 if (o.state == ODEBUG_STATE_ACTIVE)
821 debug_object_fixup(descr->fixup_init, addr, o.state);
861 struct debug_obj o = { .object = addr, .state = ODEBUG_STATE_NOTAVAILABLE, .descr = descr };
863 struct debug_obj *obj;
875 obj = lookup_object_or_alloc(addr, db, descr, false, true);
876 if (unlikely(!obj)) {
880 } else if (likely(!IS_ERR(obj))) {
881 switch (obj->state) {
884 o = *obj;
888 obj->state = ODEBUG_STATE_ACTIVE;
905 debug_print_object(&o, "activate");
907 switch (o.state) {
910 if (debug_object_fixup(descr->fixup_activate, addr, o.state))
926 struct debug_obj o = { .object = addr, .state = ODEBUG_STATE_NOTAVAILABLE, .descr = descr };
928 struct debug_obj *obj;
938 obj = lookup_object(addr, db);
939 if (obj) {
940 switch (obj->state) {
946 if (obj->astate)
948 obj->state = ODEBUG_STATE_INACTIVE;
954 o = *obj;
958 debug_print_object(&o, "deactivate");
969 struct debug_obj *obj, o;
980 obj = lookup_object(addr, db);
981 if (!obj) {
986 switch (obj->state) {
993 obj->state = ODEBUG_STATE_DESTROYED;
1000 o = *obj;
1002 debug_print_object(&o, "destroy");
1004 if (o.state == ODEBUG_STATE_ACTIVE)
1005 debug_object_fixup(descr->fixup_destroy, addr, o.state);
1016 struct debug_obj *obj, o;
1027 obj = lookup_object(addr, db);
1028 if (!obj) {
1033 switch (obj->state) {
1037 hlist_del(&obj->node);
1039 free_object(obj);
1043 o = *obj;
1045 debug_print_object(&o, "free");
1047 debug_object_fixup(descr->fixup_free, addr, o.state);
1058 struct debug_obj o = { .object = addr, .state = ODEBUG_STATE_NOTAVAILABLE, .descr = descr };
1060 struct debug_obj *obj;
1071 obj = lookup_object_or_alloc(addr, db, descr, false, true);
1073 if (!IS_ERR_OR_NULL(obj))
1077 if (!obj) {
1092 debug_print_object(&o, "assert_init");
1108 struct debug_obj o = { .object = addr, .state = ODEBUG_STATE_NOTAVAILABLE, .descr = descr };
1110 struct debug_obj *obj;
1120 obj = lookup_object(addr, db);
1121 if (obj) {
1122 switch (obj->state) {
1124 if (obj->astate != expect)
1126 obj->astate = next;
1132 o = *obj;
1136 debug_print_object(&o, "active_state");
1145 struct debug_obj *obj, o;
1161 hlist_for_each_entry_safe(obj, tmp, &db->list, node) {
1163 oaddr = (unsigned long) obj->object;
1167 switch (obj->state) {
1169 o = *obj;
1171 debug_print_object(&o, "free");
1172 debug_object_fixup(o.descr->fixup_free, (void *)oaddr, o.state);
1175 hlist_del(&obj->node);
1176 __free_object(obj);
1272 struct self_test *obj = addr;
1274 return obj->static_init;
1283 struct self_test *obj = addr;
1287 debug_object_deactivate(obj, &descr_type_test);
1288 debug_object_init(obj, &descr_type_test);
1302 struct self_test *obj = addr;
1308 debug_object_deactivate(obj, &descr_type_test);
1309 debug_object_activate(obj, &descr_type_test);
1323 struct self_test *obj = addr;
1327 debug_object_deactivate(obj, &descr_type_test);
1328 debug_object_destroy(obj, &descr_type_test);
1341 struct self_test *obj = addr;
1345 debug_object_deactivate(obj, &descr_type_test);
1346 debug_object_free(obj, &descr_type_test);
1357 struct debug_obj *obj;
1365 obj = lookup_object(addr, db);
1366 if (!obj && state != ODEBUG_STATE_NONE) {
1370 if (obj && obj->state != state) {
1372 obj->state, state);
1402 static __initdata struct self_test obj = { .static_init = 0 };
1415 debug_object_init(&obj, &descr_type_test);
1416 if (check_results(&obj, ODEBUG_STATE_INIT, fixups, warnings))
1418 debug_object_activate(&obj, &descr_type_test);
1419 if (check_results(&obj, ODEBUG_STATE_ACTIVE, fixups, warnings))
1421 debug_object_activate(&obj, &descr_type_test);
1422 if (check_results(&obj, ODEBUG_STATE_ACTIVE, ++fixups, ++warnings))
1424 debug_object_deactivate(&obj, &descr_type_test);
1425 if (check_results(&obj, ODEBUG_STATE_INACTIVE, fixups, warnings))
1427 debug_object_destroy(&obj, &descr_type_test);
1428 if (check_results(&obj, ODEBUG_STATE_DESTROYED, fixups, warnings))
1430 debug_object_init(&obj, &descr_type_test);
1431 if (check_results(&obj, ODEBUG_STATE_DESTROYED, fixups, ++warnings))
1433 debug_object_activate(&obj, &descr_type_test);
1434 if (check_results(&obj, ODEBUG_STATE_DESTROYED, fixups, ++warnings))
1436 debug_object_deactivate(&obj, &descr_type_test);
1437 if (check_results(&obj, ODEBUG_STATE_DESTROYED, fixups, ++warnings))
1439 debug_object_free(&obj, &descr_type_test);
1440 if (check_results(&obj, ODEBUG_STATE_NONE, fixups, warnings))
1443 obj.static_init = 1;
1444 debug_object_activate(&obj, &descr_type_test);
1445 if (check_results(&obj, ODEBUG_STATE_ACTIVE, fixups, warnings))
1447 debug_object_init(&obj, &descr_type_test);
1448 if (check_results(&obj, ODEBUG_STATE_INIT, ++fixups, ++warnings))
1450 debug_object_free(&obj, &descr_type_test);
1451 if (check_results(&obj, ODEBUG_STATE_NONE, fixups, warnings))
1455 debug_object_init(&obj, &descr_type_test);
1456 if (check_results(&obj, ODEBUG_STATE_INIT, fixups, warnings))
1458 debug_object_activate(&obj, &descr_type_test);
1459 if (check_results(&obj, ODEBUG_STATE_ACTIVE, fixups, warnings))
1461 __debug_check_no_obj_freed(&obj, sizeof(obj));
1462 if (check_results(&obj, ODEBUG_STATE_NONE, ++fixups, ++warnings))
1506 struct debug_obj *obj;
1523 hlist_for_each_entry(obj, &objects, node) {
1527 *new = *obj;
1534 hlist_for_each_entry_safe(obj, tmp, &pool_global.objects, node) {
1535 hlist_del(&obj->node);
1536 kmem_cache_free(cache, obj);