]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
tracing: add annotation to what type of stack trace is recorded
authorSteven Rostedt <srostedt@redhat.com>
Wed, 3 Jun 2009 15:10:44 +0000 (11:10 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Wed, 3 Jun 2009 15:10:44 +0000 (11:10 -0400)
The current method of printing out a stack trace is to add a new line
and print out the trace:

    yum-updatesd-3120  [002]   573.691303:
 => do_softirq
 => irq_exit
 => smp_apic_timer_interrupt
 => apic_timer_interrupt

This looks a bit awkward, and if we have both stack and user stack traces
running, it would be nice to have a title to tell them apart, although
it is easy to tell by the output.

This patch adds an annotation to the start of the stack traces:

            init-1     [003]   929.304979: <stack trace>
 => user_path_at
 => vfs_fstatat
 => vfs_stat
 => sys_newstat
 => system_call_fastpath

             cat-3459  [002]  1016.824040: <user stack trace>
 =>  <0000003aae6c0250>
 =>  <00007ffff4b06ae4>
 =>  <69636172742f6775>

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace_output.c

index 8afeea412e77b2ad0ff9c1ac55f85f098114e8ca..425725c1622dbc971b6d9510ac1528047cd28ae3 100644 (file)
@@ -976,7 +976,7 @@ static enum print_line_t trace_stack_print(struct trace_iterator *iter,
 
        trace_assign_type(field, iter->ent);
 
-       if (!trace_seq_puts(s, "\n"))
+       if (!trace_seq_puts(s, "<stack trace>\n"))
                goto partial;
        for (i = 0; i < FTRACE_STACK_ENTRIES; i++) {
                if (!field->caller[i] || (field->caller[i] == ULONG_MAX))
@@ -1013,7 +1013,7 @@ static enum print_line_t trace_user_stack_print(struct trace_iterator *iter,
 
        trace_assign_type(field, iter->ent);
 
-       if (!trace_seq_putc(s, '\n'))
+       if (!trace_seq_puts(s, "<user stack trace>\n"))
                goto partial;
 
        if (!seq_print_userip_objs(field, s, flags))