X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fbootchart%2Fsvg.c;h=135883fb838c813a932ff7fe5cf96fdbfd48f2f3;hp=a4086c52278d77250ccfa2caff1677c9a34486b1;hb=4d8ddba9d71e51356cc9488f906b8fef89c60c23;hpb=9607d9470eec07df817e58f64d312ccb5ac4cfcc diff --git a/src/bootchart/svg.c b/src/bootchart/svg.c index a4086c522..135883fb8 100644 --- a/src/bootchart/svg.c +++ b/src/bootchart/svg.c @@ -3,7 +3,7 @@ /*** This file is part of systemd. - Copyright (C) 2009-2013 Intel Coproration + Copyright (C) 2009-2013 Intel Corporation Authors: Auke Kok @@ -38,6 +38,7 @@ #include "store.h" #include "svg.h" #include "bootchart.h" +#include "list.h" #define time_to_graph(t) ((t) * arg_scale_x) #define ps_to_graph(n) ((n) * arg_scale_y) @@ -67,16 +68,29 @@ static double idletime = -1.0; static int pfiltered = 0; static int pcount = 0; static int kcount = 0; -static float psize = 0; -static float ksize = 0; -static float esize = 0; +static double psize = 0; +static double ksize = 0; +static double esize = 0; +static struct list_sample_data *sampledata; +static struct list_sample_data *prev_sampledata; +extern struct list_sample_data *head; static void svg_header(void) { - float w; - float h; + double w; + double h; + struct list_sample_data *sampledata_last; + + assert(head); + + sampledata = head; + LIST_FIND_TAIL(link, sampledata, head); + sampledata_last = head; + LIST_FOREACH_BEFORE(link, sampledata, head) { + sampledata_last = sampledata; + } /* min width is about 1600px due to the label */ - w = 150.0 + 10.0 + time_to_graph(sampletime[samples-1] - graph_start); + w = 150.0 + 10.0 + time_to_graph(sampledata_last->sampletime - graph_start); w = ((w < 1600.0) ? 1600.0 : w); /* height is variable based on pss, psize, ksize */ @@ -111,6 +125,7 @@ static void svg_header(void) { svg("\n