[PATCH] lib: fwts_dump: add cpuinfo dump

Alex Hung alex.hung at canonical.com
Tue Jun 17 00:33:31 UTC 2014


When running fwts-live, it is sometimes difficult to analyze the results
without the cpu information. This patch includes cpuinfo from /proc/cpuinfo

Signed-off-by: Alex Hung <alex.hung at canonical.com>
---
 src/lib/src/fwts_dump.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/lib/src/fwts_dump.c b/src/lib/src/fwts_dump.c
index 8c59f57..cb46371 100644
--- a/src/lib/src/fwts_dump.c
+++ b/src/lib/src/fwts_dump.c
@@ -222,6 +222,17 @@ static int dump_readme(void)
 }
 
 /*
+ *  dump_cpuinfo()
+ *	read cpuinfo, dump to path/filename
+ */
+static int dump_cpuinfo(void)
+{
+	char *command = "cat /proc/cpuinfo";
+
+	return dump_exec("cpuinfo.log", command);
+}
+
+/*
  *  fwts_dump_info()
  *	dump various system specific information:
  *	kernel log, dmidecode output, lspci output,
@@ -273,5 +284,10 @@ int fwts_dump_info(fwts_framework *fw)
 	} else
 		fprintf(stderr, "Need root privilege to dump ACPI tables.\n");
 
+	if (dump_cpuinfo() != FWTS_OK)
+		fprintf(stderr, "Failed to dump cpuinfo.\n");
+	else
+		printf("Dumping cpuinfo to cpuinfo.log\n");
+
 	return FWTS_OK;
 }
-- 
1.9.1




More information about the fwts-devel mailing list