* [PATCH 0/9] treewide: convert vprintk uses to %pV
@ 2010-11-10 0:35 Joe Perches
2010-11-10 0:35 ` [PATCH 9/9] net/sunrpc/svc.c: Use printf extension %pV Joe Perches
2010-11-10 22:48 ` [PATCH 0/9] treewide: convert vprintk uses to %pV Luis R. Rodriguez
0 siblings, 2 replies; 4+ messages in thread
From: Joe Perches @ 2010-11-10 0:35 UTC (permalink / raw)
To: linux-kernel
Cc: dri-devel, netdev, linux-wireless, cluster-devel, linux-nilfs,
linux-nfs
Multiple secessive calls to printk can be interleaved.
Avoid this possible interleaving by using %pV
Joe Perches (9):
drivers/gpu/drm/drm_stub.c: Use printf extension %pV
drivers/isdn/mISDN: Use printf extension %pV
drivers/net/wireless/ath/debug.c: Use printf extension %pV
drivers/net/wireless/b43/main.c: Use printf extension %pV
drivers/net/wireless/b43legacy/main.c: Use printf extension %pV
fs/gfs2/glock.c: Use printf extension %pV
fs/nilfs2/super.c: Use printf extension %pV
fs/quota/dquot.c: Use printf extension %pV
net/sunrpc/svc.c: Use printf extension %pV
drivers/gpu/drm/drm_stub.c | 14 +++++++--
drivers/isdn/mISDN/layer1.c | 10 +++++--
drivers/isdn/mISDN/layer2.c | 12 ++++++--
drivers/isdn/mISDN/tei.c | 23 +++++++++++----
drivers/net/wireless/ath/debug.c | 9 +++++-
drivers/net/wireless/b43/main.c | 48 ++++++++++++++++++++++++--------
drivers/net/wireless/b43legacy/main.c | 47 ++++++++++++++++++++++++--------
fs/gfs2/glock.c | 9 +++++-
fs/nilfs2/super.c | 23 +++++++++++-----
fs/quota/dquot.c | 12 +++++---
net/sunrpc/svc.c | 12 +++++---
11 files changed, 161 insertions(+), 58 deletions(-)
--
1.7.3.1.g432b3.dirty
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 9/9] net/sunrpc/svc.c: Use printf extension %pV
2010-11-10 0:35 [PATCH 0/9] treewide: convert vprintk uses to %pV Joe Perches
@ 2010-11-10 0:35 ` Joe Perches
2010-11-10 22:48 ` [PATCH 0/9] treewide: convert vprintk uses to %pV Luis R. Rodriguez
1 sibling, 0 replies; 4+ messages in thread
From: Joe Perches @ 2010-11-10 0:35 UTC (permalink / raw)
To: linux-kernel
Cc: J. Bruce Fields, Neil Brown, Trond Myklebust, David S. Miller,
linux-nfs, netdev
Using %pV reduces the number of printk calls and
eliminates any possible message interleaving from
other printk calls.
Signed-off-by: Joe Perches <joe@perches.com>
---
net/sunrpc/svc.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 6359c42..e28ddb3 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -962,6 +962,7 @@ static int
__attribute__ ((format (printf, 2, 3)))
svc_printk(struct svc_rqst *rqstp, const char *fmt, ...)
{
+ struct va_format vaf;
va_list args;
int r;
char buf[RPC_MAX_ADDRBUFLEN];
@@ -969,11 +970,14 @@ svc_printk(struct svc_rqst *rqstp, const char *fmt, ...)
if (!net_ratelimit())
return 0;
- printk(KERN_WARNING "svc: %s: ",
- svc_print_addr(rqstp, buf, sizeof(buf)));
-
va_start(args, fmt);
- r = vprintk(fmt, args);
+
+ vaf.fmt = fmt;
+ vaf.va = &args;
+
+ r = printk(KERN_WARNING "svc: %s: %pV",
+ svc_print_addr(rqstp, buf, sizeof(buf)), &vaf);
+
va_end(args);
return r;
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/9] treewide: convert vprintk uses to %pV
2010-11-10 0:35 [PATCH 0/9] treewide: convert vprintk uses to %pV Joe Perches
2010-11-10 0:35 ` [PATCH 9/9] net/sunrpc/svc.c: Use printf extension %pV Joe Perches
@ 2010-11-10 22:48 ` Luis R. Rodriguez
2010-11-10 23:01 ` Joe Perches
1 sibling, 1 reply; 4+ messages in thread
From: Luis R. Rodriguez @ 2010-11-10 22:48 UTC (permalink / raw)
To: Joe Perches
Cc: linux-kernel, dri-devel, netdev, linux-wireless, cluster-devel,
linux-nilfs, linux-nfs
On Tue, Nov 9, 2010 at 4:35 PM, Joe Perches <joe@perches.com> wrote:
> Multiple secessive calls to printk can be interleaved.
> Avoid this possible interleaving by using %pV
>
> Joe Perches (9):
> =C2=A0drivers/gpu/drm/drm_stub.c: Use printf extension %pV
> =C2=A0drivers/isdn/mISDN: Use printf extension %pV
> =C2=A0drivers/net/wireless/ath/debug.c: Use printf extension %pV
> =C2=A0drivers/net/wireless/b43/main.c: Use printf extension %pV
> =C2=A0drivers/net/wireless/b43legacy/main.c: Use printf extension %pV
> =C2=A0fs/gfs2/glock.c: Use printf extension %pV
> =C2=A0fs/nilfs2/super.c: Use printf extension %pV
> =C2=A0fs/quota/dquot.c: Use printf extension %pV
> =C2=A0net/sunrpc/svc.c: Use printf extension %pV
>
> =C2=A0drivers/gpu/drm/drm_stub.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0| =C2=A0 14 +++++++--
> =C2=A0drivers/isdn/mISDN/layer1.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
| =C2=A0 10 +++++--
> =C2=A0drivers/isdn/mISDN/layer2.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
| =C2=A0 12 ++++++--
> =C2=A0drivers/isdn/mISDN/tei.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0| =C2=A0 23 +++++++++++----
> =C2=A0drivers/net/wireless/ath/debug.c =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=
=A09 +++++-
> =C2=A0drivers/net/wireless/b43/main.c =C2=A0 =C2=A0 =C2=A0 | =C2=A0 4=
8 ++++++++++++++++++++++++--------
> =C2=A0drivers/net/wireless/b43legacy/main.c | =C2=A0 47 +++++++++++++=
+++++++++++--------
> =C2=A0fs/gfs2/glock.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A09 +++++-
> =C2=A0fs/nilfs2/super.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 | =C2=A0 23 +++++++++++-----
> =C2=A0fs/quota/dquot.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
=C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 12 +++++---
> =C2=A0net/sunrpc/svc.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
=C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 12 +++++---
> =C2=A011 files changed, 161 insertions(+), 58 deletions(-)
When was this added upstream BTW? I ask for backport considerations.
Luis
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 0/9] treewide: convert vprintk uses to %pV
2010-11-10 22:48 ` [PATCH 0/9] treewide: convert vprintk uses to %pV Luis R. Rodriguez
@ 2010-11-10 23:01 ` Joe Perches
0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2010-11-10 23:01 UTC (permalink / raw)
To: Luis R. Rodriguez
Cc: linux-kernel, dri-devel, netdev, linux-wireless, cluster-devel,
linux-nilfs, linux-nfs
On Wed, 2010-11-10 at 14:48 -0800, Luis R. Rodriguez wrote:
> When was this added upstream BTW? I ask for backport considerations.
commit 7db6f5fb65a82af03229eef104dc9899c5eecf33
Author: Joe Perches <joe@perches.com>
Date: Sun Jun 27 01:02:33 2010 +0000
vsprintf: Recursive vsnprintf: Add "%pV", struct va_format
Add the ability to print a format and va_list from a structure pointer
Allows __dev_printk to be implemented as a single printk while
minimizing string space duplication.
%pV should not be used without some mechanism to verify the
format and argument use ala __attribute__(format (printf(...))).
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-11-10 23:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-10 0:35 [PATCH 0/9] treewide: convert vprintk uses to %pV Joe Perches
2010-11-10 0:35 ` [PATCH 9/9] net/sunrpc/svc.c: Use printf extension %pV Joe Perches
2010-11-10 22:48 ` [PATCH 0/9] treewide: convert vprintk uses to %pV Luis R. Rodriguez
2010-11-10 23:01 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).