From patchwork Mon Nov 5 18:43:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 197273 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 0763D2C007D for ; Tue, 6 Nov 2012 05:43:47 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TVReD-00022V-RY; Mon, 05 Nov 2012 18:43:45 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TVReB-00022M-94 for fwts-devel@lists.ubuntu.com; Mon, 05 Nov 2012 18:43:43 +0000 Received: from cpc3-craw6-2-0-cust180.croy.cable.virginmedia.com ([77.100.248.181] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1TVReB-0001vV-66 for fwts-devel@lists.ubuntu.com; Mon, 05 Nov 2012 18:43:43 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH] utilities: kernelscan: add in ACPI configs and more printk message types Date: Mon, 5 Nov 2012 18:43:42 +0000 Message-Id: <1352141022-15225-1-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.7.10.4 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: fwts-devel-bounces@lists.ubuntu.com Errors-To: fwts-devel-bounces@lists.ubuntu.com From: Colin Ian King 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 Acked-by: Keng-Yu Lin Acked-by: Alex Hung --- 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