summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-timechart.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-21 09:06:31 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-21 09:06:31 -0700
commitf4eccb6d979e0cc5a719a50af5f9a56e79092a2d (patch)
tree00b3ca17251430ce1336d813cf76e95ccdd55099 /tools/perf/builtin-timechart.c
parent8e4bc3dd2ca07d77882eba73cea240aba95a1854 (diff)
parentcd74c86bdf705f824d494a2bbda393d1d562b40a (diff)
Merge branch 'perfcounters-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perfcounters-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: perf_counter, powerpc, sparc: Fix compilation after perf_counter_overflow() change perf_counter: x86: Fix PMU resource leak perf util: SVG performance improvements perf util: Make the timechart SVG width dynamic perf timechart: Show the duration of scheduler delays in the SVG perf timechart: Show the name of the waker/wakee in timechart
Diffstat (limited to 'tools/perf/builtin-timechart.c')
-rw-r--r--tools/perf/builtin-timechart.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index 58d737ec8f5..60040639627 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -752,6 +752,7 @@ static void draw_wakeups(void)
we = wake_events;
while (we) {
int from = 0, to = 0;
+ char *task_from = NULL, *task_to = NULL;
/* locate the column of the waker and wakee */
p = all_data;
@@ -760,10 +761,14 @@ static void draw_wakeups(void)
c = p->all;
while (c) {
if (c->Y && c->start_time <= we->time && c->end_time >= we->time) {
- if (p->pid == we->waker)
+ if (p->pid == we->waker) {
from = c->Y;
- if (p->pid == we->wakee)
+ task_from = c->comm;
+ }
+ if (p->pid == we->wakee) {
to = c->Y;
+ task_to = c->comm;
+ }
}
c = c->next;
}
@@ -776,7 +781,7 @@ static void draw_wakeups(void)
else if (from && to && abs(from - to) == 1)
svg_wakeline(we->time, from, to);
else
- svg_partial_wakeline(we->time, from, to);
+ svg_partial_wakeline(we->time, from, task_from, to, task_to);
we = we->next;
}
}
@@ -822,15 +827,15 @@ static void draw_process_bars(void)
continue;
}
- svg_box(Y, p->start_time, p->end_time, "process");
+ svg_box(Y, c->start_time, c->end_time, "process");
sample = c->samples;
while (sample) {
if (sample->type == TYPE_RUNNING)
- svg_sample(Y, sample->cpu, sample->start_time, sample->end_time, "sample");
+ svg_sample(Y, sample->cpu, sample->start_time, sample->end_time);
if (sample->type == TYPE_BLOCKED)
svg_box(Y, sample->start_time, sample->end_time, "blocked");
if (sample->type == TYPE_WAITING)
- svg_box(Y, sample->start_time, sample->end_time, "waiting");
+ svg_waiting(Y, sample->start_time, sample->end_time);
sample = sample->next;
}
@@ -910,9 +915,9 @@ static void write_svg_file(const char *filename)
if (count < 15)
count = determine_display_tasks(TIME_THRESH / 10);
- open_svg(filename, numcpus, count);
+ open_svg(filename, numcpus, count, first_time, last_time);
- svg_time_grid(first_time, last_time);
+ svg_time_grid();
svg_legenda();
for (i = 0; i < numcpus; i++)
@@ -1127,6 +1132,8 @@ static const struct option options[] = {
"input file name"),
OPT_STRING('o', "output", &output_name, "file",
"output file name"),
+ OPT_INTEGER('w', "width", &svg_page_width,
+ "page width"),
OPT_END()
};