Re: kgdb: allow static kgdbts boot configuration

From: Andrew Morton
Date: Fri Apr 18 2008 - 18:26:41 EST


On Fri, 18 Apr 2008 19:00:57 GMT
Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx> wrote:

> Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=974460c5bfd9f6c38aa3dda189a63f9fc351035f
> Commit: 974460c5bfd9f6c38aa3dda189a63f9fc351035f
> Parent: e3e2aaf7dc0d82a055e084cfd48b9257c0c66b68
> Author: Jason Wessel <jason.wessel@xxxxxxxxxxxxx>
> AuthorDate: Thu Mar 20 13:43:44 2008 -0500
> Committer: Ingo Molnar <mingo@xxxxxxx>
> CommitDate: Thu Apr 17 20:05:43 2008 +0200
>
> kgdb: allow static kgdbts boot configuration
>
> This patch adds in the ability to compile the kgdb internal test
> string into the kernel so as to run the tests at boot without changing
> the kernel boot arguments. This patch also changes all the error
> paths to invoke WARN_ON(1) which will emit the line number of the file
> and dump the kernel stack when an error occurs.
>
> You can disable the tests in a kernel that is built this way
> using "kgdbts="
>
> ...
>
> +#ifdef CONFIG_KGDB_TESTS_BOOT_STRING
> +static char config[MAX_CONFIG_LEN] = CONFIG_KGDB_TESTS_BOOT_STRING;
> +#else
> static char config[MAX_CONFIG_LEN];
> +#endif

I expect that CONFIG_KGDB_TESTS_BOOT_STRING is always defined here. Or if
not, that it is possible to arrange for that with sufficient Kconfig
cleverness. If so, the ifdef shouldn't be needed.

> +config KGDB_TESTS_ON_BOOT
> + bool "KGDB: Run tests on boot"
> + depends on KGDB_TESTS
> + default n
> + help
> + Run the kgdb tests on boot up automatically without the need
> + to pass in a kernel parameter
> +
> +config KGDB_TESTS_BOOT_STRING
> + string "KGDB: which internal kgdb tests to run"
> + depends on KGDB_TESTS_ON_BOOT
> + default "V1F100"
> + help
> + This is the command string to send the kgdb test suite on
> + boot. See the drivers/misc/kgdbts.c for detailed
> + information about other strings you could use beyond the
> + default of V1F100.

I dunno. Do we *really* need this feature? I mean, if you want to run the
tests, you provide the boot parameter and that's it. Adding this
Kconfig-time stuff on top seems excessive.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/