Commit a3d03eca authored by Zhaolei's avatar Zhaolei Committed by Ingo Molnar

tracing: Fix power tracer header

Before patch:
  # tracer: power
  #
  #           TASK-PID    CPU#    TIMESTAMP  FUNCTION
  #              | |       |          |         |
  [  676.875865889] CSTATE: Going to C1 on cpu 0 for 0.005911463
  [  676.882938805] CSTATE: Going to C1 on cpu 0 for 0.104796532
  ...

After patch:
  # tracer: power
  #
  #   TIMESTAMP      STATE  EVENT
  #       |            |      |
  [  676.875865889] CSTATE: Going to C1 on cpu 0 for 0.005911463
  [  676.882938805] CSTATE: Going to C1 on cpu 0 for 0.104796532
  ...

v2: Use seq_puts instead of seq_printf
Signed-off-by: default avatarZhao Lei <zhaolei@cn.fujitsu.com>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <49E2E889.5000903@cn.fujitsu.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 80a04d3f
...@@ -186,6 +186,12 @@ static enum print_line_t power_print_line(struct trace_iterator *iter) ...@@ -186,6 +186,12 @@ static enum print_line_t power_print_line(struct trace_iterator *iter)
return TRACE_TYPE_UNHANDLED; return TRACE_TYPE_UNHANDLED;
} }
static void power_print_header(struct seq_file *s)
{
seq_puts(s, "# TIMESTAMP STATE EVENT\n");
seq_puts(s, "# | | |\n");
}
static struct tracer power_tracer __read_mostly = static struct tracer power_tracer __read_mostly =
{ {
.name = "power", .name = "power",
...@@ -194,6 +200,7 @@ static struct tracer power_tracer __read_mostly = ...@@ -194,6 +200,7 @@ static struct tracer power_tracer __read_mostly =
.stop = stop_power_trace, .stop = stop_power_trace,
.reset = power_trace_reset, .reset = power_trace_reset,
.print_line = power_print_line, .print_line = power_print_line,
.print_header = power_print_header,
}; };
static int init_power_trace(void) static int init_power_trace(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment