live-patching.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Lawrence <joe.lawrence@redhat.com>
To: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>,
	Petr Mladek <pmladek@suse.com>
Cc: Miroslav Benes <mbenes@suse.cz>,
	live-patching@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH 3/3] selftests/livepatch: filter 'taints' from dmesg comparison
Date: Sun, 14 Jun 2020 10:45:10 -0400	[thread overview]
Message-ID: <b1db9ae1-781c-6ea5-c748-0928bed145f1@redhat.com> (raw)
In-Reply-To: <ba0202cf-beea-ddde-4941-053718c77257@linux.vnet.ibm.com>

On 6/12/20 8:57 AM, Kamalesh Babulal wrote:
> On 6/12/20 5:17 PM, Petr Mladek wrote:
>> On Thu 2020-06-11 09:10:38, Joe Lawrence wrote:
>>> On 6/11/20 3:39 AM, Miroslav Benes wrote:
>>>> On Wed, 10 Jun 2020, Joe Lawrence wrote:
>>>>
>>>>> The livepatch selftests currently filter out "tainting kernel with
>>>>> TAINT_LIVEPATCH" messages which may be logged when loading livepatch
>>>>> modules.
>>>>>
>>>>> Further filter the log to drop "loading out-of-tree module taints
>>>>> kernel" in the rare case the klp_test modules have been built
>>>>> out-of-tree.
>>>>>
>>>>> Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
>>>>> ---
>>>>>    tools/testing/selftests/livepatch/functions.sh | 3 ++-
>>>>>    1 file changed, 2 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/tools/testing/selftests/livepatch/functions.sh b/tools/testing/selftests/livepatch/functions.sh
>>>>> index 83560c3df2ee..f5d4ef12f1cb 100644
>>>>> --- a/tools/testing/selftests/livepatch/functions.sh
>>>>> +++ b/tools/testing/selftests/livepatch/functions.sh
>>>>> @@ -260,7 +260,8 @@ function check_result {
>>>>>    	local result
>>>>>    	result=$(dmesg --notime | diff --changed-group-format='%>' --unchanged-group-format='' "$SAVED_DMESG" - | \
>>>>> -		 grep -v 'tainting' | grep -e '^livepatch:' -e 'test_klp')
>>>>> +		 grep -e '^livepatch:' -e 'test_klp' | \
>>>>> +		 grep -ve '\<taints\>' -ve '\<tainting\>')
>>>>
>>>> or make it just 'grep -v 'taint' ? It does not matter much though.
>>>>
>>>
>>> I don't know of any larger words* that may hit a partial match on "taint",
>>> but I figured the two word bounded regexes would be more specific.
>>
>> I do not have strong opinion. I am fine with both current and Mirek's proposal.
>>
>> I am just curious where \< and \> regexp substitutions are documented.
>> I see the following at the very end of "man re_syntax":
>>
>>     \< and \> are synonyms for  “[[:<:]]� and “[[:>:]]� respectively
>>
>> But I am not able to find documentation for “[[:<:]]� and “[[:>:]].
>> Even google looks helpless ;-)
>>
> 
> AFAIK, using \< and \> matches exact word.  Whereas when used individually,
> \< matches beginning and \> matches end of the word.
> 

 From 
https://www.gnu.org/software/grep/manual/grep.html#The-Backslash-Character-and-Special-Expressions 
:

The ‘\’ character, when followed by certain ordinary characters, takes a 
special meaning:

...

‘\<’

     Match the empty string at the beginning of word.
‘\>’

     Match the empty string at the end of word.


I'd be happy to use any other (more readable!) whole-word matching grep 
trick, this \<one\> just happens to be committed to my cmdline muscle 
memory.

-- Joe


  reply	other threads:[~2020-06-14 14:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-10 17:20 [PATCH 0/3] selftests/livepatch: small script cleanups Joe Lawrence
2020-06-10 17:20 ` [PATCH 1/3] selftests/livepatch: Don't clear dmesg when running tests Joe Lawrence
2020-06-11  7:38   ` Miroslav Benes
2020-06-11 13:01     ` Joe Lawrence
2020-06-11 13:06       ` Miroslav Benes
2020-06-12  9:49   ` Petr Mladek
2020-06-14 15:19     ` Joe Lawrence
2020-06-12 10:11   ` Petr Mladek
2020-06-10 17:21 ` [PATCH 2/3] selftests/livepatch: use $(dmesg --notime) instead of manually filtering Joe Lawrence
2020-06-12 10:12   ` Petr Mladek
2020-06-10 17:21 ` [PATCH 3/3] selftests/livepatch: filter 'taints' from dmesg comparison Joe Lawrence
2020-06-11  7:39   ` Miroslav Benes
2020-06-11 13:10     ` Joe Lawrence
2020-06-12 11:47       ` Petr Mladek
2020-06-12 12:57         ` Kamalesh Babulal
2020-06-14 14:45           ` Joe Lawrence [this message]
2020-06-15  7:55             ` Miroslav Benes
2020-06-15  9:19               ` Petr Mladek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b1db9ae1-781c-6ea5-c748-0928bed145f1@redhat.com \
    --to=joe.lawrence@redhat.com \
    --cc=kamalesh@linux.vnet.ibm.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=pmladek@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).