tracing: more updates for v2.6.32
Subsystems (4)
Steven Rostedt
maintainerPATCH 1/5 vsprintf: add %ps that is the same as %pS but is like %pf
In reply to Steven RostedtFrom: Steven Rostedt <[email protected]>
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.
--- lib/vsprintf.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
lib/vsprintf.c +4 -2
@@ -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
Signature · 1 line
1.6.3.3
Steven Rostedt
maintainerIngo,
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(-)
Steven Rostedt
maintainerPATCH 3/5 oprofile: fix oprofile regression: select RING_BUFFER_ALLOW_SWAP
From: Christian Borntraeger <[email protected]>
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.
LKML-Reference: <[email protected]>
--- arch/Kconfig | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/Kconfig +1 -0
@@ -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,
Signature · 1 line
1.6.3.3
Steven Rostedt
maintainerPATCH 4/5 softirq: add BLOCK_IOPOLL to softirq_to_name
In reply to Steven RostedtFrom: Li Zefan <[email protected]>
With BLOCK_IOPOLL_SOFTIRQ added, softirq_to_name[] and show_softirq_name() needs to be updated.
LKML-Reference: <[email protected]>
--- include/trace/events/irq.h | 21 +++++++++++---------- kernel/softirq.c | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-)
include/trace/events/irq.h +11 -10
@@ -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))/**
kernel/softirq.c +1 -1
@@ -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" };
Signature · 1 line
1.6.3.3
Steven Rostedt
maintainerPATCH 2/5 tracing: switch function prints from %pf to %ps
In reply to Steven RostedtFrom: Steven Rostedt <[email protected]>
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.
--- 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(-)
kernel/trace/ftrace.c +3 -3
@@ -1405,7 +1405,7 @@ static int t_hash_show(struct seq_file *m, void *v)if (rec->ops->print)return rec->ops->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 ; }
kernel/trace/trace_functions.c +1 -1
@@ -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" );
kernel/trace/trace_functions_graph.c +3 -3
@@ -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 ;
Signature · 1 line
1.6.3.3
Steven Rostedt
maintainerPATCH 5/5 vsnprintf: remove duplicate comment of vsnprintf
In reply to Steven RostedtFrom: Steven Rostedt <[email protected]>
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.
--- lib/vsprintf.c | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-)
lib/vsprintf.c +4 -6
@@ -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
Signature · 1 line
1.6.3.3