lkml.org 
[lkml]   [2024]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v4 27/39] dyndbg: update "ddcmd =:foo" behavior
Date
Previously the following commands were equivalent

ddcmd =_:foo
ddcmd =:foo

and both unset all flags and set foo label.

This patch modifies the behavior of the command

ddcmd =:foo

to set (only) the foo label and preserve the flags.

Signed-off-by: Łukasz Bartosik <ukaszb@chromium.org>
---
lib/dynamic_debug.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 3a9dd73357c8..7723bb7dfc46 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -882,6 +882,7 @@ static int ddebug_parse_query(char *words[], int nwords,
*/
static int ddebug_parse_flags(const char *str, struct flag_settings *modifiers)
{
+ bool explicit_no_flags = !strchr(str, '_') ? false : true;
read_flag_args_f read_args;
int op, i;
char *fst;
@@ -927,6 +928,14 @@ static int ddebug_parse_flags(const char *str, struct flag_settings *modifiers)
case '=':
/* modifiers->flags already set */
modifiers->mask = 0;
+
+ /*
+ * cover the case where "ddcmd =:foo" sets (only)
+ * the foo label, since no flags are given
+ */
+ if (!explicit_no_flags && !modifiers->flags &&
+ modifiers->trace_dst != DST_NOT_SET)
+ modifiers->mask = ~0U;
break;
case '+':
modifiers->mask = ~0U;
--
2.43.0.687.g38aa6559b0-goog

\
 
 \ /
  Last update: 2024-05-27 14:57    [W:0.501 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site