From patchwork Mon Jul 30 01:48:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Mendoza-Jonas X-Patchwork-Id: 950703 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41f2Yf48gZz9s0R for ; Mon, 30 Jul 2018 11:49:26 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=mendozajonas.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="GcobGGbC"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="YpoRSv5X"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41f2Yf2TdMzF162 for ; Mon, 30 Jul 2018 11:49:26 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=mendozajonas.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="GcobGGbC"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="YpoRSv5X"; dkim-atps=neutral X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=mendozajonas.com (client-ip=64.147.123.19; helo=wout3-smtp.messagingengine.com; envelope-from=sam@mendozajonas.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=mendozajonas.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="GcobGGbC"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="YpoRSv5X"; dkim-atps=neutral Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41f2Y75GjvzF12X for ; Mon, 30 Jul 2018 11:48:58 +1000 (AEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 017EB457; Sun, 29 Jul 2018 21:48:52 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 29 Jul 2018 21:48:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= mendozajonas.com; h=cc:date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=rbMXVtOW309Z7ng0I DL4LYYSszgbS5tpsxyC0uQ1mRM=; b=GcobGGbCAE4xp34vQ2R18XNE4VYVST0A3 1pabjCKOFdaz2twWZrfTB0kBA06GCD1h8CGsS7JfagRo/oH5Q9djgNmzj5NNfwSF NDvEHvbDgqXEF4c+PvyP8LrQlIIJOAyL8pl/rmz2AuEbxlpVla0wwrrmoSQNjZs5 ZRFWJapWr6BAWuxb7UiBF9BnmxtLulL10GVhj0sgVhATvZDKr50PMDE6SzEeeYFU FuH3lyc5MlX1Xy4AQKbStSBWqJhIcwg3kCDGxnbvCjG2FaRUpnLyQJ/m3xIjZ4Jz 95ju5XU0FQZg7SCjlLYTTulZNeeOMG8n/+r2rsm4O4KhgcimuQ/vQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=rbMXVtOW309Z7ng0I DL4LYYSszgbS5tpsxyC0uQ1mRM=; b=YpoRSv5XjNC8ujitZ0DjMFs69BiGLsecV 8FkuJPFxPZQ8U0D/v4Puo5n77okAlQ+tPIewij2QSatdllQMH4XhMwPwBrYapqs2 VY3EMejBDoKpdpXFs1W76EPyuTwbC8S+u1xhQ1dD8Rw1T6Xohds6q0JhHJVP5Mac kA8JlJd96Qgzgc54Lu1TYaigNyELqbcN7DgpKb4PHXQZ+gUJGwUdonbdVSfrs90S PBUjtPd19YmGk4ponEymOpYWK2QXXyUFET/qVpDzKjp/E+l6/7OfAQVwoB+o549V NryVdclntFno4eBM730qO2cC51cLPS5uPeBr4+/Tp5WReMgp8cY0Q== X-ME-Proxy: X-ME-Sender: Received: from v4.ozlabs.ibm.com (unknown [122.99.82.10]) by mail.messagingengine.com (Postfix) with ESMTPA id DD38FE4116; Sun, 29 Jul 2018 21:48:50 -0400 (EDT) From: Samuel Mendoza-Jonas To: petitboot@lists.ozlabs.org Subject: [PATCH 1/3] lib/log: Include timestamp prefix Date: Mon, 30 Jul 2018 11:48:24 +1000 Message-Id: <20180730014826.19097-1-sam@mendozajonas.com> X-Mailer: git-send-email 2.18.0 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Samuel Mendoza-Jonas MIME-Version: 1.0 Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" The relative time between logged events is very useful during debugging, particularly when debugging autoboot failures. Prepend a short HH:MM:SS timestamp to each line logged. Signed-off-by: Samuel Mendoza-Jonas --- lib/log/log.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/log/log.c b/lib/log/log.c index 44543d0..adb2078 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -1,6 +1,8 @@ #include #include +#include +#include #include "log.h" @@ -9,8 +11,17 @@ static bool debug; static void __log(const char *fmt, va_list ap) { + char hms[20] = {'\0'}; + time_t t; + if (!logf) return; + + /* Add timestamp */ + t = time(NULL); + strftime(hms, sizeof(hms), "%T", localtime(&t)); + fprintf(logf, "[%s] ", hms); + vfprintf(logf, fmt, ap); fflush(logf); } From patchwork Mon Jul 30 01:48:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Mendoza-Jonas X-Patchwork-Id: 950701 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41f2YL3Lz1z9s0w for ; Mon, 30 Jul 2018 11:49:10 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=mendozajonas.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="Y8RwfR2Y"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="kgtgDovu"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41f2YL1sKJzF162 for ; Mon, 30 Jul 2018 11:49:10 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=mendozajonas.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="Y8RwfR2Y"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="kgtgDovu"; dkim-atps=neutral X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=mendozajonas.com (client-ip=64.147.123.19; helo=wout3-smtp.messagingengine.com; envelope-from=sam@mendozajonas.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=mendozajonas.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="Y8RwfR2Y"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="kgtgDovu"; dkim-atps=neutral Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41f2Y75KC3zF12j for ; Mon, 30 Jul 2018 11:48:58 +1000 (AEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 44ABC47D; Sun, 29 Jul 2018 21:48:54 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 29 Jul 2018 21:48:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= mendozajonas.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=capw3Zshvp3tDZJ7kY3nVwTZ+3e1ZQjaMg1Ime+q55Q=; b=Y8RwfR2Y 9lsKAP/W2HqTKAPewHP6dhWTZLPPQTqKczGdN410Q/PUqDSDO09JgXUsv3LMCkC5 /ZN1OQHQaCC318w+rRumIZhcR9d2CfU3d0t2Clz9DZuX28IVG1YlFD1lhGYbiwcL Zu3/0V5uZmolbB8e9+SsDX46OZ4d7G0FxD11cKWVgAY7djGNPcEw7Ffpv4Vp+ZkC lgFonol/hv5/WGX5snItVwZG3hM6XkoQxw5fJ1A29AuaNn8Ho/rJStSKk3XgJO57 Ds5Zi9h5zBqqJexw5VORMrev3x3D8FEDyUjzh6vt0jygEUcoCpUij4biopCqDO2T HtMLhI9D1VX7Pw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=capw3Zshvp3tDZJ7kY3nVwTZ+3e1ZQjaMg1Ime+q55Q=; b=kgtgDovu fWe/fSLqPdX/g75u9MtLgNli+hA9mkKY+ASON+99dC+NoOuFFynyhtbCV/gfu2qP JZi6Y00nMte19SxM22Pk2+4h3TUy176karrscXHaPkrr9eJ+sTs/20hSz/sqVJic bnY6enoQUyzpEeYeKG8wZc3mDPNHFoVu9B0pNQQ50Kze4P1qAxCuP8P2x3Lbbxir kImMmL7NSExxojLZB+nKwzZ9b5+ZFdwdyjYU7UDRL/d7n3UwkoiGelFllpNIDTCO 12vwX6pyqoYg/MTh/w/l7a0Pd0m20Pofq2gGeElNKCgaUcVWbYzdxr/ul4ltlKga /pTjZEIDbgEFZQ== X-ME-Proxy: X-ME-Sender: Received: from v4.ozlabs.ibm.com (unknown [122.99.82.10]) by mail.messagingengine.com (Postfix) with ESMTPA id 8B11CE44F3; Sun, 29 Jul 2018 21:48:52 -0400 (EDT) From: Samuel Mendoza-Jonas To: petitboot@lists.ozlabs.org Subject: [PATCH 2/3] discover: Be more verbose about boot failures Date: Mon, 30 Jul 2018 11:48:25 +1000 Message-Id: <20180730014826.19097-2-sam@mendozajonas.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180730014826.19097-1-sam@mendozajonas.com> References: <20180730014826.19097-1-sam@mendozajonas.com> X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Samuel Mendoza-Jonas MIME-Version: 1.0 Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" Signed-off-by: Samuel Mendoza-Jonas --- discover/boot.c | 6 ++++++ discover/paths.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/discover/boot.c b/discover/boot.c index 2a0d333..04c32a1 100644 --- a/discover/boot.c +++ b/discover/boot.c @@ -341,6 +341,8 @@ static int check_load(struct boot_task *task, const char *name, return 0; } + pb_log("Failed to load %s from %s\n", name, + pb_url_to_string(result->url)); update_status(task->status_fn, task->status_arg, STATUS_ERROR, _("Couldn't load %s from %s"), name, @@ -451,6 +453,8 @@ no_load: STATUS_ERROR, _("kexec reboot failed")); } + } else { + pb_log("Failed to load all boot resources\n"); } } @@ -462,6 +466,8 @@ static int start_url_load(struct boot_task *task, struct boot_resource *res) res->result = load_url_async(task, res->url, boot_process, task, NULL, task->status_arg); if (!res->result) { + pb_log("Error starting load for %s at %s\n", + res->name, pb_url_to_string(res->url)); update_status(task->status_fn, task->status_arg, STATUS_ERROR, _("Error loading %s"), res->name); diff --git a/discover/paths.c b/discover/paths.c index dd54ba2..dcd7b49 100644 --- a/discover/paths.c +++ b/discover/paths.c @@ -118,6 +118,8 @@ static void load_url_process_exit(struct process *process) } else { result->status = LOAD_ERROR; load_url_result_cleanup_local(result); + pb_debug("Download client stdout buffer:\n%s\n", + process->stdout_buf); } if (result->status == LOAD_OK && process->stdout_data) From patchwork Mon Jul 30 01:48:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Mendoza-Jonas X-Patchwork-Id: 950702 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41f2YV3T1Cz9s21 for ; Mon, 30 Jul 2018 11:49:18 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=mendozajonas.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="CUKKA3XW"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="Jx+zAxX3"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41f2YV1zMTzF132 for ; Mon, 30 Jul 2018 11:49:18 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=mendozajonas.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="CUKKA3XW"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="Jx+zAxX3"; dkim-atps=neutral X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=mendozajonas.com (client-ip=64.147.123.19; helo=wout3-smtp.messagingengine.com; envelope-from=sam@mendozajonas.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=mendozajonas.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="CUKKA3XW"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="Jx+zAxX3"; dkim-atps=neutral Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41f2Y75CR5zF12T for ; Mon, 30 Jul 2018 11:48:58 +1000 (AEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id D366B410; Sun, 29 Jul 2018 21:48:55 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 29 Jul 2018 21:48:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= mendozajonas.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=hATv+pd0mmNKeY4JvuT6Yjus8fMnqFEC6cYesCS6gJA=; b=CUKKA3XW BEcNvWjFE7m3ZVfpBYDBRkMd8JQTia13pAcWJajPj5QaAnSnLL0F3qIblsz7mU7B nISCXK0uPfmaK8il9MkhjpGg3WFSzyOJ0UDcF8pAmha4bXuw1W9CPIVirzwKKgJ4 aTLb1tZTdiNXdgJTmPxpVJ49dK+ifbE4Tu4BAgL1WHbH160ownc/vPd5AhVhwco3 WRRTF2Lv8GB599PVug6mkgnFFW3sc+wC8NSuEtcixOM9CK4TAX6R3FollGI8R1ro +0PU9ZSruRpTBu+cQ0k1lv/KDS5BGzBHgfKUtwNP9XsvbRqyj4SFrz/5TsMA3uwV /sxfsTrXj46BjA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=hATv+pd0mmNKeY4JvuT6Yjus8fMnqFEC6cYesCS6gJA=; b=Jx+zAxX3 u/oW46ssJ1CoA2W+MX5TkrZobTe6XAqDj5QZ/Nz+xQpMmsFLIqPzDPHYVZ8ZW9pC X+f8P3qZJ/Qa4UC2JnEKVLoQbx6IHVtSOeCBNgCtYqtGO5O3Vl/W0oJSqtc0fUJ7 xU/y9K1VOdd38t4FXClURNeU55JbHpsE5TyBlILNIxvc/CX4cfujICybxFHIyab0 WQi8fU+CtYS1eu/rzmV6hlcB2rNvCZQQ94MnWk24JZ1mnhSqDF1C+NriILPViMvC hhO4xXda6r0AQiIRshi54WOVj1xcf+29th5mTMvrvofq6aSTaGZNhlBZHVN8+uO7 U8rY1jqxlSYsBw== X-ME-Proxy: X-ME-Sender: Received: from v4.ozlabs.ibm.com (unknown [122.99.82.10]) by mail.messagingengine.com (Postfix) with ESMTPA id 22E6FE455F; Sun, 29 Jul 2018 21:48:53 -0400 (EDT) From: Samuel Mendoza-Jonas To: petitboot@lists.ozlabs.org Subject: [PATCH 3/3] discover/paths: Set suffix to default value on error. Date: Mon, 30 Jul 2018 11:48:26 +1000 Message-Id: <20180730014826.19097-3-sam@mendozajonas.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180730014826.19097-1-sam@mendozajonas.com> References: <20180730014826.19097-1-sam@mendozajonas.com> X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Samuel Mendoza-Jonas MIME-Version: 1.0 Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" This avoids the log filling up with "Couldn't recognise suffix" messages if a lot of partial stdout updates are received. Signed-off-by: Samuel Mendoza-Jonas --- discover/paths.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/discover/paths.c b/discover/paths.c index dcd7b49..174bdae 100644 --- a/discover/paths.c +++ b/discover/paths.c @@ -186,8 +186,10 @@ static int busybox_progress_cb(void *arg) } } - if (rc != 3) + if (rc != 3) { percentage = size = 0; + suffix = ' '; + } device_handler_status_download(handler, procinfo, percentage, size, suffix);