[PATCH v3 0/2] add sysfs entry "patched" for each klp_object

Song Liu posted 2 patches 3 years, 7 months ago
.../ABI/testing/sysfs-kernel-livepatch        |  8 ++
kernel/livepatch/core.c                       | 18 ++++
tools/testing/selftests/livepatch/Makefile    |  3 +-
.../testing/selftests/livepatch/functions.sh  | 34 ++++++++
.../testing/selftests/livepatch/test-sysfs.sh | 86 +++++++++++++++++++
5 files changed, 148 insertions(+), 1 deletion(-)
create mode 100755 tools/testing/selftests/livepatch/test-sysfs.sh
[PATCH v3 0/2] add sysfs entry "patched" for each klp_object
Posted by Song Liu 3 years, 7 months ago
I was debugging an issue that a livepatch appears to be attached, but
actually not. It turns out that there is a mismatch in module name
(abc-xyz vs. abc_xyz), klp_find_object_module failed to find the module.
Add a sysfs entry for each klp_object, so that it is easier to debug
such issues.

Changes v2 => v3:
1. Improve selftest. (Petr Mladek and Joe Lawrence)

Changes v1 => v2:
1. Add selftest. (Petr Mladek)
2. Update documentation. (Petr Mladek)
3. Use sysfs_emit. (Petr Mladek)

Song Liu (2):
  livepatch: add sysfs entry "patched" for each klp_object
  selftests/livepatch: add sysfs test

 .../ABI/testing/sysfs-kernel-livepatch        |  8 ++
 kernel/livepatch/core.c                       | 18 ++++
 tools/testing/selftests/livepatch/Makefile    |  3 +-
 .../testing/selftests/livepatch/functions.sh  | 34 ++++++++
 .../testing/selftests/livepatch/test-sysfs.sh | 86 +++++++++++++++++++
 5 files changed, 148 insertions(+), 1 deletion(-)
 create mode 100755 tools/testing/selftests/livepatch/test-sysfs.sh

--
2.30.2
Re: [PATCH v3 0/2] add sysfs entry "patched" for each klp_object
Posted by Petr Mladek 3 years, 6 months ago
On Fri 2022-09-02 13:52:06, Song Liu wrote:
> I was debugging an issue that a livepatch appears to be attached, but
> actually not. It turns out that there is a mismatch in module name
> (abc-xyz vs. abc_xyz), klp_find_object_module failed to find the module.
> Add a sysfs entry for each klp_object, so that it is easier to debug
> such issues.
> 
> Changes v2 => v3:
> 1. Improve selftest. (Petr Mladek and Joe Lawrence)
> 
> Changes v1 => v2:
> 1. Add selftest. (Petr Mladek)
> 2. Update documentation. (Petr Mladek)
> 3. Use sysfs_emit. (Petr Mladek)
> 
> Song Liu (2):
>   livepatch: add sysfs entry "patched" for each klp_object
>   selftests/livepatch: add sysfs test

For both patches:

Reviewed-by: Petr Mladek <pmladek@suse.com>

And I have pushed the patchset into livepatching.git,
for-6.1/sysfs-patched-object.

Best Regards,
Petr