selftests/livepatch: push and pop dynamic debug config
authorJoe Lawrence <joe.lawrence@redhat.com>
Thu, 18 Jul 2019 20:29:48 +0000 (16:29 -0400)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 30 Jul 2019 21:47:10 +0000 (15:47 -0600)
commitfbb01c52471c8fb4ec2422c0ab26c134bd90bbff
treec4b41180f0f34007d38e42df4c8d185d0f9ff8d6
parentfc2e634e997d84f2610a482b500865ef2c04fcde
selftests/livepatch: push and pop dynamic debug config

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.

Note this functionality needs to keep in sync with:
  - dynamic_debug input/output formatting
  - functions affected by set_dynamic_debug()

  For example, push_dynamic_debug() transforms:
    kernel/livepatch/transition.c:530 [livepatch]klp_init_transition =_ "'%s': initializing %s transition\012"
  to the following:
    file kernel/livepatch/transition.c line 530 =_

Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
Tested-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/livepatch/functions.sh