Lines Matching defs:obj
130 struct debug_obj *obj;
151 obj = hlist_entry(obj_to_free.first, typeof(*obj), node);
152 hlist_del(&obj->node);
154 hlist_add_head(&obj->node, &obj_pool);
190 struct debug_obj *obj;
193 hlist_for_each_entry(obj, &b->list, node) {
195 if (obj->object == addr)
196 return obj;
209 struct debug_obj *obj = NULL;
212 obj = hlist_entry(list->first, typeof(*obj), node);
213 hlist_del(&obj->node);
216 return obj;
223 struct debug_obj *obj;
226 obj = __alloc_object(&percpu_pool->free_objs);
227 if (obj) {
234 obj = __alloc_object(&obj_pool);
235 if (obj) {
269 if (obj) {
270 obj->object = addr;
271 obj->descr = descr;
272 obj->state = ODEBUG_STATE_NONE;
273 obj->astate = 0;
274 hlist_add_head(&obj->node, &b->list);
276 return obj;
288 struct debug_obj *obj;
307 obj = hlist_entry(obj_to_free.first, typeof(*obj), node);
308 hlist_del(&obj->node);
309 hlist_add_head(&obj->node, &obj_pool);
329 hlist_for_each_entry_safe(obj, tmp, &tofree, node) {
330 hlist_del(&obj->node);
331 kmem_cache_free(obj_cache, obj);
335 static void __free_object(struct debug_obj *obj)
352 hlist_add_head(&obj->node, &percpu_pool->free_objs);
377 hlist_add_head(&obj->node, &obj_to_free);
395 obj = __alloc_object(&obj_pool);
396 hlist_add_head(&obj->node, &obj_to_free);
403 hlist_add_head(&obj->node, &obj_pool);
421 static void free_object(struct debug_obj *obj)
423 __free_object(obj);
435 struct debug_obj *obj;
440 hlist_for_each_entry_safe(obj, tmp, &percpu_pool->free_objs, node) {
441 hlist_del(&obj->node);
442 kmem_cache_free(obj_cache, obj);
465 struct debug_obj *obj;
477 hlist_for_each_entry_safe(obj, tmp, &freelist, node) {
478 hlist_del(&obj->node);
479 free_object(obj);
496 static void debug_print_object(struct debug_obj *obj, char *msg)
498 const struct debug_obj_descr *descr = obj->descr;
512 descr->debug_hint(obj->object) : NULL;
516 msg, obj_states[obj->state], obj->astate,
517 obj->object, descr->name, hint);
564 struct debug_obj *obj = lookup_object(addr, b);
567 if (likely(obj))
568 return obj;
587 obj = alloc_object(addr, b, descr);
588 if (likely(obj)) {
589 obj->state = state;
591 return obj;
623 struct debug_obj *obj, o;
633 obj = lookup_object_or_alloc(addr, db, descr, onstack, false);
634 if (unlikely(!obj)) {
640 switch (obj->state) {
644 obj->state = ODEBUG_STATE_INIT;
651 o = *obj;
698 struct debug_obj *obj;
710 obj = lookup_object_or_alloc(addr, db, descr, false, true);
711 if (unlikely(!obj)) {
715 } else if (likely(!IS_ERR(obj))) {
716 switch (obj->state) {
719 o = *obj;
723 obj->state = ODEBUG_STATE_ACTIVE;
755 struct debug_obj *obj;
765 obj = lookup_object(addr, db);
766 if (obj) {
767 switch (obj->state) {
773 if (obj->astate)
775 obj->state = ODEBUG_STATE_INACTIVE;
781 o = *obj;
796 struct debug_obj *obj, o;
807 obj = lookup_object(addr, db);
808 if (!obj) {
813 switch (obj->state) {
820 obj->state = ODEBUG_STATE_DESTROYED;
827 o = *obj;
843 struct debug_obj *obj, o;
854 obj = lookup_object(addr, db);
855 if (!obj) {
860 switch (obj->state) {
864 hlist_del(&obj->node);
866 free_object(obj);
870 o = *obj;
887 struct debug_obj *obj;
898 obj = lookup_object_or_alloc(addr, db, descr, false, true);
900 if (likely(!IS_ERR_OR_NULL(obj)))
904 if (!obj) {
928 struct debug_obj *obj;
938 obj = lookup_object(addr, db);
939 if (obj) {
940 switch (obj->state) {
942 if (obj->astate != expect)
944 obj->astate = next;
950 o = *obj;
963 struct debug_obj *obj, o;
979 hlist_for_each_entry_safe(obj, tmp, &db->list, node) {
981 oaddr = (unsigned long) obj->object;
985 switch (obj->state) {
987 o = *obj;
993 hlist_del(&obj->node);
994 __free_object(obj);
1080 struct self_test *obj = addr;
1082 return obj->static_init;
1091 struct self_test *obj = addr;
1095 debug_object_deactivate(obj, &descr_type_test);
1096 debug_object_init(obj, &descr_type_test);
1110 struct self_test *obj = addr;
1116 debug_object_deactivate(obj, &descr_type_test);
1117 debug_object_activate(obj, &descr_type_test);
1131 struct self_test *obj = addr;
1135 debug_object_deactivate(obj, &descr_type_test);
1136 debug_object_destroy(obj, &descr_type_test);
1149 struct self_test *obj = addr;
1153 debug_object_deactivate(obj, &descr_type_test);
1154 debug_object_free(obj, &descr_type_test);
1165 struct debug_obj *obj;
1173 obj = lookup_object(addr, db);
1174 if (!obj && state != ODEBUG_STATE_NONE) {
1178 if (obj && obj->state != state) {
1180 obj->state, state);
1210 static __initdata struct self_test obj = { .static_init = 0 };
1223 debug_object_init(&obj, &descr_type_test);
1224 if (check_results(&obj, ODEBUG_STATE_INIT, fixups, warnings))
1226 debug_object_activate(&obj, &descr_type_test);
1227 if (check_results(&obj, ODEBUG_STATE_ACTIVE, fixups, warnings))
1229 debug_object_activate(&obj, &descr_type_test);
1230 if (check_results(&obj, ODEBUG_STATE_ACTIVE, ++fixups, ++warnings))
1232 debug_object_deactivate(&obj, &descr_type_test);
1233 if (check_results(&obj, ODEBUG_STATE_INACTIVE, fixups, warnings))
1235 debug_object_destroy(&obj, &descr_type_test);
1236 if (check_results(&obj, ODEBUG_STATE_DESTROYED, fixups, warnings))
1238 debug_object_init(&obj, &descr_type_test);
1239 if (check_results(&obj, ODEBUG_STATE_DESTROYED, fixups, ++warnings))
1241 debug_object_activate(&obj, &descr_type_test);
1242 if (check_results(&obj, ODEBUG_STATE_DESTROYED, fixups, ++warnings))
1244 debug_object_deactivate(&obj, &descr_type_test);
1245 if (check_results(&obj, ODEBUG_STATE_DESTROYED, fixups, ++warnings))
1247 debug_object_free(&obj, &descr_type_test);
1248 if (check_results(&obj, ODEBUG_STATE_NONE, fixups, warnings))
1251 obj.static_init = 1;
1252 debug_object_activate(&obj, &descr_type_test);
1253 if (check_results(&obj, ODEBUG_STATE_ACTIVE, fixups, warnings))
1255 debug_object_init(&obj, &descr_type_test);
1256 if (check_results(&obj, ODEBUG_STATE_INIT, ++fixups, ++warnings))
1258 debug_object_free(&obj, &descr_type_test);
1259 if (check_results(&obj, ODEBUG_STATE_NONE, fixups, warnings))
1263 debug_object_init(&obj, &descr_type_test);
1264 if (check_results(&obj, ODEBUG_STATE_INIT, fixups, warnings))
1266 debug_object_activate(&obj, &descr_type_test);
1267 if (check_results(&obj, ODEBUG_STATE_ACTIVE, fixups, warnings))
1269 __debug_check_no_obj_freed(&obj, sizeof(obj));
1270 if (check_results(&obj, ODEBUG_STATE_NONE, ++fixups, ++warnings))
1309 struct debug_obj *obj, *new;
1314 obj = kmem_cache_zalloc(obj_cache, GFP_KERNEL);
1315 if (!obj)
1317 hlist_add_head(&obj->node, &objects);
1329 hlist_for_each_entry_safe(obj, tmp, &obj_pool, node)
1330 hlist_del(&obj->node);
1338 hlist_for_each_entry(obj, &objects, node) {
1339 new = hlist_entry(obj_pool.first, typeof(*obj), node);
1342 *new = *obj;
1352 hlist_for_each_entry_safe(obj, tmp, &objects, node) {
1353 hlist_del(&obj->node);
1354 kmem_cache_free(obj_cache, obj);