summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 586ff0d)
raw | patch | inline | side by side (parent: 586ff0d)
author | Florian Forster <ff@octo.it> | |
Tue, 15 Jun 2010 13:31:35 +0000 (15:31 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 15 Jun 2010 13:31:35 +0000 (15:31 +0200) |
collection.conf | patch | blob | history | |
graph_def.c | patch | blob | history |
diff --git a/collection.conf b/collection.conf
index cabea9c6fbc4ac7daaf1d4384040165ae9545768..9197d98ee50e77e854528539a131b6cca31ebe50 100644 (file)
--- a/collection.conf
+++ b/collection.conf
Color "ff0000"
Area true
#Stack true
+ Format "%5.1lf%s"
</DEF>
<DEF>
TypeInstance "reserved"
Color "ffb000"
Area true
Stack true
+ Format "%5.1lf%s"
</DEF>
<DEF>
TypeInstance "free"
Color "00bf00"
Area true
Stack true
+ Format "%5.1lf%s"
</DEF>
</Graph>
diff --git a/graph_def.c b/graph_def.c
index a5511f6fbb742bc38f9a725785fd8a859b61b13a..b8e0ce4e5402e9f76cf67ca879b15ef568418230 100644 (file)
--- a/graph_def.c
+++ b/graph_def.c
uint32_t color;
_Bool stack;
_Bool area;
+ char *format;
graph_def_t *next;
};
}
memset (ret, 0, sizeof (*ret));
ret->legend = NULL;
+ ret->format = NULL;
ret->ds_name = strdup (ds_name);
if (ret->ds_name == NULL)
ident_destroy (def->select);
free (def->ds_name);
+ free (def->legend);
+ free (def->format);
free (def);
graph_config_get_bool (child, &def->stack);
else if (strcasecmp ("Area", child->key) == 0)
graph_config_get_bool (child, &def->area);
+ else if (strcasecmp ("Format", child->key) == 0)
+ graph_config_get_string (child, &def->format);
else
fprintf (stderr, "def_config: Ignoring unknown config option \"%s\"",
child->key);
index, def->color,
(def->legend != NULL) ? def->legend : def->ds_name,
def->stack ? ":STACK" : "");
- array_append_format (args, "GPRINT:vdef_%04i_min:%%lg min,", index);
- array_append_format (args, "GPRINT:vdef_%04i_avg:%%lg avg,", index);
- array_append_format (args, "GPRINT:vdef_%04i_max:%%lg max,", index);
- array_append_format (args, "GPRINT:vdef_%04i_lst:%%lg last\\l", index);
+ array_append_format (args, "GPRINT:vdef_%04i_min:%s min,",
+ index, (def->format != NULL) ? def->format : "%lg");
+ array_append_format (args, "GPRINT:vdef_%04i_avg:%s avg,",
+ index, (def->format != NULL) ? def->format : "%lg");
+ array_append_format (args, "GPRINT:vdef_%04i_max:%s max,",
+ index, (def->format != NULL) ? def->format : "%lg");
+ array_append_format (args, "GPRINT:vdef_%04i_lst:%s last\\l",
+ index, (def->format != NULL) ? def->format : "%lg");
free (file);