Whamcloud - gitweb
LU-16314 debug: Enable optional unhashed pointers 77/51877/15
authorShaun Tancheff <shaun.tancheff@hpe.com>
Wed, 18 Oct 2023 09:27:10 +0000 (04:27 -0500)
committerOleg Drokin <green@whamcloud.com>
Thu, 15 Feb 2024 07:05:55 +0000 (07:05 +0000)
commit50baa82e334c7e5c2323d6e01309d922d67e01fd
tree8da0009fae3e9d89138e78fd2c6e1d4121f0ec57
parent772d09d3144d6c85af7dd6c06a06a19b01b12a36
LU-16314 debug: Enable optional unhashed pointers

This patch takes a page out of the kernel trace debug
playbook to rewrite format strings and change %p -> %px
on-the-fly when:

   libcfs_debug_raw_pointers

is enabled.

The module parameter can be viewed and modified by root
via lctl:
    lctl get_param debug_raw_pointers
    lctl set_param debug_raw_pointers=1

Since nothing uses the return value from libcfs_debug_msg
change it to void.

Use percpu pre-allocated buffers for holding modified
format strings to avoid kmalloc/kfree as well as avoid
bloating stack usage.

HPE-bug-id: LUS-10945
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I63d90d614ce4435b07f5e84991a12ae7351ac2bb
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51877
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com>
libcfs/include/libcfs/libcfs_debug.h
libcfs/libcfs/tracefile.c
lustre/obdclass/obd_sysfs.c
lustre/tests/test-framework.sh