From patchwork Mon May 21 09:11:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 10414417 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1E96960365 for ; Mon, 21 May 2018 09:10:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 115B02874E for ; Mon, 21 May 2018 09:10:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2D9D28769; Mon, 21 May 2018 09:10:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 742B628756 for ; Mon, 21 May 2018 09:10:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751111AbeEUJKm (ORCPT ); Mon, 21 May 2018 05:10:42 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:46118 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750945AbeEUJKl (ORCPT ); Mon, 21 May 2018 05:10:41 -0400 Received: from avalon.bb.dnainternet.fi (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6339D1BF6; Mon, 21 May 2018 11:10:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1526893840; bh=WFZ1GO2R70kZptZX08VvqfXPf4z4EO4Bmb0nFjoAvA8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ecj0KAWVuR1mbdnxFuZBdi8TrUppGJkNXXHtPH6eYmiusEbhVKCiZoOw2nSVRMemW ypLU3Ev93VAB+YWY448S2Fngf38C2wemVsd623ez2Bj+A5p2Susy4BR5CWXL++pdSK VI2VnB1NphGDhIRMak/YBcrgXXTc39t5Kbnhg/Nk= From: Laurent Pinchart To: linux-renesas-soc@vger.kernel.org Cc: kieran.bingham@ideasonboard.com Subject: [PATCH v2 1/2] vsp-lib: Capture the kernel log messages in test log files Date: Mon, 21 May 2018 12:11:01 +0300 Message-Id: <20180521091102.18764-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180521091102.18764-1-laurent.pinchart@ideasonboard.com> References: <20180521091102.18764-1-laurent.pinchart@ideasonboard.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It can be useful to capture kernel log messages in test log files for diagnostic purpose. Add a simple mechanism to do so by capturing the full kernel log at the end of the test. The kernel log is cleared first before starting the test to avoid capturing unrelated messages. Signed-off-by: Laurent Pinchart --- Changes since v1: - Don't clear the kernel log --- scripts/vsp-lib.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/vsp-lib.sh b/scripts/vsp-lib.sh index 0f3992a7827e..0ecdf9acb152 100755 --- a/scripts/vsp-lib.sh +++ b/scripts/vsp-lib.sh @@ -1080,12 +1080,18 @@ test_init() { test_start() { echo "Testing $1" | ./logger.sh >> $logfile echo -n "Testing $1: " >&2 + + # Store the marker for the last line of the kernel log. + marker=$(dmesg | tail -n 1 | sed 's/^\[\([^]]*\)\].*/\1/g') } test_complete() { echo "Done: $1" | ./logger.sh >> $logfile echo $1 >&2 + # Capture the part of the kernel log relative to the test. + dmesg | sed "1,/$marker/d" | ./logger.sh kernel >> $logfile + rm -f ${frames_dir}frame-*.bin rm -f ${frames_dir}histo-*.bin rm -f ${frames_dir}rpf.*.bin