public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: [PATCH 5/5] tracing: add annotation to what type of stack trace is recorded
Date: Wed, 03 Jun 2009 11:17:29 -0400	[thread overview]
Message-ID: <20090603151821.497707476@goodmis.org> (raw)
In-Reply-To: 20090603151724.144915858@goodmis.org

[-- Attachment #1: 0005-tracing-add-annotation-to-what-type-of-stack-trace-i.patch --]
[-- Type: text/plain, Size: 1752 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

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 |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index 8afeea4..425725c 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -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))
-- 
1.6.3.1

-- 

  parent reply	other threads:[~2009-06-03 15:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-03 15:17 [PATCH 0/5] [GIP PULL] tracing/events/trace_stack: various fixes Steven Rostedt
2009-06-03 15:17 ` [PATCH 1/5] tracing/trace_stack: fix the number of entries in the header Steven Rostedt
2009-06-03 15:17 ` [PATCH 2/5] tracing/events: fix output format of kernel stack Steven Rostedt
2009-06-03 15:17 ` [PATCH 3/5] tracing/events: fix output format of user stack Steven Rostedt
2009-06-03 15:17 ` [PATCH 4/5] tracing: fix multiple use of __print_flags and __print_symbolic Steven Rostedt
2009-06-03 15:17 ` Steven Rostedt [this message]
2009-06-05 14:52 ` [PATCH 0/5] [GIP PULL] tracing/events/trace_stack: various fixes Ingo Molnar
2009-06-07  8:22   ` Ingo Molnar
2009-06-08 15:37     ` Steven Rostedt
2009-06-08 16:18       ` Peter Zijlstra
2009-06-08 16:22         ` Steven Rostedt
2009-06-08 23:00         ` [PATCH][GIT PULL] ring-buffer: pass in lockdep class key for reader_lock Steven Rostedt
2009-06-09 11:20           ` Ingo Molnar
2009-06-09 11:44             ` Steven Rostedt
2009-06-09 12:03               ` Ingo Molnar
2009-06-09 14:52         ` [tip:tracing/core] " tip-bot for Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090603151821.497707476@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox