Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp578948ybt; Fri, 26 Jun 2020 06:40:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4BMK8u5IJ4SX7Qcn/em5lAbVoV8t8mQJdHyJnGz5B6r34sCVedxLmHKP4Vn+ZKa4DXUua X-Received: by 2002:a17:906:a459:: with SMTP id cb25mr2601882ejb.234.1593178856871; Fri, 26 Jun 2020 06:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593178856; cv=none; d=google.com; s=arc-20160816; b=Dz4A6RGN8LsL/GaPlogMaInCmdtM0jOqAwLXg2LH+hW6u6HHb0eSQlWJrxX6dQWU33 BDWznhsblewq1CmPXXDqpsVbJHajtmhbr0sIBSaADReyjll/0AdJuS3QBskeTIJ1CGKo BS2MpUrxL2BmPJCQ7H4MwxlwAgyw8m3qsE7wYC6VTzX50o18HLxq8/RMjEF7WZT1C7ei bGGHXYRx7vwq+BAoLOW7r+0SvGrNLs+5oGKtdWAOKUT6bJdaXeVvzqpDS+JrZvyMujK7 uUkgaovOc+Gv3vrQvPWxV657gLzEyfZSSoQSBBdjHd5vnujsqBTATxUzPCi+g6o3Vvnx Txnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=HsFehEv1OUOatwx+S43XjusrlgWYrjMc9ZPpHVwNiv0=; b=ewuZWZstZUkUZGoNk0paPxnSyvdTmC58Pb6HA4xbcwiy374CZ1AVRp11F3Bjs7juMP ES+ujDZSq7nq3qjRTKtKcdlWFDbJBTNp3qGqFG166aeQ4BBM1tD/foHTEMfhc44cgdUY DwqN5131PxMbKoE2doPS6KWocREeCB0GUpdFmDTWT8IYmkCTe49xAJLwopcupDOT705r z1ana3UxxKtcJjCTJtSgqdXXp1Du7vaN2kA9Bdp/0+owaPg0FuSZ1KsPY3sVfjEAXj2j KiWKrKjL2b8hhUZBLwDXOqZCG2PQBETDFzkAsmWo/+F+TK909H/kniiPM76io6Wqi/7C Gxqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bzge9EZL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jr6si2541293ejb.259.2020.06.26.06.40.33; Fri, 26 Jun 2020 06:40:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bzge9EZL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726770AbgFZNi4 (ORCPT + 99 others); Fri, 26 Jun 2020 09:38:56 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:24450 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728256AbgFZNiz (ORCPT ); Fri, 26 Jun 2020 09:38:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593178734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HsFehEv1OUOatwx+S43XjusrlgWYrjMc9ZPpHVwNiv0=; b=bzge9EZL37NO18Z8IRja0Hozczcd6t0RkCrdo8oLeN1cUIwcmD3V0A8z1PIekLh0DAjKYs B1EcHZimWv0qQkQIsfPvodMRC/n9eFh2vzxhQvfOma1t9tIYq61ek6xO2j0ikW24IdTDmR mB9dv63f8RLrZaZChgWaGvNVfWbfNKs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-288-RTrJ4L5INJWpa7hRomPr0g-1; Fri, 26 Jun 2020 09:38:47 -0400 X-MC-Unique: RTrJ4L5INJWpa7hRomPr0g-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CA4B7107ACCA; Fri, 26 Jun 2020 13:38:45 +0000 (UTC) Received: from [10.10.112.56] (ovpn-112-56.rdu2.redhat.com [10.10.112.56]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 79BC470915; Fri, 26 Jun 2020 13:38:44 +0000 (UTC) Subject: Re: [PATCH 1/2] selftests/lkdtm: Don't clear dmesg when running tests To: Petr Mladek Cc: Naresh Kamboju , Michael Ellerman , "open list:KERNEL SELFTEST FRAMEWORK" , open list , Kees Cook , Anders Roxell , =?UTF-8?Q?Daniel_D=c3=adaz?= , Justin Cook , lkft-triage@lists.linaro.org, Miroslav Benes , Shuah Khan References: <20200508065356.2493343-1-mpe@ellerman.id.au> <20200624083955.GF8444@alley> <20200624201247.GA25319@redhat.com> <20200626080252.GL8444@alley> From: Joe Lawrence Message-ID: <762d9ca5-82f3-588c-b147-b0954a764ea7@redhat.com> Date: Fri, 26 Jun 2020 09:38:43 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200626080252.GL8444@alley> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/26/20 4:02 AM, Petr Mladek wrote: > On Wed 2020-06-24 16:12:47, Joe Lawrence wrote: >> On Wed, Jun 24, 2020 at 10:39:55AM +0200, Petr Mladek wrote: >>> On Tue 2020-06-23 23:48:36, Joe Lawrence wrote: >>>> On 6/22/20 4:51 AM, Naresh Kamboju wrote: >>>>> On Fri, 8 May 2020 at 12:23, Michael Ellerman wrote: >>>>>> >>>>>> It is Very Rude to clear dmesg in test scripts. That's because the >>>>>> script may be part of a larger test run, and clearing dmesg >>>>>> potentially destroys the output of other tests. >>>>>> >>>>>> We can avoid using dmesg -c by saving the content of dmesg before the >>>>>> test, and then using diff to compare that to the dmesg afterward, >>>>>> producing a log with just the added lines. >>>>>> >>>>>>>>> diff --git a/tools/testing/selftests/lkdtm/run.sh b/tools/testing/selftests/lkdtm/run.sh >>>>>> index dadf819148a4..0b409e187c7b 100755 >>>>>> --- a/tools/testing/selftests/lkdtm/run.sh >>>>>> +++ b/tools/testing/selftests/lkdtm/run.sh >>>>>> # Record and dump the results >>>>>> -dmesg -c >"$LOG" >>>>>> +dmesg | diff --changed-group-format='%>' --unchanged-group-format='' "$DMESG" - > "$LOG" || true >>>>> >>>>> We are facing problems with the diff `=%>` part of the option. >>>>> This report is from the OpenEmbedded environment. >>>>> We have the same problem from livepatch_testcases. >>>>> >>>>> # selftests lkdtm BUG.sh >>>>> lkdtm: BUG.sh_ # >>>>> # diff unrecognized option '--changed-group-format=%>' >>>>> unrecognized: option_'--changed-group-format=%>' # >>>>> # BusyBox v1.27.2 (2020-03-30 164108 UTC) multi-call binary. >>>>> v1.27.2: (2020-03-30_164108 # > >> I did a bit more hacking to work that awk script into the livepatching >> tests. The changes aren't too bad and coding it ourselves lets us drop >> the temporary dmesg file business. If this looks good, I can send out >> as a real patch, but then that raises a few questions: > > The patch worked and I agree that it is not that bad. > > Well, what about using "comm" as proposed by Michael in the other > mail? It seems to be part of coreutils and should be everywhere. > > I guess that many people, including me, are not fluent in awk. > So, I am slightly in favor of the "comm" approach ;-) > comm is definitely simpler and for some reason I forgot about the leading timestamps (again!) dismissing it thinking that the inputs weren't sorted. But luckily they are and if Naresh or anyone can confirm that comm is well supported in the BusyBox testing environment, then using that is fine w/me. -- Joe