Skip to contentSkip to conversation

trace: fix missing assignment in trace_ctxwake_*

PATCH In review Hiroshi Shimamoto 2 participants 4 messages Oct 1, 2009 – Oct 6, 2009 Tracing

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trace: fix missing assignment in trace_ctxwake_*

From: Hiroshi Shimamoto <[email protected]>

The state char variable S should be reassigned, if S == 0.

---
 kernel/trace/trace_output.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/trace/trace_output.c +2 -2
index f572f44..cda766f 100644
@@ -883,7 +883,7 @@ static int trace_ctxwake_raw(struct trace_iterator *iter, char S)
 	trace_assign_type(field, iter->ent);
 
 	if (!S)
-		task_state_char(field->prev_state);
+		S = task_state_char(field->prev_state);
 	T = task_state_char(field->next_state);
 	if (!trace_seq_printf(&iter->seq, "%d %d %c %d %d %d %c\n",
 			      field->prev_pid,
@@ -918,7 +918,7 @@ static int trace_ctxwake_hex(struct trace_iterator *iter, char S)
 	trace_assign_type(field, iter->ent);
 
 	if (!S)
-		task_state_char(field->prev_state);
+		S = task_state_char(field->prev_state);
 	T = task_state_char(field->next_state);
 
 	SEQ_PUT_HEX_FIELD_RET(s, field->prev_pid);
Signature · 1 line
1.6.3.3
Acked-by on v1 1/1
#1 lore raw

2009/10/1 Hiroshi Shimamoto <[email protected]>:

Quoted 5 lines

From: Hiroshi Shimamoto <[email protected]>

The state char variable S should be reassigned, if S == 0.

Good catch, we are indeed missing the state of the task that is going to sleep for the context switch events (in the raw mode).

Fortunately the problem arises with the sched_switch/wake_up tracers, not the sched trace events.
The formers are legacy now. But still, that was buggy.

Thanks.

#2 lore raw

[tip:tracing/urgent] trace: Fix missing assignment in trace_ctxwake_*

In reply to Hiroshi Shimamoto
Commit-ID:  a2067f64cb59dfb19940a1a38a5a9fa6f2ddcaa5
Gitweb:     http://git.kernel.org/tip/a2067f64cb59dfb19940a1a38a5a9fa6f2ddcaa5
Author:     Hiroshi Shimamoto <[email protected]>
AuthorDate: Thu, 1 Oct 2009 13:33:28 +0900
Committer:  Ingo Molnar <[email protected]>
CommitDate: Fri, 2 Oct 2009 15:24:55 +0200

trace: Fix missing assignment in trace_ctxwake_*

The state char variable S should be reassigned, if S == 0.

We are missing the state of the task that is going to sleep for the context switch events (in the raw mode).

Fortunately the problem arises with the sched_switch/wake_up tracers, not the sched trace events.

The formers are legacy now. But still, that was buggy.

LKML-Reference: <[email protected]>

---
 kernel/trace/trace_output.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/trace/trace_output.c +2 -2
index f572f44..cda766f 100644
@@ -883,7 +883,7 @@ static int trace_ctxwake_raw(struct trace_iterator *iter, char S)
 	trace_assign_type(field, iter->ent);
 
 	if (!S)
-		task_state_char(field->prev_state);
+		S = task_state_char(field->prev_state);
 	T = task_state_char(field->next_state);
 	if (!trace_seq_printf(&iter->seq, "%d %d %c %d %d %d %c\n",
 			      field->prev_pid,
@@ -918,7 +918,7 @@ static int trace_ctxwake_hex(struct trace_iterator *iter, char S)
 	trace_assign_type(field, iter->ent);
 
 	if (!S)
-		task_state_char(field->prev_state);
+		S = task_state_char(field->prev_state);
 	T = task_state_char(field->next_state);
 
 	SEQ_PUT_HEX_FIELD_RET(s, field->prev_pid);
#3 lore raw

[tip:tracing/urgent] trace: Fix missing assignment in trace_ctxwake_*

In reply to Hiroshi Shimamoto
Commit-ID:  b0f56f1a63b7b968e6feeeefeace24bc8e0a4a65
Gitweb:     http://git.kernel.org/tip/b0f56f1a63b7b968e6feeeefeace24bc8e0a4a65
Author:     Hiroshi Shimamoto <[email protected]>
AuthorDate: Thu, 1 Oct 2009 13:33:28 +0900
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 6 Oct 2009 14:28:24 +0200

trace: Fix missing assignment in trace_ctxwake_*

The state char variable S should be reassigned, if S == 0.

We are missing the state of the task that is going to sleep for the context switch events (in the raw mode).

Fortunately the problem arises with the sched_switch/wake_up tracers, not the sched trace events.

The formers are legacy now. But still, that was buggy.

LKML-Reference: <[email protected]>

---
 kernel/trace/trace_output.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/trace/trace_output.c +2 -2
index f572f44..cda766f 100644
@@ -883,7 +883,7 @@ static int trace_ctxwake_raw(struct trace_iterator *iter, char S)
 	trace_assign_type(field, iter->ent);
 
 	if (!S)
-		task_state_char(field->prev_state);
+		S = task_state_char(field->prev_state);
 	T = task_state_char(field->next_state);
 	if (!trace_seq_printf(&iter->seq, "%d %d %c %d %d %d %c\n",
 			      field->prev_pid,
@@ -918,7 +918,7 @@ static int trace_ctxwake_hex(struct trace_iterator *iter, char S)
 	trace_assign_type(field, iter->ent);
 
 	if (!S)
-		task_state_char(field->prev_state);
+		S = task_state_char(field->prev_state);
 	T = task_state_char(field->next_state);
 
 	SEQ_PUT_HEX_FIELD_RET(s, field->prev_pid);