Patchwork kernel: version: gather kernel boot command line

login
register
mail settings
Submitter Colin King
Date Jan. 22, 2013, 12:03 p.m.
Message ID <1358856189-21776-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/214536/
State Accepted
Headers show

Comments

Colin King - Jan. 22, 2013, 12:03 p.m.
From: Colin Ian King <colin.king@canonical.com>

We're seeing some logs where fwts is being used with BIOS or ACPI
options being tweaked by users and it would be very helpful if fwts
can gather this information in the log.

Add this to the kernel version information gathering test, insert it
before the kernel ACPI version subtest.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/kernel/version/version.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
Keng-Yu Lin - Jan. 29, 2013, 6:30 a.m.
On Tue, Jan 22, 2013 at 8:03 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> We're seeing some logs where fwts is being used with BIOS or ACPI
> options being tweaked by users and it would be very helpful if fwts
> can gather this information in the log.
>
> Add this to the kernel version information gathering test, insert it
> before the kernel ACPI version subtest.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/kernel/version/version.c | 19 ++++++++++++++++++-
>  1 file changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/src/kernel/version/version.c b/src/kernel/version/version.c
> index 3c7fb29..0485ece 100644
> --- a/src/kernel/version/version.c
> +++ b/src/kernel/version/version.c
> @@ -61,6 +61,22 @@ static int version_test3(fwts_framework *fw)
>  {
>         char *str;
>
> +       if ((str = fwts_get("/proc/cmdline")) == NULL)
> +               fwts_log_info(fw, "Cannot get version info from /proc/cmdline");
> +       else {
> +               fwts_chop_newline(str);
> +               fwts_log_info(fw, "Kernel boot command line: %s", str);
> +               free(str);
> +       }
> +       fwts_infoonly(fw);
> +
> +       return FWTS_OK;
> +}
> +
> +static int version_test4(fwts_framework *fw)
> +{
> +       char *str;
> +
>          if (((str = fwts_get("/sys/module/acpi/parameters/acpica_version")) == NULL) &&
>             ((str = fwts_get("/proc/acpi/info")) == NULL))
>                 fwts_log_info(fw,
> @@ -80,7 +96,8 @@ static int version_test3(fwts_framework *fw)
>  static fwts_framework_minor_test version_tests[] = {
>         { version_test1, "Gather kernel signature." },
>         { version_test2, "Gather kernel system information." },
> -       { version_test3, "Gather APCI driver version." },
> +       { version_test3, "Gather kernel boot command line." },
> +       { version_test4, "Gather APCI driver version." },
>         { NULL, NULL },
>  };
>
> --
> 1.8.0
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Alex Hung - Jan. 31, 2013, 6:20 a.m.
On 01/22/2013 08:03 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> We're seeing some logs where fwts is being used with BIOS or ACPI
> options being tweaked by users and it would be very helpful if fwts
> can gather this information in the log.
>
> Add this to the kernel version information gathering test, insert it
> before the kernel ACPI version subtest.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/kernel/version/version.c | 19 ++++++++++++++++++-
>   1 file changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/src/kernel/version/version.c b/src/kernel/version/version.c
> index 3c7fb29..0485ece 100644
> --- a/src/kernel/version/version.c
> +++ b/src/kernel/version/version.c
> @@ -61,6 +61,22 @@ static int version_test3(fwts_framework *fw)
>   {
>   	char *str;
>
> +	if ((str = fwts_get("/proc/cmdline")) == NULL)
> +		fwts_log_info(fw, "Cannot get version info from /proc/cmdline");
> +	else {
> +		fwts_chop_newline(str);
> +		fwts_log_info(fw, "Kernel boot command line: %s", str);
> +		free(str);
> +	}
> +	fwts_infoonly(fw);
> +
> +	return FWTS_OK;
> +}
> +
> +static int version_test4(fwts_framework *fw)
> +{
> +	char *str;
> +
>           if (((str = fwts_get("/sys/module/acpi/parameters/acpica_version")) == NULL) &&
>   	    ((str = fwts_get("/proc/acpi/info")) == NULL))
>   		fwts_log_info(fw,
> @@ -80,7 +96,8 @@ static int version_test3(fwts_framework *fw)
>   static fwts_framework_minor_test version_tests[] = {
>   	{ version_test1, "Gather kernel signature." },
>   	{ version_test2, "Gather kernel system information." },
> -	{ version_test3, "Gather APCI driver version." },
> +	{ version_test3, "Gather kernel boot command line." },
> +	{ version_test4, "Gather APCI driver version." },
>   	{ NULL, NULL },
>   };
>
>

I think it should be "ACPI" above, shouldn't it?

Other than that, I think it's is good.

Acked-by: Alex Hung <alex.hung@canonical.com>

Patch

diff --git a/src/kernel/version/version.c b/src/kernel/version/version.c
index 3c7fb29..0485ece 100644
--- a/src/kernel/version/version.c
+++ b/src/kernel/version/version.c
@@ -61,6 +61,22 @@  static int version_test3(fwts_framework *fw)
 {
 	char *str;
 
+	if ((str = fwts_get("/proc/cmdline")) == NULL)
+		fwts_log_info(fw, "Cannot get version info from /proc/cmdline");
+	else {
+		fwts_chop_newline(str);
+		fwts_log_info(fw, "Kernel boot command line: %s", str);
+		free(str);
+	}
+	fwts_infoonly(fw);
+
+	return FWTS_OK;
+}
+
+static int version_test4(fwts_framework *fw)
+{
+	char *str;
+
         if (((str = fwts_get("/sys/module/acpi/parameters/acpica_version")) == NULL) &&
 	    ((str = fwts_get("/proc/acpi/info")) == NULL))
 		fwts_log_info(fw,
@@ -80,7 +96,8 @@  static int version_test3(fwts_framework *fw)
 static fwts_framework_minor_test version_tests[] = {
 	{ version_test1, "Gather kernel signature." },
 	{ version_test2, "Gather kernel system information." },
-	{ version_test3, "Gather APCI driver version." },
+	{ version_test3, "Gather kernel boot command line." },
+	{ version_test4, "Gather APCI driver version." },
 	{ NULL, NULL },
 };