Skip to content

Commit

Permalink
trace: Fix missing assignment in trace_ctxwake_*
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Cc: Steven Rostedt <srostedt@redhat.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <4AC43118.6050409@ct.jp.nec.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Hiroshi Shimamoto authored and Ingo Molnar committed Oct 6, 2009
1 parent 75fb409 commit b0f56f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/trace/trace_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b0f56f1

Please sign in to comment.