aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-timechart.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-10-20 07:51:41 +0200
committerIngo Molnar <mingo@elte.hu>2009-10-20 07:51:44 +0200
commitc258449bc9d286e2ee6546c9cdf911e96cbc126a (patch)
tree51d389391bf6bef4be756652e401823f8171656e /tools/perf/builtin-timechart.c
parentperf tools: Add bunch of missing headers to LIB_H (diff)
parentperf timechart: Improve the visual appearance of scheduler delays (diff)
downloadlinux-dev-c258449bc9d286e2ee6546c9cdf911e96cbc126a.tar.xz
linux-dev-c258449bc9d286e2ee6546c9cdf911e96cbc126a.zip
Merge branch 'perf/urgent' into perf/core
Merge reason: Queue up dependent patch. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-timechart.c')
-rw-r--r--tools/perf/builtin-timechart.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index 702d8fe58fbc..e8a510d935e5 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -765,19 +765,40 @@ static void draw_wakeups(void)
if (c->Y && c->start_time <= we->time && c->end_time >= we->time) {
if (p->pid == we->waker) {
from = c->Y;
- task_from = c->comm;
+ task_from = strdup(c->comm);
}
if (p->pid == we->wakee) {
to = c->Y;
- task_to = c->comm;
+ task_to = strdup(c->comm);
}
}
c = c->next;
}
+ c = p->all;
+ while (c) {
+ if (p->pid == we->waker && !from) {
+ from = c->Y;
+ task_from = strdup(c->comm);
+ }
+ if (p->pid == we->wakee && !to) {
+ to = c->Y;
+ task_to = strdup(c->comm);
+ }
+ c = c->next;
+ }
}
p = p->next;
}
+ if (!task_from) {
+ task_from = malloc(40);
+ sprintf(task_from, "[%i]", we->waker);
+ }
+ if (!task_to) {
+ task_to = malloc(40);
+ sprintf(task_to, "[%i]", we->wakee);
+ }
+
if (we->waker == -1)
svg_interrupt(we->time, to);
else if (from && to && abs(from - to) == 1)
@@ -785,6 +806,9 @@ static void draw_wakeups(void)
else
svg_partial_wakeline(we->time, from, task_from, to, task_to);
we = we->next;
+
+ free(task_from);
+ free(task_to);
}
}