public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] [GIT PULL] tracing: more updates for v2.6.32
@ 2009-09-17 19:55 Steven Rostedt
  2009-09-17 19:55 ` [PATCH 1/5] [PATCH 1/5] vsprintf: add %ps that is the same as %pS but is like %pf Steven Rostedt
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Steven Rostedt @ 2009-09-17 19:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker


Ingo,

This is a rebase of the core5 I pushed earlier. Changes are:

- rebased against your pull of Linus's latest
- Added Ben's Acked-by.
- Three new patches:
   * oprofile: fix oprofile regression: select RING_BUFFER_ALLOW_SWAP
   * softirq: add BLOCK_IOPOLL to softirq_to_name
   * vsnprintf: remove duplicate comment of vsnprintf


Please pull the latest tip/tracing/core tree, which can be found at:

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
tip/tracing/core


Christian Borntraeger (1):
      oprofile: fix oprofile regression: select RING_BUFFER_ALLOW_SWAP

Li Zefan (1):
      softirq: add BLOCK_IOPOLL to softirq_to_name

Steven Rostedt (3):
      vsprintf: add %ps that is the same as %pS but is like %pf
      tracing: switch function prints from %pf to %ps
      vsnprintf: remove duplicate comment of vsnprintf

----
 arch/Kconfig                         |    1 +
 include/trace/events/irq.h           |   21 +++++++++++----------
 kernel/softirq.c                     |    2 +-
 kernel/trace/ftrace.c                |    6 +++---
 kernel/trace/trace_functions.c       |    2 +-
 kernel/trace/trace_functions_graph.c |    6 +++---
 lib/vsprintf.c                       |   16 ++++++++--------
 7 files changed, 28 insertions(+), 26 deletions(-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/5] [PATCH 1/5] vsprintf: add %ps that is the same as %pS but is like %pf
  2009-09-17 19:55 [PATCH 0/5] [GIT PULL] tracing: more updates for v2.6.32 Steven Rostedt
@ 2009-09-17 19:55 ` Steven Rostedt
  2009-09-17 19:55 ` [PATCH 2/5] [PATCH 2/5] tracing: switch function prints from %pf to %ps Steven Rostedt
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2009-09-17 19:55 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker, Linus Torvalds,
	Zhao Lei, Benjamin Herrenschmidt

[-- Attachment #1: 0001-vsprintf-add-ps-that-is-the-same-as-pS-but-is-like-p.patch --]
[-- Type: text/plain, Size: 2222 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

On PowerPC64 function pointers do not point directly at the functions,
but instead point to pointers to the functions. The output of %pF expects
to point to a pointer to the function, whereas %pS will show the function
itself.

mcount returns the direct pointer to the function and not the pointer to
the pointer. Thus %pS must be used to show this. The function tracer
requires printing of the functions without offsets and uses the %pf
instead.

 %pF produces run_local_timers+0x4/0x1f
 %pf produces just run_local_timers

For PowerPC64, we need to use the direct pointer, and we only have
%pS which will produce .run_local_timers+0x4/0x1f

This patch creates a %ps that matches the %pf as %pS matches %pF.

Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Zhao Lei <zhaolei@cn.fujitsu.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 lib/vsprintf.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index cb8a112..c8f3ed6 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -581,7 +581,7 @@ static char *symbol_string(char *buf, char *end, void *ptr,
 	unsigned long value = (unsigned long) ptr;
 #ifdef CONFIG_KALLSYMS
 	char sym[KSYM_SYMBOL_LEN];
-	if (ext != 'f')
+	if (ext != 'f' && ext != 's')
 		sprint_symbol(sym, value);
 	else
 		kallsyms_lookup(value, NULL, NULL, NULL, sym);
@@ -822,6 +822,7 @@ static char *pointer(const char *fmt, char *buf, char *end, void *ptr,
 	case 'F':
 	case 'f':
 		ptr = dereference_function_descriptor(ptr);
+	case 's':
 		/* Fallthrough */
 	case 'S':
 		return symbol_string(buf, end, ptr, spec, *fmt);
@@ -1063,7 +1064,8 @@ qualifier:
  * @args: Arguments for the format string
  *
  * This function follows C99 vsnprintf, but has some extensions:
- * %pS output the name of a text symbol
+ * %pS output the name of a text symbol with offset
+ * %ps output the name of a text symbol without offset
  * %pF output the name of a function pointer with its offset
  * %pf output the name of a function pointer without its offset
  * %pR output the address range in a struct resource
-- 
1.6.3.3



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/5] [PATCH 2/5] tracing: switch function prints from %pf to %ps
  2009-09-17 19:55 [PATCH 0/5] [GIT PULL] tracing: more updates for v2.6.32 Steven Rostedt
  2009-09-17 19:55 ` [PATCH 1/5] [PATCH 1/5] vsprintf: add %ps that is the same as %pS but is like %pf Steven Rostedt
