From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Jiri Olsa <jolsa@redhat.com>
Subject: [PATCH 11/16 v2] tracing, function_graph: Add context-info support for function_graph
Date: Wed, 15 Jun 2011 09:48:52 -0400 [thread overview]
Message-ID: <20110615135235.480971241@goodmis.org> (raw)
In-Reply-To: 20110615134841.767565350@goodmis.org
[-- Attachment #1: 0011-tracing-function_graph-Add-context-info-support-for-.patch tracer --]
[-- Type: text/plain, Size: 3736 bytes --]
From: Jiri Olsa <jolsa@redhat.com>
The function_graph tracer does not follow global context-info option.
Adding TRACE_ITER_CONTEXT_INFO trace_flags check to enable it.
With following commands:
# echo function_graph > ./current_tracer
# echo 0 > options/context-info
# cat trace
This is what it looked like before:
# tracer: function_graph
#
# TIME CPU DURATION FUNCTION CALLS
# | | | | | | | |
1) 0.079 us | } /* __vma_link_rb */
1) 0.056 us | copy_page_range();
1) | security_vm_enough_memory() {
...
This is what it looks like now:
# tracer: function_graph
#
} /* update_ts_time_stats */
timekeeping_max_deferment();
...
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1307113131-10045-6-git-send-email-jolsa@redhat.com
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/trace/trace_functions_graph.c | 53 ++++++++++++++++++++--------------
1 files changed, 31 insertions(+), 22 deletions(-)
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 1da5b97..e8d6bb5 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -613,28 +613,30 @@ print_graph_irq(struct trace_iterator *iter, unsigned long addr,
addr >= (unsigned long)__irqentry_text_end)
return TRACE_TYPE_UNHANDLED;
- /* Absolute time */
- if (flags & TRACE_GRAPH_PRINT_ABS_TIME) {
- ret = print_graph_abs_time(iter->ts, s);
- if (!ret)
- return TRACE_TYPE_PARTIAL_LINE;
- }
+ if (trace_flags & TRACE_ITER_CONTEXT_INFO) {
+ /* Absolute time */
+ if (flags & TRACE_GRAPH_PRINT_ABS_TIME) {
+ ret = print_graph_abs_time(iter->ts, s);
+ if (!ret)
+ return TRACE_TYPE_PARTIAL_LINE;
+ }
- /* Cpu */
- if (flags & TRACE_GRAPH_PRINT_CPU) {
- ret = print_graph_cpu(s, cpu);
- if (ret == TRACE_TYPE_PARTIAL_LINE)
- return TRACE_TYPE_PARTIAL_LINE;
- }
+ /* Cpu */
+ if (flags & TRACE_GRAPH_PRINT_CPU) {
+ ret = print_graph_cpu(s, cpu);
+ if (ret == TRACE_TYPE_PARTIAL_LINE)
+ return TRACE_TYPE_PARTIAL_LINE;
+ }
- /* Proc */
- if (flags & TRACE_GRAPH_PRINT_PROC) {
- ret = print_graph_proc(s, pid);
- if (ret == TRACE_TYPE_PARTIAL_LINE)
- return TRACE_TYPE_PARTIAL_LINE;
- ret = trace_seq_printf(s, " | ");
- if (!ret)
- return TRACE_TYPE_PARTIAL_LINE;
+ /* Proc */
+ if (flags & TRACE_GRAPH_PRINT_PROC) {
+ ret = print_graph_proc(s, pid);
+ if (ret == TRACE_TYPE_PARTIAL_LINE)
+ return TRACE_TYPE_PARTIAL_LINE;
+ ret = trace_seq_printf(s, " | ");
+ if (!ret)
+ return TRACE_TYPE_PARTIAL_LINE;
+ }
}
/* No overhead */
@@ -710,8 +712,9 @@ print_graph_duration(unsigned long long duration, struct trace_seq *s,
{
int ret = -1;
- if (!(flags & TRACE_GRAPH_PRINT_DURATION))
- return TRACE_TYPE_HANDLED;
+ if (!(flags & TRACE_GRAPH_PRINT_DURATION) ||
+ !(trace_flags & TRACE_ITER_CONTEXT_INFO))
+ return TRACE_TYPE_HANDLED;
/* No real adata, just filling the column with spaces */
switch (duration) {
@@ -879,6 +882,9 @@ print_graph_prologue(struct trace_iterator *iter, struct trace_seq *s,
return TRACE_TYPE_PARTIAL_LINE;
}
+ if (!(trace_flags & TRACE_ITER_CONTEXT_INFO))
+ return 0;
+
/* Absolute time */
if (flags & TRACE_GRAPH_PRINT_ABS_TIME) {
ret = print_graph_abs_time(iter->ts, s);
@@ -1346,6 +1352,9 @@ void print_graph_headers_flags(struct seq_file *s, u32 flags)
{
struct trace_iterator *iter = s->private;
+ if (!(trace_flags & TRACE_ITER_CONTEXT_INFO))
+ return;
+
if (trace_flags & TRACE_ITER_LATENCY_FMT) {
/* print nothing if the buffers are empty */
if (trace_empty(iter))
--
1.7.4.4
next prev parent reply other threads:[~2011-06-15 13:52 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-15 13:48 [PATCH 00/16 v2] [GIT PULL] tracing: various fixes Steven Rostedt
2011-06-15 13:48 ` [PATCH 01/16 v2] tracing: Schedule a delayed work to call wakeup() Steven Rostedt
2011-06-15 13:48 ` [PATCH 02/16 v2] tracing: Use NUMA allocation for per-cpu ring buffer pages Steven Rostedt
2011-06-15 13:48 ` [PATCH 03/16 v2] tracing: Add a proc file to stop tracing and free buffer Steven Rostedt
2011-06-15 14:25 ` Frederic Weisbecker
2011-06-15 14:43 ` Steven Rostedt
2011-06-15 14:45 ` Frederic Weisbecker
2011-06-15 13:48 ` [PATCH 04/16 v2] tracing: Add disable_on_free option Steven Rostedt
2011-06-15 13:48 ` [PATCH 05/16 v2] ftrace: Fixed an include coding style issue Steven Rostedt
2011-06-15 13:48 ` [PATCH 06/16 v2] async: " Steven Rostedt
2011-06-15 13:48 ` [PATCH 07/16 v2] tracing, function_graph: Remove dependency of abstime and duration Steven Rostedt
2011-06-15 13:48 ` [PATCH 08/16 v2] tracing, function_graph: Merge overhead and duration display Steven Rostedt
2011-06-15 13:48 ` [PATCH 09/16 v2] tracing, function: Fix trace header to follow context-info option Steven Rostedt
2011-06-15 13:48 ` [PATCH 10/16 v2] tracing, function_graph: Remove lock-depth from latency trace Steven Rostedt
2011-06-15 13:48 ` Steven Rostedt [this message]
2011-06-15 13:48 ` [PATCH 12/16 v2] tracing: Convert to kstrtoul_from_user Steven Rostedt
2011-06-15 13:48 ` [PATCH 13/16 v2] ring-buffer: Set __GFP_NORETRY flag for ring buffer allocating Steven Rostedt
2011-06-15 13:48 ` [PATCH 14/16 v2] x86: Swap save_stack_trace_regs parameters Steven Rostedt
2011-06-15 13:48 ` [PATCH 15/16 v2] stack_trace: Add weak save_stack_trace_regs() Steven Rostedt
2011-06-15 13:48 ` [PATCH 16/16 v2] tracing/kprobes: Fix kprobe-tracer to support stack trace Steven Rostedt
2011-06-16 14:00 ` [PATCH 00/16 v2] [GIT PULL] tracing: various fixes Ingo Molnar
2011-06-28 19:48 ` Steven Rostedt
2011-07-01 12:44 ` Ingo Molnar
2011-07-01 13:11 ` Steven Rostedt
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=20110615135235.480971241@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--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