History

kdb: Remove the misfeature 'KDBFLAGS'

Currently, 'KDBFLAGS' is an internal variable of kdb, it is combined by 'KDBDEBUG' and state flags. It will be shown only when 'KDBDEBUG' is set, and the user can define an environment variable named 'KDBFLAGS' too. These are puzzling indeed. After communication with Daniel, it seems that 'KDBFLAGS' is a misfeature. So let's replace 'KDBFLAGS' with 'KDBDEBUG' to just show the value we wrote into. After this modification, we can use `md4c1 kdb_flags` instead, to observe the state flags.

Wei Li committed 6 years ago

Commit c893de11 parent 1b310032 files · +5 −5Browse files

Unified · Split

2 files
  1. include/linux/kdb.h +1 −1
  2. kernel/debug/kdb/kdb_main.c +4 −4
include/linux/kdb.h+1−1
@@ -125,7 +125,7 @@ extern const char *kdb_diemsg; · 124 unmodified lines
125125 #define KDB_FLAG_NO_I8042 (1 << 7) /* No i8042 chip is available, do
126126 * not use keyboard */
127127
128−extern int kdb_flags; /* Global flags, see kdb_state for per cpu state */
128+extern unsigned int kdb_flags; /* Global flags, see kdb_state for per cpu state */
129129
130130 extern void kdb_save_flags(void);
131131 extern void kdb_restore_flags(void);
kernel/debug/kdb/kdb_main.c+4−4
@@ -62,7 +62,7 @@ int kdb_grep_trailing; · 61 unmodified lines
6262 /*
6363 * Kernel debugger state flags
6464 */
65−int kdb_flags;
65+unsigned int kdb_flags;
6666
6767 /*
6868 * kdb_lock protects updates to kdb_initial_cpu. Used to
@@ -418,8 +418,7 @@ int kdb_set(int argc, const char **argv) · 349 unmodified lines
418418 argv[2]);
419419 return 0;
420420 }
421− kdb_flags = (kdb_flags &
422− ~(KDB_DEBUG_FLAG_MASK << KDB_DEBUG_FLAG_SHIFT))
421+ kdb_flags = (kdb_flags & ~KDB_DEBUG(MASK))
423422 | (debugflags << KDB_DEBUG_FLAG_SHIFT);
424423
425424 return 0;
@@ -2082,7 +2081,8 @@ static int kdb_env(int argc, const char **argv) · 1656 unmodified lines
20822081 }
20832082
20842083 if (KDB_DEBUG(MASK))
2085− kdb_printf("KDBFLAGS=0x%x\n", kdb_flags);
2084+ kdb_printf("KDBDEBUG=0x%x\n",
2085+ (kdb_flags & KDB_DEBUG(MASK)) >> KDB_DEBUG_FLAG_SHIFT);
20862086
20872087 return 0;
20882088 }