aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/slub.c79
1 files changed, 51 insertions, 28 deletions
diff --git a/mm/slub.c b/mm/slub.c
index e0cf6213abc0..6aea48942c29 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -323,7 +323,11 @@ static inline int slab_index(void *p, struct kmem_cache *s, void *addr)
323/* 323/*
324 * Debug settings: 324 * Debug settings:
325 */ 325 */
326#ifdef CONFIG_SLUB_DEBUG_ON
327static int slub_debug = DEBUG_DEFAULT_FLAGS;
328#else
326static int slub_debug; 329static int slub_debug;
330#endif
327 331
328static char *slub_debug_slabs; 332static char *slub_debug_slabs;
329 333
@@ -888,38 +892,57 @@ fail:
888 892
889static int __init setup_slub_debug(char *str) 893static int __init setup_slub_debug(char *str)
890{ 894{
891 if (!str || *str != '=') 895 slub_debug = DEBUG_DEFAULT_FLAGS;
892 slub_debug = DEBUG_DEFAULT_FLAGS; 896 if (*str++ != '=' || !*str)
893 else { 897 /*
894 str++; 898 * No options specified. Switch on full debugging.
895 if (*str == 0 || *str == ',') 899 */
896 slub_debug = DEBUG_DEFAULT_FLAGS; 900 goto out;
897 else 901
898 for( ;*str && *str != ','; str++) 902 if (*str == ',')
899 switch (*str) { 903 /*
900 case 'f' : case 'F' : 904 * No options but restriction on slabs. This means full
901 slub_debug |= SLAB_DEBUG_FREE; 905 * debugging for slabs matching a pattern.
902 break; 906 */
903 case 'z' : case 'Z' : 907 goto check_slabs;
904 slub_debug |= SLAB_RED_ZONE; 908
905 break; 909 slub_debug = 0;
906 case 'p' : case 'P' : 910 if (*str == '-')
907 slub_debug |= SLAB_POISON; 911 /*
908 break; 912 * Switch off all debugging measures.
909 case 'u' : case 'U' : 913 */
910 slub_debug |= SLAB_STORE_USER; 914 goto out;
911 break; 915
912 case 't' : case 'T' : 916 /*
913 slub_debug |= SLAB_TRACE; 917 * Determine which debug features should be switched on
914 break; 918 */
915 default: 919 for ( ;*str && *str != ','; str++) {
916 printk(KERN_ERR "slub_debug option '%c' " 920 switch (tolower(*str)) {
917 "unknown. skipped\n",*str); 921 case 'f':
918 } 922 slub_debug |= SLAB_DEBUG_FREE;
923 break;
924 case 'z':
925 slub_debug |= SLAB_RED_ZONE;
926 break;
927 case 'p':
928 slub_debug |= SLAB_POISON;
929 break;
930 case 'u':
931 slub_debug |= SLAB_STORE_USER;
932 break;
933 case 't':
934 slub_debug |= SLAB_TRACE;
935 break;
936 default:
937 printk(KERN_ERR "slub_debug option '%c' "
938 "unknown. skipped\n",*str);
939 }
919 } 940 }
920 941
942check_slabs:
921 if (*str == ',') 943 if (*str == ',')
922 slub_debug_slabs = str + 1; 944 slub_debug_slabs = str + 1;
945out:
923 return 1; 946 return 1;
924} 947}
925 948