aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/builtin-timechart.c11
-rw-r--r--tools/perf/util/svghelper.c28
-rw-r--r--tools/perf/util/svghelper.h2
3 files changed, 30 insertions, 11 deletions
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index 58d737ec8f5e..3f45b8b24e3d 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -752,6 +752,7 @@ static void draw_wakeups(void)
752 we = wake_events; 752 we = wake_events;
753 while (we) { 753 while (we) {
754 int from = 0, to = 0; 754 int from = 0, to = 0;
755 char *task_from = NULL, *task_to = NULL;
755 756
756 /* locate the column of the waker and wakee */ 757 /* locate the column of the waker and wakee */
757 p = all_data; 758 p = all_data;
@@ -760,10 +761,14 @@ static void draw_wakeups(void)
760 c = p->all; 761 c = p->all;
761 while (c) { 762 while (c) {
762 if (c->Y && c->start_time <= we->time && c->end_time >= we->time) { 763 if (c->Y && c->start_time <= we->time && c->end_time >= we->time) {
763 if (p->pid == we->waker) 764 if (p->pid == we->waker) {
764 from = c->Y; 765 from = c->Y;
765 if (p->pid == we->wakee) 766 task_from = c->comm;
767 }
768 if (p->pid == we->wakee) {
766 to = c->Y; 769 to = c->Y;
770 task_to = c->comm;
771 }
767 } 772 }
768 c = c->next; 773 c = c->next;
769 } 774 }
@@ -776,7 +781,7 @@ static void draw_wakeups(void)
776 else if (from && to && abs(from - to) == 1) 781 else if (from && to && abs(from - to) == 1)
777 svg_wakeline(we->time, from, to); 782 svg_wakeline(we->time, from, to);
778 else 783 else
779 svg_partial_wakeline(we->time, from, to); 784 svg_partial_wakeline(we->time, from, task_from, to, task_to);
780 we = we->next; 785 we = we->next;
781 } 786 }
782} 787}
diff --git a/tools/perf/util/svghelper.c b/tools/perf/util/svghelper.c
index b0fcecdf378d..9f70fa8e7643 100644
--- a/tools/perf/util/svghelper.c
+++ b/tools/perf/util/svghelper.c
@@ -242,7 +242,7 @@ void svg_pstate(int cpu, u64 start, u64 end, u64 freq)
242} 242}
243 243
244 244
245void svg_partial_wakeline(u64 start, int row1, int row2) 245void svg_partial_wakeline(u64 start, int row1, char *desc1, int row2, char *desc2)
246{ 246{
247 double height; 247 double height;
248 248
@@ -251,21 +251,35 @@ void svg_partial_wakeline(u64 start, int row1, int row2)
251 251
252 252
253 if (row1 < row2) { 253 if (row1 < row2) {
254 if (row1) 254 if (row1) {
255 fprintf(svgfile, "<line x1=\"%4.8f\" y1=\"%4.2f\" x2=\"%4.8f\" y2=\"%4.2f\" style=\"stroke:rgb(32,255,32);stroke-width:0.009\"/>\n", 255 fprintf(svgfile, "<line x1=\"%4.8f\" y1=\"%4.2f\" x2=\"%4.8f\" y2=\"%4.2f\" style=\"stroke:rgb(32,255,32);stroke-width:0.009\"/>\n",
256 time2pixels(start), row1 * SLOT_MULT + SLOT_HEIGHT, time2pixels(start), row1 * SLOT_MULT + SLOT_HEIGHT + SLOT_MULT/32); 256 time2pixels(start), row1 * SLOT_MULT + SLOT_HEIGHT, time2pixels(start), row1 * SLOT_MULT + SLOT_HEIGHT + SLOT_MULT/32);
257 257 if (desc2)
258 if (row2) 258 fprintf(svgfile, "<text transform=\"translate(%4.8f,%4.8f) rotate(90)\" font-size=\"0.02pt\">%s &gt;</text>\n",
259 time2pixels(start), row1 * SLOT_MULT + SLOT_HEIGHT + SLOT_HEIGHT/48, desc2);
260 }
261 if (row2) {
259 fprintf(svgfile, "<line x1=\"%4.8f\" y1=\"%4.2f\" x2=\"%4.8f\" y2=\"%4.2f\" style=\"stroke:rgb(32,255,32);stroke-width:0.009\"/>\n", 262 fprintf(svgfile, "<line x1=\"%4.8f\" y1=\"%4.2f\" x2=\"%4.8f\" y2=\"%4.2f\" style=\"stroke:rgb(32,255,32);stroke-width:0.009\"/>\n",
260 time2pixels(start), row2 * SLOT_MULT - SLOT_MULT/32, time2pixels(start), row2 * SLOT_MULT); 263 time2pixels(start), row2 * SLOT_MULT - SLOT_MULT/32, time2pixels(start), row2 * SLOT_MULT);
264 if (desc1)
265 fprintf(svgfile, "<text transform=\"translate(%4.8f,%4.8f) rotate(90)\" font-size=\"0.02pt\">%s &gt;</text>\n",
266 time2pixels(start), row2 * SLOT_MULT - SLOT_MULT/32, desc1);
267 }
261 } else { 268 } else {
262 if (row2) 269 if (row2) {
263 fprintf(svgfile, "<line x1=\"%4.8f\" y1=\"%4.2f\" x2=\"%4.8f\" y2=\"%4.2f\" style=\"stroke:rgb(32,255,32);stroke-width:0.009\"/>\n", 270 fprintf(svgfile, "<line x1=\"%4.8f\" y1=\"%4.2f\" x2=\"%4.8f\" y2=\"%4.2f\" style=\"stroke:rgb(32,255,32);stroke-width:0.009\"/>\n",
264 time2pixels(start), row2 * SLOT_MULT + SLOT_HEIGHT, time2pixels(start), row2 * SLOT_MULT + SLOT_HEIGHT + SLOT_MULT/32); 271 time2pixels(start), row2 * SLOT_MULT + SLOT_HEIGHT, time2pixels(start), row2 * SLOT_MULT + SLOT_HEIGHT + SLOT_MULT/32);
265 272 if (desc1)
266 if (row1) 273 fprintf(svgfile, "<text transform=\"translate(%4.8f,%4.8f) rotate(90)\" font-size=\"0.02pt\">%s &lt;</text>\n",
274 time2pixels(start), row2 * SLOT_MULT + SLOT_HEIGHT + SLOT_MULT/48, desc1);
275 }
276 if (row1) {
267 fprintf(svgfile, "<line x1=\"%4.8f\" y1=\"%4.2f\" x2=\"%4.8f\" y2=\"%4.2f\" style=\"stroke:rgb(32,255,32);stroke-width:0.009\"/>\n", 277 fprintf(svgfile, "<line x1=\"%4.8f\" y1=\"%4.2f\" x2=\"%4.8f\" y2=\"%4.2f\" style=\"stroke:rgb(32,255,32);stroke-width:0.009\"/>\n",
268 time2pixels(start), row1 * SLOT_MULT - SLOT_MULT/32, time2pixels(start), row1 * SLOT_MULT); 278 time2pixels(start), row1 * SLOT_MULT - SLOT_MULT/32, time2pixels(start), row1 * SLOT_MULT);
279 if (desc2)
280 fprintf(svgfile, "<text transform=\"translate(%4.8f,%4.8f) rotate(90)\" font-size=\"0.02pt\">%s &lt;</text>\n",
281 time2pixels(start), row1 * SLOT_MULT - SLOT_HEIGHT/32, desc2);
282 }
269 } 283 }
270 height = row1 * SLOT_MULT; 284 height = row1 * SLOT_MULT;
271 if (row2 > row1) 285 if (row2 > row1)
diff --git a/tools/perf/util/svghelper.h b/tools/perf/util/svghelper.h
index ad79b5dc53de..8260a7e6e314 100644
--- a/tools/perf/util/svghelper.h
+++ b/tools/perf/util/svghelper.h
@@ -17,7 +17,7 @@ extern void svg_pstate(int cpu, u64 start, u64 end, u64 freq);
17extern void svg_time_grid(u64 start, u64 end); 17extern void svg_time_grid(u64 start, u64 end);
18extern void svg_legenda(void); 18extern void svg_legenda(void);
19extern void svg_wakeline(u64 start, int row1, int row2); 19extern void svg_wakeline(u64 start, int row1, int row2);
20extern void svg_partial_wakeline(u64 start, int row1, int row2); 20extern void svg_partial_wakeline(u64 start, int row1, char *desc1, int row2, char *desc2);
21extern void svg_interrupt(u64 start, int row); 21extern void svg_interrupt(u64 start, int row);
22extern void svg_text(int Yslot, u64 start, const char *text); 22extern void svg_text(int Yslot, u64 start, const char *text);
23extern void svg_close(void); 23extern void svg_close(void);