chiark / gitweb /
analyze: fix plot issues when using gummiboot
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Fri, 31 Jan 2014 06:07:20 +0000 (07:07 +0100)
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Fri, 31 Jan 2014 06:12:43 +0000 (07:12 +0100)
It would crash and the legend in the bottom followed the time 0.0.

src/analyze/analyze.c

index 459f87957f1a207f13915b14ad2219fd78100004..3d2d08f6676222742c2ac5f3d99de79291adb1bd 100644 (file)
@@ -556,7 +556,7 @@ static int analyze_plot(sd_bus *bus) {
             name.nodename, name.release, name.version, name.machine);
 
         svg("<g transform=\"translate(%.3f,100)\">\n", 20.0 + (SCALE_X * boot->firmware_time));
             name.nodename, name.release, name.version, name.machine);
 
         svg("<g transform=\"translate(%.3f,100)\">\n", 20.0 + (SCALE_X * boot->firmware_time));
-        svg_graph_box(m, -boot->firmware_time, boot->finish_time);
+        svg_graph_box(m, -(double) boot->firmware_time, boot->finish_time);
 
         if (boot->firmware_time) {
                 svg_bar("firmware", -(double) boot->firmware_time, -(double) boot->loader_time, y);
 
         if (boot->firmware_time) {
                 svg_bar("firmware", -(double) boot->firmware_time, -(double) boot->loader_time, y);
@@ -606,7 +606,10 @@ static int analyze_plot(sd_bus *bus) {
                 y++;
         }
 
                 y++;
         }
 
+        svg("</g>\n");
+
         /* Legend */
         /* Legend */
+        svg("<g transform=\"translate(20,100)\">\n");
         y++;
         svg_bar("activating", 0, 300000, y);
         svg_text(true, 400000, y, "Activating");
         y++;
         svg_bar("activating", 0, 300000, y);
         svg_text(true, 400000, y, "Activating");