Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp364237ybt; Fri, 26 Jun 2020 01:05:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxy3SoRv5cUTNqT/g+V+MOVfP4LCAAqxSJ7pC9vS5g2zLIFLidrSJAjntLsd9y/zH6X5Xpc X-Received: by 2002:a17:907:20b4:: with SMTP id pw20mr1565299ejb.225.1593158708699; Fri, 26 Jun 2020 01:05:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593158708; cv=none; d=google.com; s=arc-20160816; b=onyuX6FoTnpWzzt2qerHrRnGTQztDaalmW7/jj0s81Iu7v1VggBaRyFUXSogUCZVzU +c7hFCjnEHWGxKEcMBXGNo1cW3U4pXu2v+s7TjA3r5sQyv6e/X2auLKKeh/7WiS9bnfh FDYHz4Tl2FUM1KNetdrlGphtIKjHCY6fK0q3ev2cMguOCVWx78VPDV4idm9X/PVtIuBz LemzPZyAaT9tSuxW38OUYR2lyH75WxaKl5tb/qZ9dCt4jBg8lNwSLmCJCRha6WfsK8FS asbJ74xbrPltCmd90HaFAvAHFOGzY/OBKB/QuDRV8W3AOKAspKptaITHHan/Ygnp7G4n sXsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=wmeNZdhvSUJA6z7bKWJT9tYmGPQaank/niIM0I5cRDw=; b=hEGbzfBWBvPmFbWW1BXYr6iJNzljIR2j7MBId2IQpBP/BfrP3rWjVMaoF5+c81NAfS QRcRjMOCr/tw/SbuzhKkVxdXBZxprUkyTJf+twcfKXfPFXCJeGk6EzVXyBvxHPnkFcSH y9v9tAByZaFDCK8yToJOxatdphGeB14FikXPNtKxmJIF1cSBBUfPeBT8GjABHK63yjsc 0kC4+4h66ezSWB3SALojc7S8Cm4Jr6vPtX+N99H1ing1mTG3KS6u0qBMCD7+p83OUmrT cXJ47PdtfGpvG08QkEIcOXXC/CtG0dwmntmt5ELsko1JIK01zjWSBiN/ZV0ZZ3ZZ/Y5N /h5g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y19si701792eje.56.2020.06.26.01.04.45; Fri, 26 Jun 2020 01:05:08 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729118AbgFZICz (ORCPT + 99 others); Fri, 26 Jun 2020 04:02:55 -0400 Received: from mx2.suse.de ([195.135.220.15]:37434 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728988AbgFZICy (ORCPT ); Fri, 26 Jun 2020 04:02:54 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 530B5ABE2; Fri, 26 Jun 2020 08:02:52 +0000 (UTC) Date: Fri, 26 Jun 2020 10:02:52 +0200 From: Petr Mladek To: Joe Lawrence Cc: Naresh Kamboju , Michael Ellerman , "open list:KERNEL SELFTEST FRAMEWORK" , open list , Kees Cook , Anders Roxell , Daniel =?iso-8859-1?Q?D=EDaz?= , Justin Cook , lkft-triage@lists.linaro.org, Miroslav Benes , Shuah Khan Subject: Re: [PATCH 1/2] selftests/lkdtm: Don't clear dmesg when running tests Message-ID: <20200626080252.GL8444@alley> References: <20200508065356.2493343-1-mpe@ellerman.id.au> <20200624083955.GF8444@alley> <20200624201247.GA25319@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200624201247.GA25319@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ;-) > 1 - f131d9edc29d ("selftests/lkdtm: Don't clear dmesg when running > tests") has already merged, updating that file doesn't look too > difficult, but will need a Fixes tag and should probably go > through Shuah's tree. Yup. > 2 - We haven't actually merged the livepatch copy yet. I can roll > another version of that patchset, substituting a fix for the > problematic patch, or we could just tack this one on at the end. > In fine with either approach. I prefer the followup patch to avoid rebase. Best Regards, Petr