Re: [PATCH] selftests/livepatch: push and pop dynamic debug config
From: shuah <shuah@kernel.org>
Date: 2019-07-30 21:26:21
Also in:
linux-kselftest
On 7/30/19 11:31 AM, Joe Lawrence wrote:
On 7/19/19 6:46 AM, Petr Mladek wrote:quoted
On Thu 2019-07-18 16:42:25, Joe Lawrence wrote:quoted
On 7/18/19 4:29 PM, Joe Lawrence wrote:quoted
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.shb/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, PetrHi Shuah, Can you review and route this patch through your tree as well?
Looks good to me. Thanks for doing this. I will pick this up thanks, -- Shuah