summaryrefslogtreecommitdiff
path: root/graph.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2012-03-21 19:53:32 +0100
committerJens Axboe <axboe@kernel.dk>2012-03-21 19:53:32 +0100
commitf00e43f2953d71cfc0fb21d704a473632d0b1ee4 (patch)
treefa1ba72c1dba602466805610ec7654295e6f621d /graph.c
parent4c0cd537f392e8a824d0080675f07b84c355af20 (diff)
downloadfio-f00e43f2953d71cfc0fb21d704a473632d0b1ee4.tar.gz
fio-f00e43f2953d71cfc0fb21d704a473632d0b1ee4.tar.bz2
graph: cleanup tooltip alias handling
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'graph.c')
-rw-r--r--graph.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/graph.c b/graph.c
index 0dae510a..2f00dab4 100644
--- a/graph.c
+++ b/graph.c
@@ -690,20 +690,15 @@ static void graph_label_add_value(struct graph_label *i, void *value,
x = malloc(sizeof(*x));
memset(x, 0, sizeof(*x));
x->value = value;
- if (tooltip)
- x->tooltip = strdup(tooltip);
- else
- x->tooltip = NULL;
x->next = NULL;
- if (!i->tail) {
+ if (!i->tail)
i->values = x;
- } else {
+ else
i->tail->next = x;
- }
i->tail = x;
i->value_count++;
- if (x->tooltip) {
+ if (tooltip) {
double yval = gety(x);
double miny = yval / TOOLTIP_DELTA;
double maxy = yval * TOOLTIP_DELTA;
@@ -720,11 +715,10 @@ static void graph_label_add_value(struct graph_label *i, void *value,
* should be identical, we can drop it
*/
ret = prio_tree_insert(&i->prio_tree, &x->node);
- if (ret != &x->node) {
- free(x->tooltip);
- x->tooltip = NULL;
- } else
+ if (ret == &x->node) {
+ x->tooltip = strdup(tooltip);
i->tooltip_count++;
+ }
}
if (i->parent->per_label_limit != -1 &&