* [PATCH 0/3] [GIT PULL] tracing: small fixes for v2.6.32
@ 2009-09-17 4:27 Steven Rostedt
2009-09-17 4:27 ` [PATCH 1/3] [PATCH 1/3] vsprintf: add %ps that is the same as %pS but is like %pf Steven Rostedt
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Steven Rostedt @ 2009-09-17 4:27 UTC (permalink / raw)
To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker
Ingo,
Please pull the latest tip/tracing/core5 tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
tip/tracing/core5
Christian Borntraeger (1):
oprofile: fix oprofile regression: select RING_BUFFER_ALLOW_SWAP
Steven Rostedt (2):
vsprintf: add %ps that is the same as %pS but is like %pf
tracing: switch function prints from %pf to %ps
----
arch/Kconfig | 1 +
kernel/trace/ftrace.c | 6 +++---
kernel/trace/trace_functions.c | 2 +-
kernel/trace/trace_functions_graph.c | 6 +++---
lib/vsprintf.c | 6 ++++--
5 files changed, 12 insertions(+), 9 deletions(-)
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/3] [PATCH 1/3] vsprintf: add %ps that is the same as %pS but is like %pf
2009-09-17 4:27 [PATCH 0/3] [GIT PULL] tracing: small fixes for v2.6.32 Steven Rostedt
@ 2009-09-17 4:27 ` Steven Rostedt
2009-09-17 5:40 ` Benjamin Herrenschmidt
2009-09-17 6:07 ` Zhaolei
2009-09-17 4:27 ` [PATCH 2/3] [PATCH 2/3] tracing: switch function prints from %pf to %ps Steven Rostedt
2009-09-17 4:27 ` [PATCH 3/3] [PATCH 3/3] oprofile: fix oprofile regression: select RING_BUFFER_ALLOW_SWAP Steven Rostedt
2 siblings, 2 replies; 6+ messages in thread
From: Steven Rostedt @ 2009-09-17 4:27 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: 2214 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>
Cc: 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 756ccaf..c265e75 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -580,7 +580,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);
@@ -721,6 +721,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);
@@ -958,7 +959,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/3] [PATCH 2/3] tracing: switch function prints from %pf to %ps
2009-09-17 4:27 [PATCH 0/3] [GIT PULL] tracing: small fixes for v2.6.32 Steven Rostedt
2009-09-17 4:27 ` [PATCH 1/3] [PATCH 1/3] vsprintf: add %ps that is the same as %pS but is like %pf Steven Rostedt
@ 2009-09-17 4:27 ` Steven Rostedt
2009-09-17 4:27 ` [PATCH 3/3] [PATCH 3/3] oprofile: fix oprofile regression: select RING_BUFFER_ALLOW_SWAP Steven Rostedt
2 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2009-09-17 4:27 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/3] [PATCH 3/3] oprofile: fix oprofile regression: select RING_BUFFER_ALLOW_SWAP
2009-09-17 4:27 [PATCH 0/3] [GIT PULL] tracing: small fixes for v2.6.32 Steven Rostedt
2009-09-17 4:27 ` [PATCH 1/3] [PATCH 1/3] vsprintf: add %ps that is the same as %pS but is like %pf Steven Rostedt
2009-09-17 4:27 ` [PATCH 2/3] [PATCH 2/3] tracing: switch function prints from %pf to %ps Steven Rostedt
@ 2009-09-17 4:27 ` Steven Rostedt
2 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2009-09-17 4:27 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 99193b1..4dd737a 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
* Re: [PATCH 1/3] [PATCH 1/3] vsprintf: add %ps that is the same as %pS but is like %pf
2009-09-17 4:27 ` [PATCH 1/3] [PATCH 1/3] vsprintf: add %ps that is the same as %pS but is like %pf Steven Rostedt
@ 2009-09-17 5:40 ` Benjamin Herrenschmidt
2009-09-17 6:07 ` Zhaolei
1 sibling, 0 replies; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2009-09-17 5:40 UTC (permalink / raw)
To: Steven Rostedt
Cc: linux-kernel, Ingo Molnar, Andrew Morton, Frederic Weisbecker,
Linus Torvalds, Zhao Lei
On Thu, 2009-09-17 at 00:27 -0400, Steven Rostedt wrote:
> plain text document attachment
> (0001-vsprintf-add-ps-that-is-the-same-as-pS-but-is-like-p.patch)
> 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 756ccaf..c265e75 100644
> --- a/lib/vsprintf.c
> +++ b/lib/vsprintf.c
> @@ -580,7 +580,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);
> @@ -721,6 +721,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);
> @@ -958,7 +959,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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] [PATCH 1/3] vsprintf: add %ps that is the same as %pS but is like %pf
2009-09-17 4:27 ` [PATCH 1/3] [PATCH 1/3] vsprintf: add %ps that is the same as %pS but is like %pf Steven Rostedt
2009-09-17 5:40 ` Benjamin Herrenschmidt
@ 2009-09-17 6:07 ` Zhaolei
1 sibling, 0 replies; 6+ messages in thread
From: Zhaolei @ 2009-09-17 6:07 UTC (permalink / raw)
To: Steven Rostedt
Cc: linux-kernel, Ingo Molnar, Andrew Morton, Frederic Weisbecker,
Linus Torvalds, Benjamin Herrenschmidt
Steven Rostedt wrote:
> 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>
> Cc: 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 756ccaf..c265e75 100644
> --- a/lib/vsprintf.c
> +++ b/lib/vsprintf.c
> @@ -580,7 +580,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);
> @@ -721,6 +721,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);
> @@ -958,7 +959,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
Comments of bstr_printf() also need to be updated.
or remove duplation and just say "refer to vsnprintf()" in bstr_printf()'s
comment.
Thanks
Zhaolei
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-09-17 6:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-17 4:27 [PATCH 0/3] [GIT PULL] tracing: small fixes for v2.6.32 Steven Rostedt
2009-09-17 4:27 ` [PATCH 1/3] [PATCH 1/3] vsprintf: add %ps that is the same as %pS but is like %pf Steven Rostedt
2009-09-17 5:40 ` Benjamin Herrenschmidt
2009-09-17 6:07 ` Zhaolei
2009-09-17 4:27 ` [PATCH 2/3] [PATCH 2/3] tracing: switch function prints from %pf to %ps Steven Rostedt
2009-09-17 4:27 ` [PATCH 3/3] [PATCH 3/3] oprofile: fix oprofile regression: select RING_BUFFER_ALLOW_SWAP Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox