From: Petr Mladek <pmladek@suse.com>
To: Joe Lawrence <joe.lawrence@redhat.com>
Cc: linux-kselftest@vger.kernel.org, live-patching@vger.kernel.org
Subject: Re: [PATCH] selftests/livepatch: push and pop dynamic debug config
Date: Fri, 19 Jul 2019 12:46:25 +0200 [thread overview]
Message-ID: <20190719104625.5aigkzsm5wh3d5kn@pathway.suse.cz> (raw)
In-Reply-To: <e5027867-88db-fa45-6767-286f3b7b86ad@redhat.com>
On Thu 2019-07-18 16:42:25, Joe Lawrence wrote:
> On 7/18/19 4:29 PM, Joe Lawrence wrote:
> > The livepatching self-tests tweak the dynamic debug config to verify
> > the kernel log during the tests. Enhance set_dynamic_debug() so that
> > the config changes are restored when the script exits.
> >
> > diff --git a/tools/testing/selftests/livepatch/functions.sh b/tools/testing/selftests/livepatch/functions.sh
> > index de5a504ffdbc..860f27665ebd 100644
> > --- a/tools/testing/selftests/livepatch/functions.sh
> > +++ b/tools/testing/selftests/livepatch/functions.sh
> > @@ -29,13 +29,27 @@ function die() {
> > exit 1
> > }
> > -# set_dynamic_debug() - setup kernel dynamic debug
> > -# TODO - push and pop this config?
> > +function push_dynamic_debug() {
> > + DYNAMIC_DEBUG=$(grep '^kernel/livepatch' /sys/kernel/debug/dynamic_debug/control | \
> > + awk -F'[: ]' '{print "file " $1 " line " $2 " " $4}')
> > +}
>
> It works for me, though I feel that the
> /sys/kernel/debug/dynamic_debug/control output to input translation is
> brittle. It would be nice to have some kind of mass export/import
> capability for that interface.
I believe that the format is pretty stable. We could always reconsider
it when it breaks.
I could confirm that it restores the original state, so:
Tested-by: Petr Mladek <pmladek@suse.com>
Best Regards,
Petr
next prev parent reply other threads:[~2019-07-19 10:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-18 20:29 [PATCH] selftests/livepatch: push and pop dynamic debug config Joe Lawrence
2019-07-18 20:42 ` Joe Lawrence
2019-07-19 10:46 ` Petr Mladek [this message]
2019-07-30 17:31 ` Joe Lawrence
2019-07-30 21:26 ` shuah
2019-07-30 21:52 ` shuah
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=20190719104625.5aigkzsm5wh3d5kn@pathway.suse.cz \
--to=pmladek@suse.com \
--cc=joe.lawrence@redhat.com \
--cc=linux-kselftest@vger.kernel.org \
--cc=live-patching@vger.kernel.org \
/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).