[v4,23/39] dyndbg: display the bad flag-val in parse-flags err msg

Message ID 20240210235009.2405808-24-ukaszb@chromium.org
State New
Headers
Series dyndbg: add support for writing debug logs to trace |

Commit Message

Ɓukasz Bartosik Feb. 10, 2024, 11:49 p.m. UTC
  From: Jim Cromie <jim.cromie@gmail.com>

If ddebug_parse_flags() rejects user input, identify that input value
in the error message.

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

Patch

diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 4954d3e5be5b..089765afc972 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -973,7 +973,7 @@  static int ddebug_exec_query(char *query_string, const char *modname)
 
 	/* check flags 1st (last arg) so query is pairs of spec,val */
 	if (ddebug_parse_flags(words[nwords-1], &modifiers)) {
-		pr_err("flags parse failed\n");
+		pr_err("flags parse failed on word-%d: %s\n", nwords-1, words[nwords-1]);
 		goto err;
 	}