Merge branch 'x86/core' into tracing/ftrace
Ingo Molnar [Tue, 10 Mar 2009 09:16:17 +0000 (10:16 +0100)]
Semantic merge:

  kernel/trace/trace_functions_graph.c

Signed-off-by: Ingo Molnar <mingo@elte.hu>

1  2 
arch/x86/kernel/cpu/intel.c
arch/x86/mm/init_32.c
arch/x86/mm/init_64.c
kernel/module.c
kernel/trace/trace_functions_graph.c

Simple merge
Simple merge
Simple merge
diff --cc kernel/module.c
Simple merge
@@@ -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,