aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/builtin-timechart.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-10-29 08:12:00 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-10-29 08:12:00 -0700
commit37c2ca24119f7dd89cbbb43833df1e6c5fb3417b (patch)
tree7002e816ca784acbdd49c69752e08c4da00fe961 /tools/perf/builtin-timechart.c
parent6e958d73c25eecaf02a1998cda9ec8ce8da11042 (diff)
parent2e600d01c131ee189f55ca1879cd364b9e056df8 (diff)
Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: perf timechart: Improve the visual appearance of scheduler delays perf timechart: Fix the wakeup-arrows that point to non-visible processes perf top: Fix --delay_secs 0 division by zero perf tools: Bump version to 0.0.2 perf_event: Adjust frequency and unthrottle for non-group-leader events
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 702d8fe58fb..e8a510d935e 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);
}
}