| From | Jim Cromie <> | Subject | [PATCH 15/21] dynamic_debug: describe_flags with '=[ptmfl]*' | Date | Mon, 11 Jul 2011 01:46:50 -0600 |
| |
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@gmail.com> --- 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
|