Re: [PATCH] selftests/livepatch: push and pop dynamic debug config

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx>

Best Regards,
Petr



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux