aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@infradead.org>2009-10-19 17:46:49 -0400
committerIngo Molnar <mingo@elte.hu>2009-10-19 21:39:16 -0400
commit3bc2a39c69d423d5d1f0b3ef77960b1464c976a0 (patch)
tree21f9f01d4d0a44ab39ea29b2853a23594216931e /tools
parentdc79959aaf80e518741657a702fa2727c86c1189 (diff)
perf timechart: Fix the wakeup-arrows that point to non-visible processes
The timechart wakeup arrows currently show no process information when the waker/wakee are processes that are not actually chosen to be shown on the timechart. This patch fixes this oversight, by looking through all processes (after giving preference to visible processes) as well as falling back to just showing the PID if no name for the process can be resolved. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <20091020064649.0e4959b2@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools')
-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)
765 if (c->Y && c->start_time <= we->time && c->end_time >= we->time) { 765 if (c->Y && c->start_time <= we->time && c->end_time >= we->time) {
766 if (p->pid == we->waker) { 766 if (p->pid == we->waker) {
767 from = c->Y; 767 from = c->Y;
768 task_from = c->comm; 768 task_from = strdup(c->comm);
769 } 769 }
770 if (p->pid == we->wakee) { 770 if (p->pid == we->wakee) {
771 to = c->Y; 771 to = c->Y;
772 task_to = c->comm; 772 task_to = strdup(c->comm);
773 } 773 }
774 } 774 }
775 c = c->next; 775 c = c->next;
776 } 776 }
777 c = p->all;
778 while (c) {
779 if (p->pid == we->waker && !from) {
780 from = c->Y;
781 task_from = strdup(c->comm);
782 }
783 if (p->pid == we->wakee && !to) {
784 to = c->Y;
785 task_to = strdup(c->comm);
786 }
787 c = c->next;
788 }
777 } 789 }
778 p = p->next; 790 p = p->next;
779 } 791 }
780 792
793 if (!task_from) {
794 task_from = malloc(40);
795 sprintf(task_from, "[%i]", we->waker);
796 }
797 if (!task_to) {
798 task_to = malloc(40);
799 sprintf(task_to, "[%i]", we->wakee);
800 }
801
781 if (we->waker == -1) 802 if (we->waker == -1)
782 svg_interrupt(we->time, to); 803 svg_interrupt(we->time, to);
783 else if (from && to && abs(from - to) == 1) 804 else if (from && to && abs(from - to) == 1)
@@ -785,6 +806,9 @@ static void draw_wakeups(void)
785 else 806 else
786 svg_partial_wakeline(we->time, from, task_from, to, task_to); 807 svg_partial_wakeline(we->time, from, task_from, to, task_to);
787 we = we->next; 808 we = we->next;
809
810 free(task_from);
811 free(task_to);
788 } 812 }
789} 813}
790 814