2009-04-13 07:01:17

by Zhao Lei

[permalink] [raw]
Subject: [PATCH] tracing: Make power trace display correct 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
...

Signed-off-by: Zhao Lei <[email protected]>
---
kernel/trace/trace_power.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/kernel/trace/trace_power.c b/kernel/trace/trace_power.c
index 810a5b7..a74acdf 100644
--- a/kernel/trace/trace_power.c
+++ b/kernel/trace/trace_power.c
@@ -190,6 +190,12 @@ static enum print_line_t power_print_line(struct trace_iterator *iter)
return TRACE_TYPE_UNHANDLED;
}

+static void power_print_header(struct seq_file *s)
+{
+ seq_printf(s, "# TIMESTAMP STATE EVENT\n");
+ seq_printf(s, "# | | |\n");
+}
+
static struct tracer power_tracer __read_mostly =
{
.name = "power",
@@ -198,6 +204,7 @@ static struct tracer power_tracer __read_mostly =
.stop = stop_power_trace,
.reset = power_trace_reset,
.print_line = power_print_line,
+ .print_header = power_print_header,
};

static int init_power_trace(void)
--
1.5.5.3


2009-04-13 07:24:27

by Zhao Lei

[permalink] [raw]
Subject: [PATCH v2] tracing: Make power trace display correct header

ChangeLog:
v1: Make power trace display correct header
v2: Use seq_puts instead of seq_printf

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
...

Signed-off-by: Zhao Lei <[email protected]>
---
kernel/trace/trace_power.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/kernel/trace/trace_power.c b/kernel/trace/trace_power.c
index 810a5b7..8a30d98 100644
--- a/kernel/trace/trace_power.c
+++ b/kernel/trace/trace_power.c
@@ -190,6 +190,12 @@ static enum print_line_t power_print_line(struct trace_iterator *iter)
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 =
{
.name = "power",
@@ -198,6 +204,7 @@ static struct tracer power_tracer __read_mostly =
.stop = stop_power_trace,
.reset = power_trace_reset,
.print_line = power_print_line,
+ .print_header = power_print_header,
};

static int init_power_trace(void)
--
1.5.5.3


2009-04-13 21:47:34

by Zhao Lei

[permalink] [raw]
Subject: [tip:tracing/urgent] tracing: Fix power tracer header

Commit-ID: a3d03ecaf9fe722bf96e4ef4a2f5e42ef652ddeb
Gitweb: http://git.kernel.org/tip/a3d03ecaf9fe722bf96e4ef4a2f5e42ef652ddeb
Author: Zhaolei <[email protected]>
AuthorDate: Mon, 13 Apr 2009 15:23:53 +0800
Committer: Ingo Molnar <[email protected]>
CommitDate: Mon, 13 Apr 2009 23:39:57 +0200

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: Zhao Lei <[email protected]>
Cc: Arjan van de Ven <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Tom Zanussi <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>


---
kernel/trace/trace_power.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/kernel/trace/trace_power.c b/kernel/trace/trace_power.c
index bae791e..1184397 100644
--- a/kernel/trace/trace_power.c
+++ b/kernel/trace/trace_power.c
@@ -186,6 +186,12 @@ static enum print_line_t power_print_line(struct trace_iterator *iter)
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 =
{
.name = "power",
@@ -194,6 +200,7 @@ static struct tracer power_tracer __read_mostly =
.stop = stop_power_trace,
.reset = power_trace_reset,
.print_line = power_print_line,
+ .print_header = power_print_header,
};

static int init_power_trace(void)