diff options
Diffstat (limited to 'tools/perf/builtin-timechart.c')
-rw-r--r-- | tools/perf/builtin-timechart.c | 28 |
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 | ||