History

debug_objects: add boot-parameter toggle to turn object debugging off again

While trying to debug why my Atom netbook is falling over booting rawhide debug-enabled kernels, I stumbled across the fact that we've been enabling object debugging by default. However, once you default it to on, you've got no way to turn it back off again at runtime. Add a boolean toggle to turn it off. I would just make it an int module_param, however people may already expect the boolean enable behaviour, so just add an analogue for disabling.

Kyle McMartin committed 17 years ago

Commit 3e8ebb51 parent 778ef1e2 files · +11 −0Browse files

Showing the changes to lib/debugobjects.c (1 of 2 files). Show all

Unified · Split

lib/debugobjects.c+8−0
@@ -55,7 +55,15 @@ static int __init enable_object_debug(char *str) · 54 unmodified lines
55 debug_objects_enabled = 1;55 debug_objects_enabled = 1;
56 return 0;56 return 0;
57}57}
58
59static int __init disable_object_debug(char *str)
60{
61 debug_objects_enabled = 0;
62 return 0;
63}
64
58early_param("debug_objects", enable_object_debug);65early_param("debug_objects", enable_object_debug);
66early_param("no_debug_objects", disable_object_debug);
59 67
60static const char *obj_states[ODEBUG_STATE_MAX] = {68static const char *obj_states[ODEBUG_STATE_MAX] = {
61 [ODEBUG_STATE_NONE] = "none",69 [ODEBUG_STATE_NONE] = "none",