[PATCH 15/21] dynamic_debug: describe_flags with '=[ptmfl]*'

From: Jim Cromie
Date: Mon Jul 11 2011 - 03:49:11 EST


Describe flags in text using =<flag-chars>. This has better mnemonics
than the current dash-unless-flags, it says "Flags are = <flag-chars>",
and =<flags> is more selective in a grep; '=' will not show up in module
or filenames, nor in line-ranges.

This isnt yet optimal; "grep ' = ' control" reports on a couple dozen
format-strings, this could be avoided by altering describe_flags()
to emit '-' or '_' for empty flags, such that the grep for empty
flags would be '=_'. TBD.

Signed-off-by: Jim Cromie <jim.cromie@xxxxxxxxx>
---
lib/dynamic_debug.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index d115f52..31ee0fd 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -102,11 +102,10 @@ static char *ddebug_describe_flags(struct _ddebug *dp, char *buf,
int i;

BUG_ON(maxlen < 4);
+ *p++ = '=';
for (i = 0; i < ARRAY_SIZE(opt_array); ++i)
if (dp->flags & opt_array[i].flag)
*p++ = opt_array[i].opt_char;
- if (p == buf)
- *p++ = '-';
*p = '\0';

return buf;
--
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/