[PATCH v6 57/57] dyndbg: fiddle with readback value on LEVEL_NAMES types

Jim Cromie jim.cromie at gmail.com
Sun Sep 4 21:41:34 UTC 2022


my test scripts were writing one val, reading back val+1

  echo L3 > p_level_names
  cat p_level_names
  L4

fix this w a -1 offset.

Signed-off-by: Jim Cromie <jim.cromie at gmail.com>
---
 lib/dynamic_debug.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 11fea1f818a7..7d458601a61b 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -830,6 +830,8 @@ int param_get_dyndbg_classes(char *buffer, const struct kernel_param *kp)
 		return scnprintf(buffer, PAGE_SIZE, "0x%lx\n", *dcp->bits);
 
 	case DD_CLASS_TYPE_LEVEL_NAMES:
+		return scnprintf(buffer, PAGE_SIZE, "%d\n", *dcp->lvl - 1);
+
 	case DD_CLASS_TYPE_LEVEL_NUM:
 		return scnprintf(buffer, PAGE_SIZE, "%d\n", *dcp->lvl);
 	default:
-- 
2.37.2



More information about the amd-gfx mailing list