]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootchart: reset list_sample_data head before generating SVG 399/head
authorGianpaolo Macario <gianpaolo_macario@mentor.com>
Sat, 27 Jun 2015 07:17:07 +0000 (07:17 +0000)
committerGianpaolo Macario <gianpaolo_macario@mentor.com>
Sun, 28 Jun 2015 17:30:47 +0000 (17:30 +0000)
Until commit 1f2ecb0 ("bootchart: kill a bunch of global variables")
variable "head" was declared global and this action was performed by svg_header.
Now that "head" is local and passed to each function called by svg_do(...)
move the code at the beginning of svg_do(...) to restore the correct behaviour.

src/bootchart/svg.c

index f442200b66b8fbffb59e0e8f3d4728fd42cbe1f2..0ac1f55a918e84d2a1431588b96a85966f111315 100644 (file)
@@ -76,8 +76,6 @@ static void svg_header(FILE *of, struct list_sample_data *head, double graph_sta
 
         assert(head);
 
-        sampledata = head;
-        LIST_FIND_TAIL(link, sampledata, head);
         sampledata_last = head;
         LIST_FOREACH_BEFORE(link, sampledata, head) {
                 sampledata_last = sampledata;
@@ -1296,6 +1294,8 @@ int svg_do(FILE *of,
         double offset = 7;
         int r, c;
 
+        sampledata = head;
+        LIST_FIND_TAIL(link, sampledata, head);
         ps = ps_first;
 
         /* count initcall thread count first */