From patchwork Wed Oct 4 12:38:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 31670 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2374E7B604 for ; Wed, 4 Oct 2023 12:38:31 +0000 (UTC) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by mx.groups.io with SMTP id smtpd.web10.17186.1696423107374004724 for ; Wed, 04 Oct 2023 05:38:27 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=UjBJCtII; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.49, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-32329d935d4so1997453f8f.2 for ; Wed, 04 Oct 2023 05:38:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1696423105; x=1697027905; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=aWpptas58mUPLx9oL9Ndi8IWcjxGj0g2YiSHyLza3sI=; b=UjBJCtIIW8ddRaoAfp4jRGYYf42MovgA6zU804Wshh0KYIWwHqLlXP2oJ+yF6UHGpw LRHg4/rDI5YEaQoiFvvOXOUqX56K8O42noX3UpvMxExU9C10wBcUhyxJNGQG//a2ZY2L 2y4wFSZhqCgcybJnEv438LEPUv0ycaRGPhvgo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696423105; x=1697027905; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aWpptas58mUPLx9oL9Ndi8IWcjxGj0g2YiSHyLza3sI=; b=nL+cwG9/QBM+jF9G5606oGGINfUiu2dYMtsKJbrhL7WKNT8qlfIldk1SzKkrpWV87i rAbt9mf4IDh6aMIisR/zoypYJ//akcUqfJDIqjhecsvi4csmBhDBmFXNBXByIRjhI7MW cefi1nuKJZfgJBv/SfI5h0nliPy4dBSnRPU6lDyji98LhtZX568Rsvb5k4t0h8Fh/JYe 1pZgNZnkmz7wTtN3Ps1DlUX9an0d0l6hqPtep1ZK58B8RQuXpczKNMG/1BbnTCtXevJF E/npuxelrDhW6Tz4c1Hr+lg4pw4ElCkQsRjJwAEpjCItiGsGRp7aW56IaPPoJB1Qf3hg v01g== X-Gm-Message-State: AOJu0YwfVqzJoSEHuiu/dKHEcBPW7qDYh9x+RhwbSqIxiWKHXX389lHX BOI52IIuxeHRGBbYq+mpvaLmoe3Qa/K1g/UlIKY= X-Google-Smtp-Source: AGHT+IG4Etd9KVDutQm/vv7BgS010YNKyJr1a1xa1xs/7gRYDxNCRAZ3A3IXoiyRW0Ck1Npsb0Rcmw== X-Received: by 2002:a5d:45c9:0:b0:31a:e376:6bd6 with SMTP id b9-20020a5d45c9000000b0031ae3766bd6mr1902653wrs.45.1696423105373; Wed, 04 Oct 2023 05:38:25 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:cc7c:410f:894f:7a55]) by smtp.gmail.com with ESMTPSA id da4-20020a056000196400b003279518f51dsm3974617wrb.2.2023.10.04.05.38.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 05:38:24 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 1/5] wic: Add console parameters to qemux86 canned-wks Date: Wed, 4 Oct 2023 13:38:19 +0100 Message-Id: <20231004123823.2990916-1-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 04 Oct 2023 12:38:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/188675 Currently our wic test images boot up without kernel output on the consoles which means we have no way to debug if anything goes wrong. Add the console parameters runqemu would have added if the kernel wasn't built into an image to improve our chances of debugging. Signed-off-by: Richard Purdie --- scripts/lib/wic/canned-wks/qemux86-directdisk.wks | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lib/wic/canned-wks/qemux86-directdisk.wks b/scripts/lib/wic/canned-wks/qemux86-directdisk.wks index 22b45217f1c..808997611a4 100644 --- a/scripts/lib/wic/canned-wks/qemux86-directdisk.wks +++ b/scripts/lib/wic/canned-wks/qemux86-directdisk.wks @@ -4,5 +4,5 @@ include common.wks.inc -bootloader --timeout=0 --append="rw oprofile.timer=1 rootfstype=ext4 " +bootloader --timeout=0 --append="rw oprofile.timer=1 rootfstype=ext4 console=tty console=ttyS0 " From patchwork Wed Oct 4 12:38:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 31671 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6D6FE7B60C for ; Wed, 4 Oct 2023 12:38:31 +0000 (UTC) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by mx.groups.io with SMTP id smtpd.web11.17093.1696423107869708360 for ; Wed, 04 Oct 2023 05:38:28 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=IpbKN7+B; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.45, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-3226b8de467so2056683f8f.3 for ; Wed, 04 Oct 2023 05:38:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1696423106; x=1697027906; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=mxOc2ZkNMLuJy0BpfQb88Qg2JxDswliuk7qyD89CQWg=; b=IpbKN7+BrVa7Mo+FzD6Qz3K3mVDqMpSEB6035KqL0Si4dis++xi6RQIN1zwAYG0zwu b/z/YBVCOvX9Ni9qGsM3NeCOq1m4pCFtsqOtptU16l7bywZIk0fPH1/rHtFkuv3iYugU 8A0TxD9hlo44Ze6tZbsc2SyZzD216Zxnp6v9Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696423106; x=1697027906; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mxOc2ZkNMLuJy0BpfQb88Qg2JxDswliuk7qyD89CQWg=; b=bZFrfsGjkOiiIdRmww6cM+ECbRjfgOf+awyry7jiQdxbPrUDe3KhdaWWJGv9zNttot h0LiLJoNdvXaBTO7/GCuGRia0UwrruBO9+r4snQyCQe6P2qPqYCxYHwvkGv4gNJZqlye wgd+OBD8zJQ0uAv2WCOt7fxGwnywFYymK6Ni/q+OLZ0ILlL/tYcDLz0rpJbDJ2Td5dJ7 tNDrvSHxpe5tys71RCP2BTZoAz58rA0wnSnIJHCs7nGBkmjsnaYa70Uhpl6RfYU2c9Ol bntXN5mcPLTIWxXBnTdZvZsSG/LnO2ojzFMgSp05x+qaGLS0hDocGX1e+aH5Or1I+ngY TQmA== X-Gm-Message-State: AOJu0YziMKlVjVDzsUONRr1KLkJ3SVefa4RP9CHJQsCmMSlLf9mWtFpA RaBeDM9rNIGfKuNsm+UoJLd1Iph8SYYwV4a8H2w= X-Google-Smtp-Source: AGHT+IGtmvRoORUTO3LGlkU49NZt+vUZxK6jfaNabSk9EHgrlj7OzOr80Vo6K4BSkiCjD4/a5//c4w== X-Received: by 2002:adf:f290:0:b0:321:8181:601e with SMTP id k16-20020adff290000000b003218181601emr2094077wro.8.1696423106116; Wed, 04 Oct 2023 05:38:26 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:cc7c:410f:894f:7a55]) by smtp.gmail.com with ESMTPSA id da4-20020a056000196400b003279518f51dsm3974617wrb.2.2023.10.04.05.38.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 05:38:25 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 2/5] qemurunner: Skip conversion from/to binary data for logfile Date: Wed, 4 Oct 2023 13:38:20 +0100 Message-Id: <20231004123823.2990916-2-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231004123823.2990916-1-richard.purdie@linuxfoundation.org> References: <20231004123823.2990916-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 04 Oct 2023 12:38:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/188676 There is no point in decoding binary data only to encode it again risking conversion issues. Write the raw data to the log file as binary and skip the conversion. Also always update self.msg even if a logfile isn't specified to improve logging/debug. Signed-off-by: Richard Purdie --- meta/lib/oeqa/utils/qemurunner.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index 22cf258dddf..b8f51112861 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py @@ -115,10 +115,9 @@ class QemuRunner: def log(self, msg): if self.logfile: - msg = self.decode_qemulog(msg) - self.msg += msg - with codecs.open(self.logfile, "a", encoding="utf-8") as f: - f.write("%s" % msg) + with codecs.open(self.logfile, "ab") as f: + f.write(msg) + self.msg += self.decode_qemulog(msg) def getOutput(self, o): import fcntl From patchwork Wed Oct 4 12:38:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 31668 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0461E7B608 for ; Wed, 4 Oct 2023 12:38:31 +0000 (UTC) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by mx.groups.io with SMTP id smtpd.web10.17187.1696423108630156927 for ; Wed, 04 Oct 2023 05:38:28 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=d/cywloH; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.47, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-313e742a787so544092f8f.1 for ; Wed, 04 Oct 2023 05:38:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1696423107; x=1697027907; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=+f+43+nY1gMTCGycdrxFR+ux6ozREs0MBPDSmcbpw10=; b=d/cywloHoa8zaemCU8+QPt/mIG+0YOr/FU+VgjBrroRbmEF403FkFtFT7ocpmXJa9J jYRSEnuc9N1j4mLS3w1meoyNY/5oP7m7wiodmwBw6HWAqlyAjw117uJHbFwG9Yru8zrm yx+SNnPi/iDVgCxdrsuif4f63GpL6NZqPYPfc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696423107; x=1697027907; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+f+43+nY1gMTCGycdrxFR+ux6ozREs0MBPDSmcbpw10=; b=A6Pbfo0PFaA0UXLt9gc+2tT+HZe7HZaw+tIipDqOPw3pnjVrBGXRXrSmxwjJfiyIxF bgUc5WCEensKQC1Syg7CuRxcqea90VkVnXoU5FwRqwUqCWiqh+L1uDZBs89C7jBVgHR8 IJWasp1VD8dXHB3+PWVpOO48QCRTAe9WJLD4rEtdhDGiRkeZlMyQGazFPYvr3stFkg3I Oz5TfkQVZtFs7Tlw6hTuSDZa2EoANS5ZFN1PkrkzDz2wCkw8sqXLRCBqid8bZMdXKpPz l4ZdfRQWzZI69HeWERCYGd2guQESF7tw8D1VfVZr46Kiisxo+NBKlYcpdvUvw2rF1w6L cZEw== X-Gm-Message-State: AOJu0YybMb7dNxc00I5QsVZjuYcNTcTSsUoIfoywh/p1nXFuJuneTK9S xmpdTf54yrpmQEua2fkaRuWYyZvb8M22L1KwUmI= X-Google-Smtp-Source: AGHT+IFgmf2LXxIJYlb2DMB0qX6imngguPPMiRhyG54EP2oWLF5taVyGqLbNMSF4GiSUvxFcewO1TA== X-Received: by 2002:a5d:4449:0:b0:323:1738:1c35 with SMTP id x9-20020a5d4449000000b0032317381c35mr4789239wrr.26.1696423106904; Wed, 04 Oct 2023 05:38:26 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:cc7c:410f:894f:7a55]) by smtp.gmail.com with ESMTPSA id da4-20020a056000196400b003279518f51dsm3974617wrb.2.2023.10.04.05.38.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 05:38:26 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 3/5] qemurunner: Use backslashreplace with utf8 to make invalid characters clear Date: Wed, 4 Oct 2023 13:38:21 +0100 Message-Id: <20231004123823.2990916-3-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231004123823.2990916-1-richard.purdie@linuxfoundation.org> References: <20231004123823.2990916-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 04 Oct 2023 12:38:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/188677 Switch to the backslashreplace error handling when decoding strings so that invalid characters are clear in the stream to improve debugging. Signed-off-by: Richard Purdie --- meta/lib/oeqa/utils/qemurunner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index b8f51112861..b738a261d87 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py @@ -109,7 +109,7 @@ class QemuRunner: def decode_qemulog(self, todecode): # Sanitize the data received from qemu as it may contain control characters - msg = todecode.decode("utf-8", errors='ignore') + msg = todecode.decode("utf-8", errors='backslashreplace') msg = re_control_char.sub('', msg) return msg @@ -473,7 +473,7 @@ class QemuRunner: self.logger.error('Invalid file type: %s\n%s' % (file)) read = b'' - self.logger.debug2('Partial boot log:\n%s' % (read.decode('utf-8', errors='ignore'))) + self.logger.debug2('Partial boot log:\n%s' % (read.decode('utf-8', errors='backslashreplace'))) data = data + read if data: bootlog += data From patchwork Wed Oct 4 12:38:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 31667 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 046A2E7B60D for ; Wed, 4 Oct 2023 12:38:32 +0000 (UTC) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by mx.groups.io with SMTP id smtpd.web11.17095.1696423109958689355 for ; Wed, 04 Oct 2023 05:38:30 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=I9N6gkJ/; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.46, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4065dea9a33so20223155e9.3 for ; Wed, 04 Oct 2023 05:38:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1696423108; x=1697027908; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=HSH1e6WJhSSUYr1/kyZigJGZZMHevGohjSB2fDExkjI=; b=I9N6gkJ/9vHL7/lE/hdKn97rkWc7K7Cm0j4IE3gEKaK1UnlcNa+4ceZdK9xD+3NB9I FTL3cffLA+MlPp+7ivg8nPMpPWiVpb6P6e1AEWSdAK496oHi9XRzBkaDLrWYmDJcRRWt w8k9Z7NHBuz0Kd4vT7i8UZZJpbHgWa3G2UvAU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696423108; x=1697027908; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HSH1e6WJhSSUYr1/kyZigJGZZMHevGohjSB2fDExkjI=; b=bGz+swXc1/3+RPgLBQ6HsOk74KQObbxFTFr5NsBhvMVz12nVA/KKZ9OhC+mZ/WdIn1 kYkTjGgJz2NBTSq2ySGUZU6HaL7CIHjaETgWNy/aae2IhttuvysIMBKkzgE0o8qGCIdP u27qQKoDJ/otQKN7VXX9sMgtaXpH2ws7mq1c/vbU77krnIgNX0uFHln8R5v/iAPcsqvi MO546U41SOT2DqT9R0CFOfCA/slru0kmQcoYGwLDeALXAHuhTVko+xL74a7YOxdLcdz2 fQVlKP88RiPI3OtrJnXZ8zmHd6sYp49G+AO7j+CP0JimECSX1pSip84zE7tkq59cvwhb DsCQ== X-Gm-Message-State: AOJu0Yzny+k/pjM3zlDvB7cwSSFOLSP6ApWZajMpXkb70JpCEsaGFfIE hi9Ugf4NTtFiexVQGfa4hsXJpcW2HAwaDVWFV6E= X-Google-Smtp-Source: AGHT+IEi7gfoHfrXIVk4Jo5xxGC3MoQjeqs9vp10xbOQwfTDnAAlmkWxn+kOqmMgxetsB4uNa2TZ+Q== X-Received: by 2002:adf:de09:0:b0:320:9e7:d525 with SMTP id b9-20020adfde09000000b0032009e7d525mr2063126wrm.46.1696423108005; Wed, 04 Oct 2023 05:38:28 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:cc7c:410f:894f:7a55]) by smtp.gmail.com with ESMTPSA id da4-20020a056000196400b003279518f51dsm3974617wrb.2.2023.10.04.05.38.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 05:38:27 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 4/5] qemurunner: Log the second serial console as well as the first Date: Wed, 4 Oct 2023 13:38:22 +0100 Message-Id: <20231004123823.2990916-4-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231004123823.2990916-1-richard.purdie@linuxfoundation.org> References: <20231004123823.2990916-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 04 Oct 2023 12:38:32 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/188678 To aid debugging, always log the second serial console as well as the first to a seperate log file. This should make it clearer what happened when we see test failures. Signed-off-by: Richard Purdie --- meta/lib/oeqa/utils/qemurunner.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index b738a261d87..ea867a2934f 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py @@ -113,9 +113,9 @@ class QemuRunner: msg = re_control_char.sub('', msg) return msg - def log(self, msg): + def log(self, msg, extension=""): if self.logfile: - with codecs.open(self.logfile, "ab") as f: + with codecs.open(self.logfile + extension, "ab") as f: f.write(msg) self.msg += self.decode_qemulog(msg) @@ -477,10 +477,7 @@ class QemuRunner: data = data + read if data: bootlog += data - if self.serial_ports < 2: - # this file has mixed console/kernel data, log it to logfile - self.log(data) - + self.log(data, extension = ".2") data = b'' decodedlog = self.decode_qemulog(bootlog) From patchwork Wed Oct 4 12:38:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 31669 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04027E7B60F for ; Wed, 4 Oct 2023 12:38:32 +0000 (UTC) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by mx.groups.io with SMTP id smtpd.web11.17096.1696423110462652434 for ; Wed, 04 Oct 2023 05:38:30 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=W9FkgvXf; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.50, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4064876e8b8so21226405e9.0 for ; Wed, 04 Oct 2023 05:38:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1696423108; x=1697027908; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=7t5exn/WuZn/S4drizgi7E4x/cayNQa71wj5kIpiRxg=; b=W9FkgvXfRvAvROJR8z1RL845NgBFJbf+3T6tExL4myBko+2LuVkQDVzhODEvXePA5s 2H6YkI8vXMVD+tBPD6tsFCMsLFD0Z7PbZ5o7dabtez0/Q4pXCeTwvPBGBadFSLcXqjxd ktl9C/qRrQMb8ju/vjMn9UGBNwZetUWR9ZCX0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696423108; x=1697027908; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7t5exn/WuZn/S4drizgi7E4x/cayNQa71wj5kIpiRxg=; b=pQpA1pO/NgbhFbvmE0vnui0i6c1chMBktnxEO1EE7W+Mf0oyqTraBz1z4zKym/XjnK oq6/CXTG9jPbWycnzWnaWwa43VJ9XdJjiHrO+m/lIaO+5Iv6FyETizu90s9co3s+ULDo JJ3KQJVZ6GGRDkw07w9vSlLLTIx/cI5ThurSb0vHfAfsrOKJmEerX8K82e58gUcqkmkR KVxXQgDSirIpoSh/ViOesS/H3jGwCLuRCEWE2z0tDaFctd59VHZaSpvS0aHeyxjl1M5j fGeATLSrlutyp+JMSk1cnjPKYSwuMdjBbZc2YEXgVpPNobvPVe5sNvgPBMqf4uEvva42 iuWg== X-Gm-Message-State: AOJu0YwZ6Bcc+uBnIzWU+KZsnAdGLCRxIE4M6l9BTp1CTo/cMJ2REcOG 37o2QxG+ywm03oQDXuZm2K2YvTZbjo/ylbehzAI= X-Google-Smtp-Source: AGHT+IElO9GJJ8VBePAdOT0MYpbuyyAXJHZ+GmaX8EKhmzK79zUwPh9q91A6PFaMQzebaXEGrTwylg== X-Received: by 2002:adf:f704:0:b0:314:1ce9:3c86 with SMTP id r4-20020adff704000000b003141ce93c86mr1882755wrp.0.1696423108672; Wed, 04 Oct 2023 05:38:28 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:cc7c:410f:894f:7a55]) by smtp.gmail.com with ESMTPSA id da4-20020a056000196400b003279518f51dsm3974617wrb.2.2023.10.04.05.38.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 05:38:28 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 5/5] qemurunner: Show both the login console log and all logging upon failure Date: Wed, 4 Oct 2023 13:38:23 +0100 Message-Id: <20231004123823.2990916-5-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231004123823.2990916-1-richard.purdie@linuxfoundation.org> References: <20231004123823.2990916-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 04 Oct 2023 12:38:32 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/188679 It is unclear when things fail which output was on which serial port. Improve the output to show the last lines of both data to improve debugging. Signed-off-by: Richard Purdie Acked-by: Mikko Rapeli --- meta/lib/oeqa/utils/qemurunner.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index ea867a2934f..9aa2e7b3bea 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py @@ -503,9 +503,8 @@ class QemuRunner: (self.boottime, time.strftime("%D %H:%M:%S"))) tail = lambda l: "\n".join(l.splitlines()[-25:]) bootlog = self.decode_qemulog(bootlog) - # in case bootlog is empty, use tail qemu log store at self.msg - lines = tail(bootlog if bootlog else self.msg) - self.logger.warning("Last 25 lines of text (%d):\n%s" % (len(bootlog), lines)) + self.logger.warning("Last 25 lines of login console (%d):\n%s" % (len(bootlog), tail(bootlog))) + self.logger.warning("Last 25 lines of all logging (%d):\n%s" % (len(self.msg), tail(self.msg))) self.logger.warning("Check full boot log: %s" % self.logfile) self.stop() return False