diff mbox

klog: move from acpi to kernel directory

Message ID 1371361542-21612-1-git-send-email-colin.king@canonical.com
State Accepted
Headers show

Commit Message

Colin Ian King June 16, 2013, 5:45 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

klog test original had a lot of ACPI specific checks but now it
is more of a generic firmware kernel message checking test so
it makes sense to move it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/Makefile.am        |  2 +-
 src/acpi/klog/klog.c   | 88 --------------------------------------------------
 src/kernel/klog/klog.c | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 89 insertions(+), 89 deletions(-)
 delete mode 100644 src/acpi/klog/klog.c
 create mode 100644 src/kernel/klog/klog.c

Comments

Alex Hung June 17, 2013, 2:57 a.m. UTC | #1
On 06/16/2013 01:45 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> klog test original had a lot of ACPI specific checks but now it
> is more of a generic firmware kernel message checking test so
> it makes sense to move it.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/Makefile.am        |  2 +-
>   src/acpi/klog/klog.c   | 88 --------------------------------------------------
>   src/kernel/klog/klog.c | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++
>   3 files changed, 89 insertions(+), 89 deletions(-)
>   delete mode 100644 src/acpi/klog/klog.c
>   create mode 100644 src/kernel/klog/klog.c
>
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 50fb2c6..4614a9b 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -33,7 +33,6 @@ fwts_SOURCES = main.c 				\
>   	acpi/dmar/dmar.c 			\
>   	acpi/fadt/fadt.c 			\
>   	acpi/fan/fan.c 				\
> -	acpi/klog/klog.c 			\
>   	acpi/lid/lid.c 				\
>   	acpi/mcfg/mcfg.c 			\
>   	acpi/method/method.c 			\
> @@ -72,6 +71,7 @@ fwts_SOURCES = main.c 				\
>   	dmi/dmi_decode/dmi_decode.c 		\
>   	hotkey/hotkey/hotkey.c 			\
>   	hpet/hpet_check/hpet_check.c 		\
> +	kernel/klog/klog.c 			\
>   	kernel/oops/oops.c 			\
>   	kernel/version/version.c 		\
>   	pci/aspm/aspm.c 			\
> diff --git a/src/acpi/klog/klog.c b/src/acpi/klog/klog.c
> deleted file mode 100644
> index f0ce114..0000000
> --- a/src/acpi/klog/klog.c
> +++ /dev/null
> @@ -1,88 +0,0 @@
> -/*
> - * Copyright (C) 2010-2013 Canonical
> - *
> - * This program is free software; you can redistribute it and/or
> - * modify it under the terms of the GNU General Public License
> - * as published by the Free Software Foundation; either version 2
> - * of the License, or (at your option) any later version.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> - * GNU General Public License for more details.
> - *
> - * You should have received a copy of the GNU General Public License
> - * along with this program; if not, write to the Free Software
> - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
> - *
> - */
> -#include "fwts.h"
> -
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <sys/types.h>
> -#include <sys/stat.h>
> -#include <unistd.h>
> -
> -static fwts_list *klog;
> -
> -static int klog_init(fwts_framework *fw)
> -{
> -	if (fw->klog)
> -		klog = fwts_file_open_and_read(fw->klog);
> -	else
> -		klog = fwts_klog_read();
> -
> -	if (klog == NULL) {
> -		fwts_log_error(fw, "Cannot read kernel log.");
> -		return FWTS_ERROR;
> -	}
> -	return FWTS_OK;
> -}
> -
> -static int klog_deinit(fwts_framework *fw)
> -{
> -	FWTS_UNUSED(fw);
> -
> -	fwts_klog_free(klog);
> -
> -	return FWTS_OK;
> -}
> -
> -static void klog_progress(fwts_framework *fw, int progress)
> -{
> -	fwts_progress(fw, progress);
> -}
> -
> -static int klog_test1(fwts_framework *fw)
> -{
> -	int errors = 0;
> -
> -	if (fwts_klog_firmware_check(fw, klog_progress, klog, &errors)) {
> -		fwts_log_error(fw, "Error parsing kernel log.");
> -		return FWTS_ERROR;
> -	}
> -
> -	if (errors > 0)
> -		/* Checks will log errors as failures automatically */
> -		fwts_log_info(fw, "Found %d unique errors in kernel log.",
> -			errors);
> -	else
> -		fwts_passed(fw, "Found no errors in kernel log.");
> -
> -	return FWTS_OK;
> -}
> -
> -static fwts_framework_minor_test klog_tests[] = {
> -	{ klog_test1, "Kernel log error check." },
> -	{ NULL, NULL }
> -};
> -
> -static fwts_framework_ops klog_ops = {
> -	.description = "Scan kernel log for errors and warnings.",
> -	.init        = klog_init,
> -	.deinit      = klog_deinit,
> -	.minor_tests = klog_tests
> -};
> -
> -FWTS_REGISTER("klog", &klog_ops, FWTS_TEST_EARLY, FWTS_FLAG_BATCH);
> diff --git a/src/kernel/klog/klog.c b/src/kernel/klog/klog.c
> new file mode 100644
> index 0000000..f0ce114
> --- /dev/null
> +++ b/src/kernel/klog/klog.c
> @@ -0,0 +1,88 @@
> +/*
> + * Copyright (C) 2010-2013 Canonical
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation; either version 2
> + * of the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
> + *
> + */
> +#include "fwts.h"
> +
> +#include <stdlib.h>
> +#include <stdio.h>
> +#include <sys/types.h>
> +#include <sys/stat.h>
> +#include <unistd.h>
> +
> +static fwts_list *klog;
> +
> +static int klog_init(fwts_framework *fw)
> +{
> +	if (fw->klog)
> +		klog = fwts_file_open_and_read(fw->klog);
> +	else
> +		klog = fwts_klog_read();
> +
> +	if (klog == NULL) {
> +		fwts_log_error(fw, "Cannot read kernel log.");
> +		return FWTS_ERROR;
> +	}
> +	return FWTS_OK;
> +}
> +
> +static int klog_deinit(fwts_framework *fw)
> +{
> +	FWTS_UNUSED(fw);
> +
> +	fwts_klog_free(klog);
> +
> +	return FWTS_OK;
> +}
> +
> +static void klog_progress(fwts_framework *fw, int progress)
> +{
> +	fwts_progress(fw, progress);
> +}
> +
> +static int klog_test1(fwts_framework *fw)
> +{
> +	int errors = 0;
> +
> +	if (fwts_klog_firmware_check(fw, klog_progress, klog, &errors)) {
> +		fwts_log_error(fw, "Error parsing kernel log.");
> +		return FWTS_ERROR;
> +	}
> +
> +	if (errors > 0)
> +		/* Checks will log errors as failures automatically */
> +		fwts_log_info(fw, "Found %d unique errors in kernel log.",
> +			errors);
> +	else
> +		fwts_passed(fw, "Found no errors in kernel log.");
> +
> +	return FWTS_OK;
> +}
> +
> +static fwts_framework_minor_test klog_tests[] = {
> +	{ klog_test1, "Kernel log error check." },
> +	{ NULL, NULL }
> +};
> +
> +static fwts_framework_ops klog_ops = {
> +	.description = "Scan kernel log for errors and warnings.",
> +	.init        = klog_init,
> +	.deinit      = klog_deinit,
> +	.minor_tests = klog_tests
> +};
> +
> +FWTS_REGISTER("klog", &klog_ops, FWTS_TEST_EARLY, FWTS_FLAG_BATCH);
>

Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu June 20, 2013, 7:45 a.m. UTC | #2
On 06/16/2013 01:45 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> klog test original had a lot of ACPI specific checks but now it
> is more of a generic firmware kernel message checking test so
> it makes sense to move it.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/Makefile.am        |  2 +-
>   src/acpi/klog/klog.c   | 88 --------------------------------------------------
>   src/kernel/klog/klog.c | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++
>   3 files changed, 89 insertions(+), 89 deletions(-)
>   delete mode 100644 src/acpi/klog/klog.c
>   create mode 100644 src/kernel/klog/klog.c
>
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 50fb2c6..4614a9b 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -33,7 +33,6 @@ fwts_SOURCES = main.c 				\
>   	acpi/dmar/dmar.c 			\
>   	acpi/fadt/fadt.c 			\
>   	acpi/fan/fan.c 				\
> -	acpi/klog/klog.c 			\
>   	acpi/lid/lid.c 				\
>   	acpi/mcfg/mcfg.c 			\
>   	acpi/method/method.c 			\
> @@ -72,6 +71,7 @@ fwts_SOURCES = main.c 				\
>   	dmi/dmi_decode/dmi_decode.c 		\
>   	hotkey/hotkey/hotkey.c 			\
>   	hpet/hpet_check/hpet_check.c 		\
> +	kernel/klog/klog.c 			\
>   	kernel/oops/oops.c 			\
>   	kernel/version/version.c 		\
>   	pci/aspm/aspm.c 			\
> diff --git a/src/acpi/klog/klog.c b/src/acpi/klog/klog.c
> deleted file mode 100644
> index f0ce114..0000000
> --- a/src/acpi/klog/klog.c
> +++ /dev/null
> @@ -1,88 +0,0 @@
> -/*
> - * Copyright (C) 2010-2013 Canonical
> - *
> - * This program is free software; you can redistribute it and/or
> - * modify it under the terms of the GNU General Public License
> - * as published by the Free Software Foundation; either version 2
> - * of the License, or (at your option) any later version.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> - * GNU General Public License for more details.
> - *
> - * You should have received a copy of the GNU General Public License
> - * along with this program; if not, write to the Free Software
> - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
> - *
> - */
> -#include "fwts.h"
> -
> -#include <stdlib.h>
> -#include <stdio.h>
> -#include <sys/types.h>
> -#include <sys/stat.h>
> -#include <unistd.h>
> -
> -static fwts_list *klog;
> -
> -static int klog_init(fwts_framework *fw)
> -{
> -	if (fw->klog)
> -		klog = fwts_file_open_and_read(fw->klog);
> -	else
> -		klog = fwts_klog_read();
> -
> -	if (klog == NULL) {
> -		fwts_log_error(fw, "Cannot read kernel log.");
> -		return FWTS_ERROR;
> -	}
> -	return FWTS_OK;
> -}
> -
> -static int klog_deinit(fwts_framework *fw)
> -{
> -	FWTS_UNUSED(fw);
> -
> -	fwts_klog_free(klog);
> -
> -	return FWTS_OK;
> -}
> -
> -static void klog_progress(fwts_framework *fw, int progress)
> -{
> -	fwts_progress(fw, progress);
> -}
> -
> -static int klog_test1(fwts_framework *fw)
> -{
> -	int errors = 0;
> -
> -	if (fwts_klog_firmware_check(fw, klog_progress, klog, &errors)) {
> -		fwts_log_error(fw, "Error parsing kernel log.");
> -		return FWTS_ERROR;
> -	}
> -
> -	if (errors > 0)
> -		/* Checks will log errors as failures automatically */
> -		fwts_log_info(fw, "Found %d unique errors in kernel log.",
> -			errors);
> -	else
> -		fwts_passed(fw, "Found no errors in kernel log.");
> -
> -	return FWTS_OK;
> -}
> -
> -static fwts_framework_minor_test klog_tests[] = {
> -	{ klog_test1, "Kernel log error check." },
> -	{ NULL, NULL }
> -};
> -
> -static fwts_framework_ops klog_ops = {
> -	.description = "Scan kernel log for errors and warnings.",
> -	.init        = klog_init,
> -	.deinit      = klog_deinit,
> -	.minor_tests = klog_tests
> -};
> -
> -FWTS_REGISTER("klog", &klog_ops, FWTS_TEST_EARLY, FWTS_FLAG_BATCH);
> diff --git a/src/kernel/klog/klog.c b/src/kernel/klog/klog.c
> new file mode 100644
> index 0000000..f0ce114
> --- /dev/null
> +++ b/src/kernel/klog/klog.c
> @@ -0,0 +1,88 @@
> +/*
> + * Copyright (C) 2010-2013 Canonical
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation; either version 2
> + * of the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
> + *
> + */
> +#include "fwts.h"
> +
> +#include <stdlib.h>
> +#include <stdio.h>
> +#include <sys/types.h>
> +#include <sys/stat.h>
> +#include <unistd.h>
> +
> +static fwts_list *klog;
> +
> +static int klog_init(fwts_framework *fw)
> +{
> +	if (fw->klog)
> +		klog = fwts_file_open_and_read(fw->klog);
> +	else
> +		klog = fwts_klog_read();
> +
> +	if (klog == NULL) {
> +		fwts_log_error(fw, "Cannot read kernel log.");
> +		return FWTS_ERROR;
> +	}
> +	return FWTS_OK;
> +}
> +
> +static int klog_deinit(fwts_framework *fw)
> +{
> +	FWTS_UNUSED(fw);
> +
> +	fwts_klog_free(klog);
> +
> +	return FWTS_OK;
> +}
> +
> +static void klog_progress(fwts_framework *fw, int progress)
> +{
> +	fwts_progress(fw, progress);
> +}
> +
> +static int klog_test1(fwts_framework *fw)
> +{
> +	int errors = 0;
> +
> +	if (fwts_klog_firmware_check(fw, klog_progress, klog, &errors)) {
> +		fwts_log_error(fw, "Error parsing kernel log.");
> +		return FWTS_ERROR;
> +	}
> +
> +	if (errors > 0)
> +		/* Checks will log errors as failures automatically */
> +		fwts_log_info(fw, "Found %d unique errors in kernel log.",
> +			errors);
> +	else
> +		fwts_passed(fw, "Found no errors in kernel log.");
> +
> +	return FWTS_OK;
> +}
> +
> +static fwts_framework_minor_test klog_tests[] = {
> +	{ klog_test1, "Kernel log error check." },
> +	{ NULL, NULL }
> +};
> +
> +static fwts_framework_ops klog_ops = {
> +	.description = "Scan kernel log for errors and warnings.",
> +	.init        = klog_init,
> +	.deinit      = klog_deinit,
> +	.minor_tests = klog_tests
> +};
> +
> +FWTS_REGISTER("klog", &klog_ops, FWTS_TEST_EARLY, FWTS_FLAG_BATCH);
>

Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox

