aboutsummaryrefslogtreecommitdiffstats
path: root/trace-graph.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-01-08 13:29:32 -0500
committerSteven Rostedt <rostedt@goodmis.org>2010-01-08 13:29:32 -0500
commitf2b06ad754770cf8bf2a395c286c925d4a2c0f30 (patch)
treece2c0d758a1fdee0f532149b7c6373cbf352c023 /trace-graph.c
parentc841456417127e8cc40b088b90b65ac4a6a6769e (diff)
trace-graph: Fix the displaying of events
When an event is by itself, information is displayed about it. But it was displaying the wrong information. This patch adds a separate variable to keep track of what should be displayed and removes the confusion with trying to use other variables. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'trace-graph.c')
-rw-r--r--trace-graph.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/trace-graph.c b/trace-graph.c
index 8676d6a..af7600f 100644
--- a/trace-graph.c
+++ b/trace-graph.c
@@ -1413,6 +1413,8 @@ static void draw_cpu(struct graph_info *ginfo, gint cpu,
1413 gint wake_pid; 1413 gint wake_pid;
1414 gint last_wake_pid; 1414 gint last_wake_pid;
1415 gint event_id; 1415 gint event_id;
1416 gint display_pid = -1;
1417 gint next_display_pid = -1;
1416 gboolean filter; 1418 gboolean filter;
1417 gboolean is_sched_switch; 1419 gboolean is_sched_switch;
1418 gboolean is_wakeup; 1420 gboolean is_wakeup;
@@ -1506,8 +1508,6 @@ static void draw_cpu(struct graph_info *ginfo, gint cpu,
1506 if (filter && is_sched_switch) 1508 if (filter && is_sched_switch)
1507 filter = graph_filter_on_task(ginfo, last_pid); 1509 filter = graph_filter_on_task(ginfo, last_pid);
1508 1510
1509 last_pid = pid;
1510
1511 /* Lets see if a filtered task is waking up */ 1511 /* Lets see if a filtered task is waking up */
1512 is_wakeup = check_sched_wakeup(ginfo, record, &wake_pid); 1512 is_wakeup = check_sched_wakeup(ginfo, record, &wake_pid);
1513 if (filter && is_wakeup) 1513 if (filter && is_wakeup)
@@ -1520,6 +1520,8 @@ static void draw_cpu(struct graph_info *ginfo, gint cpu,
1520 x, CPU_TOP(cpu), x, CPU_BOTTOM(cpu)); 1520 x, CPU_TOP(cpu), x, CPU_BOTTOM(cpu));
1521 } 1521 }
1522 1522
1523 last_pid = pid;
1524
1523 if (!filter) { 1525 if (!filter) {
1524 /* Figure out if we can show the text for the previous record */ 1526 /* Figure out if we can show the text for the previous record */
1525 1527
@@ -1529,14 +1531,11 @@ static void draw_cpu(struct graph_info *ginfo, gint cpu,
1529 if (!p3) 1531 if (!p3)
1530 p3 = 1; 1532 p3 = 1;
1531 1533
1532 if (last_is_wakeup) 1534 display_pid = next_display_pid;
1533 pid = last_wake_pid;
1534 else
1535 pid = last_pid;
1536 1535
1537 /* first record, continue */ 1536 /* first record, continue */
1538 if (p2) 1537 if (p2)
1539 draw_event_label(ginfo, cpu, last_event_id, pid, 1538 draw_event_label(ginfo, cpu, last_event_id, display_pid,
1540 p1, p2, p3, width_16, font); 1539 p1, p2, p3, width_16, font);
1541 1540
1542 p1 = p2; 1541 p1 = p2;
@@ -1545,13 +1544,18 @@ static void draw_cpu(struct graph_info *ginfo, gint cpu,
1545 last_event_id = event_id; 1544 last_event_id = event_id;
1546 last_is_wakeup = is_wakeup; 1545 last_is_wakeup = is_wakeup;
1547 last_wake_pid = wake_pid; 1546 last_wake_pid = wake_pid;
1547
1548 if (last_is_wakeup)
1549 next_display_pid = last_wake_pid;
1550 else
1551 next_display_pid = pid;
1548 } 1552 }
1549 1553
1550 free_record(record); 1554 free_record(record);
1551 } 1555 }
1552 1556
1553 if (p2) 1557 if (p2 && next_display_pid >= 0)
1554 draw_event_label(ginfo, cpu, last_event_id, last_pid, 1558 draw_event_label(ginfo, cpu, last_event_id, next_display_pid,
1555 p1, p2, ginfo->draw_width, width_16, font); 1559 p1, p2, ginfo->draw_width, width_16, font);
1556 1560
1557 if (last_pid > 0 && 1561 if (last_pid > 0 &&