From: Ingo Molnar Date: Tue, 10 Mar 2009 09:16:17 +0000 (+0100) Subject: Merge branch 'x86/core' into tracing/ftrace X-Git-Tag: v2.6.30-rc1~2^2~50 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8293dd6f86e759068ce918aa10ca9c5d6d711cd0;p=platform%2Fupstream%2Fkernel-adaptation-pc.git Merge branch 'x86/core' into tracing/ftrace Semantic merge: kernel/trace/trace_functions_graph.c Signed-off-by: Ingo Molnar --- 8293dd6f86e759068ce918aa10ca9c5d6d711cd0 diff --cc kernel/trace/trace_functions_graph.c index 453ebd3,930c08e..35257be --- a/kernel/trace/trace_functions_graph.c +++ b/kernel/trace/trace_functions_graph.c @@@ -807,44 -642,18 +807,44 @@@ static void print_graph_headers(struct /* 2nd line */ seq_printf(s, "# "); + if (tracer_flags.val & TRACE_GRAPH_PRINT_ABS_TIME) + seq_printf(s, " | "); if (tracer_flags.val & TRACE_GRAPH_PRINT_CPU) - seq_printf(s, "| "); + seq_printf(s, "| "); if (tracer_flags.val & TRACE_GRAPH_PRINT_PROC) - seq_printf(s, "| | "); - if (tracer_flags.val & TRACE_GRAPH_PRINT_OVERHEAD) { - seq_printf(s, "| "); - seq_printf(s, "| | | | |\n"); - } else - seq_printf(s, " | | | | |\n"); + seq_printf(s, " | | "); + if (tracer_flags.val & TRACE_GRAPH_PRINT_DURATION) + seq_printf(s, " | | "); + seq_printf(s, " | | | |\n"); } + +static void graph_trace_open(struct trace_iterator *iter) +{ + /* pid on the last trace processed */ + pid_t *last_pid = alloc_percpu(pid_t); + int cpu; + + if (!last_pid) + pr_warning("function graph tracer: not enough memory\n"); + else + for_each_possible_cpu(cpu) { + pid_t *pid = per_cpu_ptr(last_pid, cpu); + *pid = -1; + } + + iter->private = last_pid; +} + +static void graph_trace_close(struct trace_iterator *iter) +{ - percpu_free(iter->private); ++ free_percpu(iter->private); +} + static struct tracer graph_trace __read_mostly = { .name = "function_graph", + .open = graph_trace_open, + .close = graph_trace_close, + .wait_pipe = poll_wait_pipe, .init = graph_trace_init, .reset = graph_trace_reset, .print_line = print_graph_function,