diff options
Diffstat (limited to 'tools/perf/util/svghelper.c')
-rw-r--r-- | tools/perf/util/svghelper.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/perf/util/svghelper.c b/tools/perf/util/svghelper.c index b3637db025a2..96c866045d60 100644 --- a/tools/perf/util/svghelper.c +++ b/tools/perf/util/svghelper.c | |||
@@ -12,6 +12,7 @@ | |||
12 | * of the License. | 12 | * of the License. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <inttypes.h> | ||
15 | #include <stdio.h> | 16 | #include <stdio.h> |
16 | #include <stdlib.h> | 17 | #include <stdlib.h> |
17 | #include <unistd.h> | 18 | #include <unistd.h> |
@@ -43,11 +44,11 @@ static double cpu2y(int cpu) | |||
43 | return cpu2slot(cpu) * SLOT_MULT; | 44 | return cpu2slot(cpu) * SLOT_MULT; |
44 | } | 45 | } |
45 | 46 | ||
46 | static double time2pixels(u64 time) | 47 | static double time2pixels(u64 __time) |
47 | { | 48 | { |
48 | double X; | 49 | double X; |
49 | 50 | ||
50 | X = 1.0 * svg_page_width * (time - first_time) / (last_time - first_time); | 51 | X = 1.0 * svg_page_width * (__time - first_time) / (last_time - first_time); |
51 | return X; | 52 | return X; |
52 | } | 53 | } |
53 | 54 | ||
@@ -94,7 +95,7 @@ void open_svg(const char *filename, int cpus, int rows, u64 start, u64 end) | |||
94 | 95 | ||
95 | total_height = (1 + rows + cpu2slot(cpus)) * SLOT_MULT; | 96 | total_height = (1 + rows + cpu2slot(cpus)) * SLOT_MULT; |
96 | fprintf(svgfile, "<?xml version=\"1.0\" standalone=\"no\"?> \n"); | 97 | fprintf(svgfile, "<?xml version=\"1.0\" standalone=\"no\"?> \n"); |
97 | fprintf(svgfile, "<svg width=\"%i\" height=\"%llu\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n", svg_page_width, total_height); | 98 | fprintf(svgfile, "<svg width=\"%i\" height=\"%" PRIu64 "\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n", svg_page_width, total_height); |
98 | 99 | ||
99 | fprintf(svgfile, "<defs>\n <style type=\"text/css\">\n <![CDATA[\n"); | 100 | fprintf(svgfile, "<defs>\n <style type=\"text/css\">\n <![CDATA[\n"); |
100 | 101 | ||
@@ -455,9 +456,9 @@ void svg_legenda(void) | |||
455 | return; | 456 | return; |
456 | 457 | ||
457 | svg_legenda_box(0, "Running", "sample"); | 458 | svg_legenda_box(0, "Running", "sample"); |
458 | svg_legenda_box(100, "Idle","rect.c1"); | 459 | svg_legenda_box(100, "Idle","c1"); |
459 | svg_legenda_box(200, "Deeper Idle", "rect.c3"); | 460 | svg_legenda_box(200, "Deeper Idle", "c3"); |
460 | svg_legenda_box(350, "Deepest Idle", "rect.c6"); | 461 | svg_legenda_box(350, "Deepest Idle", "c6"); |
461 | svg_legenda_box(550, "Sleeping", "process2"); | 462 | svg_legenda_box(550, "Sleeping", "process2"); |
462 | svg_legenda_box(650, "Waiting for cpu", "waiting"); | 463 | svg_legenda_box(650, "Waiting for cpu", "waiting"); |
463 | svg_legenda_box(800, "Blocked on IO", "blocked"); | 464 | svg_legenda_box(800, "Blocked on IO", "blocked"); |
@@ -483,7 +484,7 @@ void svg_time_grid(void) | |||
483 | color = 128; | 484 | color = 128; |
484 | } | 485 | } |
485 | 486 | ||
486 | fprintf(svgfile, "<line x1=\"%4.8f\" y1=\"%4.2f\" x2=\"%4.8f\" y2=\"%llu\" style=\"stroke:rgb(%i,%i,%i);stroke-width:%1.3f\"/>\n", | 487 | fprintf(svgfile, "<line x1=\"%4.8f\" y1=\"%4.2f\" x2=\"%4.8f\" y2=\"%" PRIu64 "\" style=\"stroke:rgb(%i,%i,%i);stroke-width:%1.3f\"/>\n", |
487 | time2pixels(i), SLOT_MULT/2, time2pixels(i), total_height, color, color, color, thickness); | 488 | time2pixels(i), SLOT_MULT/2, time2pixels(i), total_height, color, color, color, thickness); |
488 | 489 | ||
489 | i += 10000000; | 490 | i += 10000000; |