[PATCH] utilities: kernelscan: add in ACPI configs and more printk message types
Colin King
colin.king at canonical.com
Mon Nov 5 18:43:42 UTC 2012
From: Colin Ian King <colin.king at canonical.com>
We also should set some typical ACPI config settings so we don't throw
aways code in the CPP stage. Also add scanning for KERN_CRIT and
KERN_EMERG messages too.
Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
src/utilities/kernelscan.c | 5 +++--
src/utilities/kernelscan.sh | 9 ++++++++-
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/utilities/kernelscan.c b/src/utilities/kernelscan.c
index 67d623b..c2d60d9 100644
--- a/src/utilities/kernelscan.c
+++ b/src/utilities/kernelscan.c
@@ -798,11 +798,12 @@ static int parse_kernel_message(parser *p, token *t)
if (printk &&
(t->type == TOKEN_IDENTIFIER) &&
(prev_token_type == TOKEN_PAREN_OPENED) &&
- (strcmp(t->token, "KERN_ERR") == 0)) {
+ ((strcmp(t->token, "KERN_ERR") == 0) ||
+ (strcmp(t->token, "KERN_CRIT") == 0) ||
+ (strcmp(t->token, "KERN_EMERG") == 0))) {
emit = true;
}
-
if (t->type == TOKEN_LITERAL_STRING) {
literal_strip_quotes(t);
str = strdupcat(str, t->token);
diff --git a/src/utilities/kernelscan.sh b/src/utilities/kernelscan.sh
index ed402d9..a4296ac 100755
--- a/src/utilities/kernelscan.sh
+++ b/src/utilities/kernelscan.sh
@@ -17,6 +17,13 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
+CONFIGS="-DCONFIG_ACPI_HOTPLUG_CPU -DCONFIG_ACPI_PROC_EVENT \
+ -DCONFIG_ACPI_PROCFS_POWER -DCONFIG_ACPI_SLEEP \
+ -DCONFIG_CPU_FREQ -DCONFIG_DMI -DCONFIG_HIBERNATION \
+ -DCONFIG_HOTPLUG_CPU -DCONFIG_KEXEC -DCONFIG_NET \
+ -DCONFIG_PM -DCONFIG_PM_SLEEP -DCONFIG_SMP \
+ -DCONFIG_SUSPEND -DCONFIG_X86 -DCONFIG_X86_IO_APIC"
+
KERNELSCAN=./kernelscan
TMP=/tmp/kernelscan_$$.txt
@@ -34,7 +41,7 @@ fi
scan_source_file()
{
- $KERNELSCAN < $1 -E | gcc -E - | $KERNELSCAN -P > $TMP
+ $KERNELSCAN < $1 -E | gcc -E $CONFIGS - | $KERNELSCAN -P > $TMP
if [ $(stat -c%s $TMP) -gt 0 ]; then
echo "Source: $1"
cat $TMP
--
1.7.10.4
More information about the fwts-devel
mailing list