From: Jim Cromie <jim.cromie@gmail.com>
To: jbaron@redhat.com, linux-kernel@vger.kernel.org
Cc: kay@vrfy.com, joe@perches.com, greg@kroah.com,
Jim Cromie <jim.cromie@gmail.com>
Subject: [PATCH 2/3] dyndbg: in dynamic_emit_prefix, change inter-field separator
Date: Thu, 19 Jul 2012 13:46:22 -0600 [thread overview]
Message-ID: <1342727183-4520-4-git-send-email-jim.cromie@gmail.com> (raw)
In-Reply-To: <1342727183-4520-1-git-send-email-jim.cromie@gmail.com>
dynamic_emit_prefix() currently separates modname, funcname, lineno
with ':'. This is complicates use of cut -d: <logfile>, since the
field positions can change per callsite with dynamic-debug. So change
inter-field separator to '.' and keep the ':' prefix terminator.
This improves the situation, but doesnt solve it entirely; if
dyndbg==p is used, the callsite is enabled but no prefix is added, so
theres one less ':' in the message. Changing the terminator to ','
would fix this, and might be warranted.
pr_fmt(fmt) KBUILD_MODNAME ": " fmt, also adds another ':'.
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
lib/dynamic_debug.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 7ca29a0..6bc34aa 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -532,16 +532,18 @@ static char *dynamic_emit_prefix(const struct _ddebug *desc, char *buf)
}
pos_after_tid = pos;
if (desc->flags & _DPRINTK_FLAGS_INCL_MODNAME)
- pos += snprintf(buf + pos, remaining(pos), "%s:",
+ pos += snprintf(buf + pos, remaining(pos), "%s.",
desc->modname);
if (desc->flags & _DPRINTK_FLAGS_INCL_FUNCNAME)
- pos += snprintf(buf + pos, remaining(pos), "%s:",
+ pos += snprintf(buf + pos, remaining(pos), "%s.",
desc->function);
if (desc->flags & _DPRINTK_FLAGS_INCL_LINENO)
- pos += snprintf(buf + pos, remaining(pos), "%d:",
+ pos += snprintf(buf + pos, remaining(pos), "%d.",
desc->lineno);
- if (pos - pos_after_tid)
- pos += snprintf(buf + pos, remaining(pos), " ");
+ if (pos - pos_after_tid) {
+ pos--;
+ pos += snprintf(buf + pos, remaining(pos), ": ");
+ }
if (pos >= PREFIX_SIZE)
buf[PREFIX_SIZE - 1] = '\0';
--
1.7.10.4
next prev parent reply other threads:[~2012-07-19 19:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-19 19:46 [PATCH 0/3] dyndbg: dev_dbg bugfix + 2 trivials Jim Cromie
2012-07-19 19:46 ` [PATCH 1/3] drivers-core: make structured logging play nice with dynamic-debug Jim Cromie
2012-07-23 13:07 ` Jason Baron
2012-07-23 17:09 ` Joe Perches
2012-07-23 20:31 ` Jim Cromie
2012-07-19 19:46 ` Jim Cromie
2012-07-19 19:46 ` Jim Cromie [this message]
2012-07-19 19:46 ` [PATCH 3/3] dyndbg: change varname verbose_bytes to sz_used Jim Cromie
2012-07-20 20:38 ` [PATCH 0/3] dyndbg: dev_dbg bugfix + 2 trivials Jason Baron
2012-07-20 20:58 ` Greg KH
2012-07-24 21:40 ` Jim Cromie
2012-07-24 22:28 ` Joe Perches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1342727183-4520-4-git-send-email-jim.cromie@gmail.com \
--to=jim.cromie@gmail.com \
--cc=greg@kroah.com \
--cc=jbaron@redhat.com \
--cc=joe@perches.com \
--cc=kay@vrfy.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®