* [Cluster-devel] [TRIVIAL PATCH 00/26] treewide: Add and use vsprintf extension %pSR
@ 2012-12-12 18:18 Joe Perches
2012-12-12 18:19 ` [Cluster-devel] [TRIVIAL PATCH 19/26] gfs2: Convert print_symbol to %pSR Joe Perches
0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2012-12-12 18:18 UTC (permalink / raw)
To: cluster-devel.redhat.com
Remove the somewhat awkward uses of print_symbol and convert all the
existing uses to a new vsprintf pointer type of %pSR.
print_symbol can be interleaved when it is used in a sequence like:
printk("something: ...");
print_symbol("%s", addr);
printk("\n");
Instead use:
printk("something: %pSR\n", (void *)addr);
Add a new %p[SsFf]R vsprintf extension that can perform the same
symbol function/address/offset formatting as print_symbol to
reduce the number and styles of message logging functions.
print_symbol used __builtin_extract_return_addr for those architectures
like S/390 and SPARC that have offset or masked addressing.
%p[FfSs]R uses the same gcc __builtin
Joe Perches (26):
vsprintf: Add extension %pSR - print_symbol replacement
alpha: Convert print_symbol to %pSR
arm: Convert print_symbol to %pSR
arm64: Convert print_symbol to %pSR
avr32: Convert print_symbol to %pSR
c6x: Convert print_symbol to %pSR
ia64: Convert print_symbol to %pSR
m32r: Convert print_symbol to %pSR
mn10300: Convert print_symbol to %pSR
openrisc: Convert print_symbol to %pSR
powerpc: Convert print_symbol to %pSR
s390: Convert print_symbol to %pSR
sh: Convert print_symbol to %pSR
um: Convert print_symbol to %pSR
unicore32: Convert print_symbol to %pSR
x86: Convert print_symbol to %pSR
xtensa: Convert print_symbol to %pSR
drivers: base: Convert print_symbol to %pSR
gfs2: Convert print_symbol to %pSR
sysfs: Convert print_symbol to %pSR
irq: Convert print_symbol to %pSR
smp_processor_id: Convert print_symbol to %pSR
mm: Convert print_symbol to %pSR
xtensa: Convert print_symbol to %pSR
x86: head_64.S: Use vsprintf extension %pSR not print_symbol
kallsyms: Remove print_symbol
Documentation/filesystems/sysfs.txt | 4 +-
Documentation/printk-formats.txt | 2 +
Documentation/zh_CN/filesystems/sysfs.txt | 4 +-
arch/alpha/kernel/traps.c | 8 ++----
arch/arm/kernel/process.c | 4 +-
arch/arm64/kernel/process.c | 4 +-
arch/avr32/kernel/process.c | 25 ++++++-----------------
arch/c6x/kernel/traps.c | 3 +-
arch/ia64/kernel/process.c | 13 ++++-------
arch/m32r/kernel/traps.c | 6 +---
arch/mn10300/kernel/traps.c | 8 +++---
arch/openrisc/kernel/traps.c | 7 +----
arch/powerpc/platforms/cell/spu_callbacks.c | 12 ++++------
arch/s390/kernel/traps.c | 28 +++++++++++++++-----------
arch/sh/kernel/process_32.c | 4 +-
arch/um/kernel/sysrq.c | 6 +---
arch/unicore32/kernel/process.c | 5 ++-
arch/x86/kernel/cpu/mcheck/mce.c | 13 ++++++-----
arch/x86/kernel/dumpstack.c | 5 +--
arch/x86/kernel/head_64.S | 4 +-
arch/x86/kernel/process_32.c | 2 +-
arch/x86/mm/mmio-mod.c | 4 +-
arch/x86/um/sysrq_32.c | 9 ++-----
arch/xtensa/kernel/traps.c | 6 +---
drivers/base/core.c | 4 +-
fs/gfs2/glock.c | 4 +-
fs/gfs2/trans.c | 3 +-
fs/sysfs/file.c | 4 +-
include/linux/kallsyms.h | 18 -----------------
kernel/irq/debug.h | 15 ++++++-------
kernel/kallsyms.c | 11 ----------
lib/smp_processor_id.c | 2 +-
lib/vsprintf.c | 18 ++++++++++++----
mm/memory.c | 8 +++---
mm/slab.c | 8 ++----
35 files changed, 117 insertions(+), 164 deletions(-)
--
1.7.8.112.g3fd21
^ permalink raw reply [flat|nested] 4+ messages in thread* [Cluster-devel] [TRIVIAL PATCH 19/26] gfs2: Convert print_symbol to %pSR 2012-12-12 18:18 [Cluster-devel] [TRIVIAL PATCH 00/26] treewide: Add and use vsprintf extension %pSR Joe Perches @ 2012-12-12 18:19 ` Joe Perches 2012-12-13 10:57 ` Steven Whitehouse 0 siblings, 1 reply; 4+ messages in thread From: Joe Perches @ 2012-12-12 18:19 UTC (permalink / raw) To: cluster-devel.redhat.com Use the new vsprintf extension to avoid any possible message interleaving. Signed-off-by: Joe Perches <joe@perches.com> --- fs/gfs2/glock.c | 4 ++-- fs/gfs2/trans.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 992c5c0..453978b 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -1016,11 +1016,11 @@ do_cancel: return; trap_recursive: - print_symbol(KERN_ERR "original: %s\n", gh2->gh_ip); + printk(KERN_ERR "original: %pSR\n", (void *)gh2->gh_ip); printk(KERN_ERR "pid: %d\n", pid_nr(gh2->gh_owner_pid)); printk(KERN_ERR "lock type: %d req lock state : %d\n", gh2->gh_gl->gl_name.ln_type, gh2->gh_state); - print_symbol(KERN_ERR "new: %s\n", gh->gh_ip); + printk(KERN_ERR "new: %pSR\n", (void *)gh->gh_ip); printk(KERN_ERR "pid: %d\n", pid_nr(gh->gh_owner_pid)); printk(KERN_ERR "lock type: %d req lock state : %d\n", gh->gh_gl->gl_name.ln_type, gh->gh_state); diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c index 4136270..3d8aa7f 100644 --- a/fs/gfs2/trans.c +++ b/fs/gfs2/trans.c @@ -95,7 +95,8 @@ static void gfs2_log_release(struct gfs2_sbd *sdp, unsigned int blks) static void gfs2_print_trans(const struct gfs2_trans *tr) { - print_symbol(KERN_WARNING "GFS2: Transaction created at: %s\n", tr->tr_ip); + printk(KERN_WARNING "GFS2: Transaction created at: %pSR\n", + (void *)tr->tr_ip); printk(KERN_WARNING "GFS2: blocks=%u revokes=%u reserved=%u touched=%d\n", tr->tr_blocks, tr->tr_revokes, tr->tr_reserved, tr->tr_touched); printk(KERN_WARNING "GFS2: Buf %u/%u Databuf %u/%u Revoke %u/%u\n", -- 1.7.8.112.g3fd21 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Cluster-devel] [TRIVIAL PATCH 19/26] gfs2: Convert print_symbol to %pSR 2012-12-12 18:19 ` [Cluster-devel] [TRIVIAL PATCH 19/26] gfs2: Convert print_symbol to %pSR Joe Perches @ 2012-12-13 10:57 ` Steven Whitehouse 2013-04-29 13:23 ` Jiri Kosina 0 siblings, 1 reply; 4+ messages in thread From: Steven Whitehouse @ 2012-12-13 10:57 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, Acked-by: Steven Whitehouse <swhiteho@redhat.com> Steve. On Wed, 2012-12-12 at 10:19 -0800, Joe Perches wrote: > Use the new vsprintf extension to avoid any possible > message interleaving. > > Signed-off-by: Joe Perches <joe@perches.com> > --- > fs/gfs2/glock.c | 4 ++-- > fs/gfs2/trans.c | 3 ++- > 2 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c > index 992c5c0..453978b 100644 > --- a/fs/gfs2/glock.c > +++ b/fs/gfs2/glock.c > @@ -1016,11 +1016,11 @@ do_cancel: > return; > > trap_recursive: > - print_symbol(KERN_ERR "original: %s\n", gh2->gh_ip); > + printk(KERN_ERR "original: %pSR\n", (void *)gh2->gh_ip); > printk(KERN_ERR "pid: %d\n", pid_nr(gh2->gh_owner_pid)); > printk(KERN_ERR "lock type: %d req lock state : %d\n", > gh2->gh_gl->gl_name.ln_type, gh2->gh_state); > - print_symbol(KERN_ERR "new: %s\n", gh->gh_ip); > + printk(KERN_ERR "new: %pSR\n", (void *)gh->gh_ip); > printk(KERN_ERR "pid: %d\n", pid_nr(gh->gh_owner_pid)); > printk(KERN_ERR "lock type: %d req lock state : %d\n", > gh->gh_gl->gl_name.ln_type, gh->gh_state); > diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c > index 4136270..3d8aa7f 100644 > --- a/fs/gfs2/trans.c > +++ b/fs/gfs2/trans.c > @@ -95,7 +95,8 @@ static void gfs2_log_release(struct gfs2_sbd *sdp, unsigned int blks) > > static void gfs2_print_trans(const struct gfs2_trans *tr) > { > - print_symbol(KERN_WARNING "GFS2: Transaction created at: %s\n", tr->tr_ip); > + printk(KERN_WARNING "GFS2: Transaction created at: %pSR\n", > + (void *)tr->tr_ip); > printk(KERN_WARNING "GFS2: blocks=%u revokes=%u reserved=%u touched=%d\n", > tr->tr_blocks, tr->tr_revokes, tr->tr_reserved, tr->tr_touched); > printk(KERN_WARNING "GFS2: Buf %u/%u Databuf %u/%u Revoke %u/%u\n", ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Cluster-devel] [TRIVIAL PATCH 19/26] gfs2: Convert print_symbol to %pSR 2012-12-13 10:57 ` Steven Whitehouse @ 2013-04-29 13:23 ` Jiri Kosina 0 siblings, 0 replies; 4+ messages in thread From: Jiri Kosina @ 2013-04-29 13:23 UTC (permalink / raw) To: cluster-devel.redhat.com On Thu, 13 Dec 2012, Steven Whitehouse wrote: > Acked-by: Steven Whitehouse <swhiteho@redhat.com> Applied. -- Jiri Kosina SUSE Labs ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-04-29 13:23 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-12-12 18:18 [Cluster-devel] [TRIVIAL PATCH 00/26] treewide: Add and use vsprintf extension %pSR Joe Perches 2012-12-12 18:19 ` [Cluster-devel] [TRIVIAL PATCH 19/26] gfs2: Convert print_symbol to %pSR Joe Perches 2012-12-13 10:57 ` Steven Whitehouse 2013-04-29 13:23 ` Jiri Kosina
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).