summaryrefslogtreecommitdiff
path: root/graph.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2012-03-22 20:48:02 +0100
committerJens Axboe <axboe@kernel.dk>2012-03-22 20:48:02 +0100
commitd0db819d9c5abe904f85a3b21a95023fef007f20 (patch)
tree7aa34a6da6d1a8469e58a74ee93a56623d142bbf /graph.c
parentbd10a0694df75c5ae0257ac2f6c8b51061859321 (diff)
downloadfio-d0db819d9c5abe904f85a3b21a95023fef007f20.tar.gz
fio-d0db819d9c5abe904f85a3b21a95023fef007f20.tar.bz2
graph: fix finding tooltips from label 1+
Only break if we actually found a tooltip, not unconditionally. Cleanups. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'graph.c')
-rw-r--r--graph.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/graph.c b/graph.c
index 146ed7b1..25e04eec 100644
--- a/graph.c
+++ b/graph.c
@@ -716,7 +716,7 @@ void graph_add_label(struct graph *bg, const char *label)
static void __graph_value_drop(struct graph_label *l, struct graph_value *v)
{
- flist_del(&v->list);
+ flist_del_init(&v->list);
if (v->tooltip)
free(v->tooltip);
free(v->value);
@@ -726,8 +726,6 @@ static void __graph_value_drop(struct graph_label *l, struct graph_value *v)
static void graph_value_drop(struct graph_label *l, struct graph_value *v)
{
- struct flist_head *entry, *tmp;
-
/*
* Find head, the guy that's on the prio tree
*/
@@ -741,11 +739,11 @@ static void graph_value_drop(struct graph_label *l, struct graph_value *v)
/*
* Free aliases
*/
- flist_for_each_safe(entry, tmp, &v->alias) {
+ while (!flist_empty(&v->alias)) {
struct graph_value *a;
- a = flist_entry(entry, struct graph_value, alias);
- flist_del(&a->alias);
+ a = flist_entry(v->alias.next, struct graph_value, alias);
+ flist_del_init(&a->alias);
__graph_value_drop(l, a);
}
@@ -1043,7 +1041,8 @@ const char *graph_find_tooltip(struct graph *g, int ix, int iy)
/*
* If we got matches in one label, don't check others.
*/
- break;
+ if (best)
+ break;
}
if (best)