Patch

diff --git a/src/Makefile.am b/src/Makefile.am
index 50fb2c6..4614a9b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -33,7 +33,6 @@  fwts_SOURCES = main.c 				\
 	acpi/dmar/dmar.c 			\
 	acpi/fadt/fadt.c 			\
 	acpi/fan/fan.c 				\
-	acpi/klog/klog.c 			\
 	acpi/lid/lid.c 				\
 	acpi/mcfg/mcfg.c 			\
 	acpi/method/method.c 			\
@@ -72,6 +71,7 @@  fwts_SOURCES = main.c 				\
 	dmi/dmi_decode/dmi_decode.c 		\
 	hotkey/hotkey/hotkey.c 			\
 	hpet/hpet_check/hpet_check.c 		\
+	kernel/klog/klog.c 			\
 	kernel/oops/oops.c 			\
 	kernel/version/version.c 		\
 	pci/aspm/aspm.c 			\
diff --git a/src/acpi/klog/klog.c b/src/acpi/klog/klog.c
deleted file mode 100644
index f0ce114..0000000
--- a/src/acpi/klog/klog.c
+++ /dev/null
@@ -1,88 +0,0 @@ 
-/*
- * Copyright (C) 2010-2013 Canonical
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-#include "fwts.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-static fwts_list *klog;
-
-static int klog_init(fwts_framework *fw)
-{
-	if (fw->klog)
-		klog = fwts_file_open_and_read(fw->klog);
-	else
-		klog = fwts_klog_read();
-
-	if (klog == NULL) {
-		fwts_log_error(fw, "Cannot read kernel log.");
-		return FWTS_ERROR;
-	}
-	return FWTS_OK;
-}
-
-static int klog_deinit(fwts_framework *fw)
-{
-	FWTS_UNUSED(fw);
-
-	fwts_klog_free(klog);
-
-	return FWTS_OK;
-}
-
-static void klog_progress(fwts_framework *fw, int progress)
-{
-	fwts_progress(fw, progress);
-}
-
-static int klog_test1(fwts_framework *fw)
-{
-	int errors = 0;
-
-	if (fwts_klog_firmware_check(fw, klog_progress, klog, &errors)) {
-		fwts_log_error(fw, "Error parsing kernel log.");
-		return FWTS_ERROR;
-	}
-
-	if (errors > 0) 
-		/* Checks will log errors as failures automatically */
-		fwts_log_info(fw, "Found %d unique errors in kernel log.",
-			errors);
-	else
-		fwts_passed(fw, "Found no errors in kernel log.");
-
-	return FWTS_OK;
-}
-
-static fwts_framework_minor_test klog_tests[] = {
-	{ klog_test1, "Kernel log error check." },
-	{ NULL, NULL }
-};
-
-static fwts_framework_ops klog_ops = {
-	.description = "Scan kernel log for errors and warnings.",
-	.init        = klog_init,
-	.deinit      = klog_deinit,
-	.minor_tests = klog_tests
-};
-
-FWTS_REGISTER("klog", &klog_ops, FWTS_TEST_EARLY, FWTS_FLAG_BATCH);
diff --git a/src/kernel/klog/klog.c b/src/kernel/klog/klog.c
new file mode 100644
index 0000000..f0ce114
--- /dev/null
+++ b/src/kernel/klog/klog.c
@@ -0,0 +1,88 @@ 
+/*
+ * Copyright (C) 2010-2013 Canonical
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+#include "fwts.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+static fwts_list *klog;
+
+static int klog_init(fwts_framework *fw)
+{
+	if (fw->klog)
+		klog = fwts_file_open_and_read(fw->klog);
+	else
+		klog = fwts_klog_read();
+
+	if (klog == NULL) {
+		fwts_log_error(fw, "Cannot read kernel log.");
+		return FWTS_ERROR;
+	}
+	return FWTS_OK;
+}
+
+static int klog_deinit(fwts_framework *fw)
+{
+	FWTS_UNUSED(fw);
+
+	fwts_klog_free(klog);
+
+	return FWTS_OK;
+}
+
+static void klog_progress(fwts_framework *fw, int progress)
+{
+	fwts_progress(fw, progress);
+}
+
+static int klog_test1(fwts_framework *fw)
+{
+	int errors = 0;
+
+	if (fwts_klog_firmware_check(fw, klog_progress, klog, &errors)) {
+		fwts_log_error(fw, "Error parsing kernel log.");
+		return FWTS_ERROR;
+	}
+
+	if (errors > 0) 
+		/* Checks will log errors as failures automatically */
+		fwts_log_info(fw, "Found %d unique errors in kernel log.",
+			errors);
+	else
+		fwts_passed(fw, "Found no errors in kernel log.");
+
+	return FWTS_OK;
+}
+
+static fwts_framework_minor_test klog_tests[] = {
+	{ klog_test1, "Kernel log error check." },
+	{ NULL, NULL }
+};
+
+static fwts_framework_ops klog_ops = {
+	.description = "Scan kernel log for errors and warnings.",
+	.init        = klog_init,
+	.deinit      = klog_deinit,
+	.minor_tests = klog_tests
+};
+
+FWTS_REGISTER("klog", &klog_ops, FWTS_TEST_EARLY, FWTS_FLAG_BATCH);