@ 2009-09-17 19:55 ` Steven Rostedt
  2009-09-17 19:55 ` [PATCH 3/5] [PATCH 3/5] oprofile: fix oprofile regression: select RING_BUFFER_ALLOW_SWAP Steven Rostedt
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2009-09-17 19:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker

[-- Attachment #1: 0002-tracing-switch-function-prints-from-pf-to-ps.patch --]
[-- Type: text/plain, Size: 3081 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

For direct function pointers (like what mcount provides) PowerPC64
requires the use of %ps, otherwise nothing is printed.

This patch converts all prints of functions retrieved through mcount
to use the %ps format from the %pf.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/ftrace.c                |    6 +++---
 kernel/trace/trace_functions.c       |    2 +-
 kernel/trace/trace_functions_graph.c |    6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index f7ab7fc..cc615f8 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1405,7 +1405,7 @@ static int t_hash_show(struct seq_file *m, void *v)
 	if (rec->ops->print)
 		return rec->ops->print(m, rec->ip, rec->ops, rec->data);
 
-	seq_printf(m, "%pf:%pf", (void *)rec->ip, (void *)rec->ops->func);
+	seq_printf(m, "%ps:%ps", (void *)rec->ip, (void *)rec->ops->func);
 
 	if (rec->data)
 		seq_printf(m, ":%p", rec->data);
@@ -1515,7 +1515,7 @@ static int t_show(struct seq_file *m, void *v)
 	if (!rec)
 		return 0;
 
-	seq_printf(m, "%pf\n", (void *)rec->ip);
+	seq_printf(m, "%ps\n", (void *)rec->ip);
 
 	return 0;
 }
@@ -2456,7 +2456,7 @@ static int g_show(struct seq_file *m, void *v)
 		return 0;
 	}
 
-	seq_printf(m, "%pf\n", (void *)*ptr);
+	seq_printf(m, "%ps\n", (void *)*ptr);
 
 	return 0;
 }
diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c
index 5b01b94..b3f3776 100644
--- a/kernel/trace/trace_functions.c
+++ b/kernel/trace/trace_functions.c
@@ -290,7 +290,7 @@ ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip,
 {
 	long count = (long)data;
 
-	seq_printf(m, "%pf:", (void *)ip);
+	seq_printf(m, "%ps:", (void *)ip);
 
 	if (ops == &traceon_probe_ops)
 		seq_printf(m, "traceon");
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 61f1667..45e6c01 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -124,7 +124,7 @@ ftrace_pop_return_trace(struct ftrace_graph_ret *trace, unsigned long *ret,
 	if (unlikely(current->ret_stack[index].fp != frame_pointer)) {
 		ftrace_graph_stop();
 		WARN(1, "Bad frame pointer: expected %lx, received %lx\n"
-		     "  from func %pF return to %lx\n",
+		     "  from func %ps return to %lx\n",
 		     current->ret_stack[index].fp,
 		     frame_pointer,
 		     (void *)current->ret_stack[index].func,
@@ -669,7 +669,7 @@ print_graph_entry_leaf(struct trace_iterator *iter,
 			return TRACE_TYPE_PARTIAL_LINE;
 	}
 
-	ret = trace_seq_printf(s, "%pf();\n", (void *)call->func);
+	ret = trace_seq_printf(s, "%ps();\n", (void *)call->func);
 	if (!ret)
 		return TRACE_TYPE_PARTIAL_LINE;
 
@@ -712,7 +712,7 @@ print_graph_entry_nested(struct trace_iterator *iter,
 			return TRACE_TYPE_PARTIAL_LINE;
 	}
 
-	ret = trace_seq_printf(s, "%pf() {\n", (void *)call->func);
+	ret = trace_seq_printf(s, "%ps() {\n", (void *)call->func);
 	if (!ret)
 		return TRACE_TYPE_PARTIAL_LINE;
 
-- 
1.6.3.3



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/5] [PATCH 3/5] oprofile: fix oprofile regression: select RING_BUFFER_ALLOW_SWAP
  2009-09-17 19:55 [PATCH 0/5] [GIT PULL] tracing: more updates for v2.6.32 Steven Rostedt
  2009-09-17 19:55 ` [PATCH 1/5] [PATCH 1/5] vsprintf: add %ps that is the same as %pS but is like %pf Steven Rostedt
  2009-09-17 19:55 ` [PATCH 2/5] [PATCH 2/5] tracing: switch function prints from %pf to %ps Steven Rostedt
@ 2009-09-17 19:55 ` Steven Rostedt
  2009-09-17 19:55 ` [PATCH 4/5] [PATCH 4/5] softirq: add BLOCK_IOPOLL to softirq_to_name Steven Rostedt
  2009-09-17 19:55 ` [PATCH 5/5] [PATCH 5/5] vsnprintf: remove duplicate comment of vsnprintf Steven Rostedt
  4 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2009-09-17 19:55 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker,
	Christian Borntraeger, Robert Richter

[-- Attachment #1: 0003-oprofile-fix-oprofile-regression-select-RING_BUFFER_.patch --]
[-- Type: text/plain, Size: 1048 bytes --]

From: Christian Borntraeger <borntraeger@de.ibm.com>

commit 85bac32c4a52c592b857f2c360cc5ec93a097d70
    ring-buffer: only enable ring_buffer_swap_cpu when needed
broke oprofile (at least on s390, but likely on all platforms).

this patch lets oprofile select RING_BUFER_ALLOW_SWAP to make
ring_buffer_swap_cpu usable for oprofile.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
LKML-Reference: <200909162156.49239.borntraeger@de.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Robert Richter <robert.richter@amd.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 arch/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/Kconfig b/arch/Kconfig
index beea3cc..7f418bb 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -9,6 +9,7 @@ config OPROFILE
 	depends on TRACING_SUPPORT
 	select TRACING
 	select RING_BUFFER
+	select RING_BUFFER_ALLOW_SWAP
 	help
 	  OProfile is a profiling system capable of profiling the
 	  whole system, include the kernel, kernel modules, libraries,
-- 
1.6.3.3



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/5] [PATCH 4/5] softirq: add BLOCK_IOPOLL to softirq_to_name
  2009-09-17 19:55 [PATCH 0/5] [GIT PULL] tracing: more updates for v2.6.32 Steven Rostedt
                   ` (2 preceding siblings ...)
  2009-09-17 19:55 ` [PATCH 3/5] [PATCH 3/5] oprofile: fix oprofile regression: select RING_BUFFER_ALLOW_SWAP Steven Rostedt
@ 2009-09-17 19:55 ` Steven Rostedt
  2009-09-17 19:55 ` [PATCH 5/5] [PATCH 5/5] vsnprintf: remove duplicate comment of vsnprintf Steven Rostedt
  4 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2009-09-17 19:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker, Li Zefan

[-- Attachment #1: 0004-softirq-add-BLOCK_IOPOLL-to-softirq_to_name.patch --]
[-- Type: text/plain, Size: 1852 bytes --]

From: Li Zefan <lizf@cn.fujitsu.com>

With BLOCK_IOPOLL_SOFTIRQ added, softirq_to_name[] and
show_softirq_name() needs to be updated.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <4AB20398.8070209@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 include/trace/events/irq.h |   21 +++++++++++----------
 kernel/softirq.c           |    2 +-
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h
index 1cb0c3a..b89f9db 100644
--- a/include/trace/events/irq.h
+++ b/include/trace/events/irq.h
@@ -8,16 +8,17 @@
 #include <linux/interrupt.h>
 
 #define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq }
-#define show_softirq_name(val)			\
-	__print_symbolic(val,			\
-			 softirq_name(HI),	\
-			 softirq_name(TIMER),	\
-			 softirq_name(NET_TX),	\
-			 softirq_name(NET_RX),	\
-			 softirq_name(BLOCK),	\
-			 softirq_name(TASKLET),	\
-			 softirq_name(SCHED),	\
-			 softirq_name(HRTIMER),	\
+#define show_softirq_name(val)				\
+	__print_symbolic(val,				\
+			 softirq_name(HI),		\
+			 softirq_name(TIMER),		\
+			 softirq_name(NET_TX),		\
+			 softirq_name(NET_RX),		\
+			 softirq_name(BLOCK),		\
+			 softirq_name(BLOCK_IOPOLL),	\
+			 softirq_name(TASKLET),		\
+			 softirq_name(SCHED),		\
+			 softirq_name(HRTIMER),		\
 			 softirq_name(RCU))
 
 /**
diff --git a/kernel/softirq.c b/kernel/softirq.c
index 7db2506..f8749e5 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -57,7 +57,7 @@ static struct softirq_action softirq_vec[NR_SOFTIRQS] __cacheline_aligned_in_smp
 static DEFINE_PER_CPU(struct task_struct *, ksoftirqd);
 
 char *softirq_to_name[NR_SOFTIRQS] = {
-	"HI", "TIMER", "NET_TX", "NET_RX", "BLOCK",
+	"HI", "TIMER", "NET_TX", "NET_RX", "BLOCK", "BLOCK_IOPOLL",
 	"TASKLET", "SCHED", "HRTIMER",	"RCU"
 };
 
-- 
1.6.3.3



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 5/5] [PATCH 5/5] vsnprintf: remove duplicate comment of vsnprintf
  2009-09-17 19:55 [PATCH 0/5] [GIT PULL] tracing: more updates for v2.6.32 Steven Rostedt
                   ` (3 preceding siblings ...)
  2009-09-17 19:55 ` [PATCH 4/5] [PATCH 4/5] softirq: add BLOCK_IOPOLL to softirq_to_name Steven Rostedt
@ 2009-09-17 19:55 ` Steven Rostedt
  4 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2009-09-17 19:55 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker, Zhaolei,
	Linus Torvalds

[-- Attachment #1: 0005-vsnprintf-remove-duplicate-comment-of-vsnprintf.patch --]
[-- Type: text/plain, Size: 2118 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

Remove the duplicate comment of bstr_printf that is the same as the
vsnprintf.

Add the 's' option to the comment for the pointer function. This is
more of an internal function so the little duplication of the comment
here is OK.

Reported-by: Zhaolei <zhaolei@cn.fujitsu.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 lib/vsprintf.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index c8f3ed6..d320c18 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -794,7 +794,8 @@ static char *ip4_addr_string(char *buf, char *end, const u8 *addr,
  *
  * - 'F' For symbolic function descriptor pointers with offset
  * - 'f' For simple symbolic function names without offset
- * - 'S' For symbolic direct pointers
+ * - 'S' For symbolic direct pointers with offset
+ * - 's' For symbolic direct pointers without offset
  * - 'R' For a struct resource pointer, it prints the range of
  *       addresses (not the name nor the flags)
  * - 'M' For a 6-byte MAC address, it prints the address in the
@@ -1069,6 +1070,7 @@ qualifier:
  * %pF output the name of a function pointer with its offset
  * %pf output the name of a function pointer without its offset
  * %pR output the address range in a struct resource
+ * %n is ignored
  *
  * The return value is the number of characters which would
  * be generated for the given input, excluding the trailing
@@ -1524,11 +1526,7 @@ EXPORT_SYMBOL_GPL(vbin_printf);
  * a binary buffer that generated by vbin_printf.
  *
  * The format follows C99 vsnprintf, but has some extensions:
- * %pS output the name of a text symbol
- * %pF output the name of a function pointer with its offset
- * %pf output the name of a function pointer without its offset
- * %pR output the address range in a struct resource
- * %n is ignored
+ *  see vsnprintf comment for details.
  *
  * The return value is the number of characters which would
  * be generated for the given input, excluding the trailing
-- 
1.6.3.3



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-09-17 19:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-17 19:55 [PATCH 0/5] [GIT PULL] tracing: more updates for v2.6.32 Steven Rostedt
2009-09-17 19:55 ` [PATCH 1/5] [PATCH 1/5] vsprintf: add %ps that is the same as %pS but is like %pf Steven Rostedt
2009-09-17 19:55 ` [PATCH 2/5] [PATCH 2/5] tracing: switch function prints from %pf to %ps Steven Rostedt
2009-09-17 19:55 ` [PATCH 3/5] [PATCH 3/5] oprofile: fix oprofile regression: select RING_BUFFER_ALLOW_SWAP Steven Rostedt
2009-09-17 19:55 ` [PATCH 4/5] [PATCH 4/5] softirq: add BLOCK_IOPOLL to softirq_to_name Steven Rostedt
2009-09-17 19:55 ` [PATCH 5/5] [PATCH 5/5] vsnprintf: remove duplicate comment of vsnprintf Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox