From 637079cd0bdccddc091eb82a65a8b938124e0780 Mon Sep 17 00:00:00 2001
From: Umut Tezduyar <umut@tezduyar.com>
Date: Wed, 8 May 2013 17:47:02 +0200
Subject: [PATCH 2/2] analyze: change style of plot

- Removed 0.1 sec lines. Was it really adding a value?
- Removed thick 5 sec lines. Was it really adding a value?
- Used very soft colors
- kernel is a full bar from 0 sec to boot up finish.
---
 src/analyze/systemd-analyze.c |   37 +++++++++++++-------------------
 1 files changed, 15 insertions(+), 22 deletions(-)

diff --git a/src/analyze/systemd-analyze.c b/src/analyze/systemd-analyze.c
index df3d307..f0992a3 100644
--- a/src/analyze/systemd-analyze.c
+++ b/src/analyze/systemd-analyze.c
@@ -383,17 +383,10 @@ static void svg_graph_box(double height, double begin, double end) {
 
         for (i = ((long long) (begin / 100000)) * 100000; i <= end; i+=100000) {
                 /* lines for each second */
-                if (i % 5000000 == 0)
-                        svg("  <line class=\"sec5\" x1=\"%.03f\" y1=\"0\" x2=\"%.03f\" y2=\"%.03f\" />\n"
-                            "  <text class=\"sec\" x=\"%.03f\" y=\"%.03f\" >%.01fs</text>\n",
-                            SCALE_X * i, SCALE_X * i, SCALE_Y * height, SCALE_X * i, -5.0, 0.000001 * i);
-                else if (i % 1000000 == 0)
+                if (i % 1000000 == 0)
                         svg("  <line class=\"sec1\" x1=\"%.03f\" y1=\"0\" x2=\"%.03f\" y2=\"%.03f\" />\n"
                             "  <text class=\"sec\" x=\"%.03f\" y=\"%.03f\" >%.01fs</text>\n",
                             SCALE_X * i, SCALE_X * i, SCALE_Y * height, SCALE_X * i, -5.0, 0.000001 * i);
-                else
-                        svg("  <line class=\"sec01\" x1=\"%.03f\" y1=\"0\" x2=\"%.03f\" y2=\"%.03f\" />\n",
-                            SCALE_X * i, SCALE_X * i, SCALE_Y * height);
         }
 }
 
@@ -484,21 +477,20 @@ static int analyze_plot(DBusConnection *bus) {
 
         /* style sheet */
         svg("<defs>\n  <style type=\"text/css\">\n    <![CDATA[\n"
-            "      rect       { stroke-width: 1; stroke-opacity: 0; }\n"
-            "      rect.activating   { fill: rgb(255,0,0); fill-opacity: 0.7; }\n"
-            "      rect.active       { fill: rgb(200,150,150); fill-opacity: 0.7; }\n"
-            "      rect.deactivating { fill: rgb(150,100,100); fill-opacity: 0.7; }\n"
-            "      rect.kernel       { fill: rgb(150,150,150); fill-opacity: 0.7; }\n"
-            "      rect.initrd       { fill: rgb(150,150,150); fill-opacity: 0.7; }\n"
-            "      rect.firmware     { fill: rgb(150,150,150); fill-opacity: 0.7; }\n"
-            "      rect.loader       { fill: rgb(150,150,150); fill-opacity: 0.7; }\n"
-            "      rect.userspace    { fill: rgb(150,150,150); fill-opacity: 0.7; }\n"
-            "      rect.generators   { fill: rgb(102,204,255); fill-opacity: 0.7; }\n"
-            "      rect.box   { fill: rgb(240,240,240); stroke: rgb(192,192,192); }\n"
+            "      rect       { stroke-width: 1; fill-opacity: 0.7; }\n"
+            "      rect.activating   { fill: rgb(142,214,234); }\n"
+            "      rect.active       { fill: rgb(216,240,248); }\n"
+            "      rect.deactivating { fill: rgb(79,189,221);  }\n"
+            "      rect.kernel       { fill: rgb(231,243,241); }\n"
+            "      rect.kernel_active{ fill: rgb(242,249,248); }\n"
+            "      rect.initrd       { fill: rgb(231,243,241); }\n"
+            "      rect.firmware     { fill: rgb(231,243,241); }\n"
+            "      rect.loader       { fill: rgb(231,243,241); }\n"
+            "      rect.userspace    { fill: rgb(231,243,241); }\n"
+            "      rect.generators   { fill: rgb(255,224,153); }\n"
+            "      rect.box   { fill:transparent; stroke: rgb(224,224,224); }\n"
             "      line       { stroke: rgb(64,64,64); stroke-width: 1; }\n"
-            "//    line.sec1  { }\n"
-            "      line.sec5  { stroke-width: 2; }\n"
-            "      line.sec01 { stroke: rgb(224,224,224); stroke-width: 1; }\n"
+            "      line.sec1  { stroke: rgb(224,224,224); stroke-width: 1; }\n"
             "      text       { font-family: Verdana, Helvetica; font-size: 10; }\n"
             "      text.left  { font-family: Verdana, Helvetica; font-size: 10; text-anchor: start; }\n"
             "      text.right { font-family: Verdana, Helvetica; font-size: 10; text-anchor: end; }\n"
@@ -525,6 +517,7 @@ static int analyze_plot(DBusConnection *bus) {
         }
         if (boot->kernel_time) {
                 svg_bar("kernel", 0, boot->kernel_done_time, y);
+                svg_bar("kernel_active", boot->kernel_done_time, boot->finish_time, y);
                 svg_text(true, 0, y, "kernel");
                 y++;
         }
-- 
1.7.2.5

