diff options
author | Steven Rostedt <srostedt@redhat.com> | 2010-01-08 12:30:14 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-01-08 12:30:14 -0500 |
commit | c2b163e35a469c0c48aeb445ffc52bafacb6ea12 (patch) | |
tree | df40e00a8728e6b9afcbc7b8a6f1e7f74a009bcd | |
parent | 01ccb483a82d876ce655b3a79f12489deb7d21c4 (diff) |
trace-graph: Show actual task color at start of graph
If the first event in the graph is a sched_switch, then the color
for the block was showing the new task. Not the previous task.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | trace-graph.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/trace-graph.c b/trace-graph.c index e5b22a8..458f5bf 100644 --- a/trace-graph.c +++ b/trace-graph.c | |||
@@ -1454,8 +1454,12 @@ static void draw_cpu(struct graph_info *ginfo, gint cpu, | |||
1454 | if (last_pid != pid) { | 1454 | if (last_pid != pid) { |
1455 | 1455 | ||
1456 | if (last_pid < 0) { | 1456 | if (last_pid < 0) { |
1457 | last_pid = pid; | 1457 | /* if we hit a sched switch, use the original pid */ |
1458 | set_color_by_pid(ginfo->draw, gc, pid); | 1458 | if (is_sched_switch) |
1459 | last_pid = pevent_data_pid(ginfo->pevent, record); | ||
1460 | else | ||
1461 | last_pid = pid; | ||
1462 | set_color_by_pid(ginfo->draw, gc, last_pid); | ||
1459 | } | 1463 | } |
1460 | 1464 | ||
1461 | filter = graph_filter_on_task(ginfo, last_pid); | 1465 | filter = graph_filter_on_task(ginfo, last_pid); |