2 * gfio - gui front end for fio - the flexible io tester
4 * Copyright (C) 2012 Stephen M. Cameron <stephenmcameron@gmail.com>
6 * The license below covers all files distributed with fio unless otherwise
7 * noted in the file itself.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32 #include "tickmarks.h"
35 #include "lib/prio_tree.h"
38 * Allowable difference to show tooltip
40 #define TOOLTIP_DELTA 0.08
52 struct flist_head list;
53 struct prio_tree_node node;
54 struct flist_head alias;
61 struct flist_head list;
63 struct flist_head value_list;
64 struct prio_tree_root prio_tree;
80 unsigned int xdim, ydim;
81 double xoffset, yoffset;
82 struct flist_head label_list;
85 graph_axis_unit_change_callback x_axis_unit_change_callback;
86 graph_axis_unit_change_callback y_axis_unit_change_callback;
87 unsigned int base_offset;
88 unsigned int dont_graph_all_zeroes;
96 double xtick_zero_val;
100 double ytick_zero_val;
101 double ytick_one_val;
104 void graph_set_size(struct graph *g, unsigned int xdim, unsigned int ydim)
110 void graph_set_position(struct graph *g, double xoffset, double yoffset)
112 g->xoffset = xoffset;
113 g->yoffset = yoffset;
116 struct graph *graph_new(unsigned int xdim, unsigned int ydim, const char *font)
120 g = calloc(1, sizeof(*g));
121 INIT_FLIST_HEAD(&g->label_list);
122 graph_set_size(g, xdim, ydim);
123 g->per_label_limit = -1;
130 void graph_x_axis_unit_change_notify(struct graph *g, graph_axis_unit_change_callback f)
132 g->x_axis_unit_change_callback = f;
135 void graph_y_axis_unit_change_notify(struct graph *g, graph_axis_unit_change_callback f)
137 g->y_axis_unit_change_callback = f;
140 static int count_labels(struct graph *g)
142 struct flist_head *entry;
145 flist_for_each(entry, &g->label_list)
151 static int count_values(struct graph_label *l)
153 struct flist_head *entry;
156 flist_for_each(entry, &l->value_list)
162 typedef double (*double_comparator)(double a, double b);
164 static double mindouble(double a, double b)
166 return a < b ? a : b;
169 static double maxdouble(double a, double b)
171 return a < b ? b : a;
174 static double find_double_values(struct graph_label *l, double_comparator cmp)
176 struct flist_head *entry;
180 if (flist_empty(&l->value_list))
183 flist_for_each(entry, &l->value_list) {
184 struct graph_value *i;
186 i = flist_entry(entry, struct graph_value, list);
187 tmp = *(double *) i->value;
192 answer = cmp(answer, tmp);
198 static double find_double_data(struct graph *g, double_comparator cmp)
200 struct flist_head *entry;
201 struct graph_label *i;
205 if (flist_empty(&g->label_list))
208 flist_for_each(entry, &g->label_list) {
209 i = flist_entry(entry, struct graph_label, list);
210 tmp = find_double_values(i, cmp);
215 answer = cmp(tmp, answer);
221 static double find_min_data(struct graph *g)
223 return find_double_data(g, mindouble);
226 static double find_max_data(struct graph *g)
228 return find_double_data(g, maxdouble);
231 static void draw_bars(struct graph *bg, cairo_t *cr, struct graph_label *lb,
232 double label_offset, double bar_width,
233 double mindata, double maxdata)
235 struct flist_head *entry;
236 double x1, y1, x2, y2;
238 double domain, range, v;
240 domain = (maxdata - mindata);
241 range = (double) bg->ydim * 0.80; /* FIXME */
243 flist_for_each(entry, &lb->value_list) {
244 struct graph_value *i;
246 i = flist_entry(entry, struct graph_value, list);
248 x1 = label_offset + (double) bar_num * bar_width + (bar_width * 0.05);
249 x2 = x1 + bar_width * 0.90;
250 y2 = bg->ydim * 0.90;
251 v = *(double *) i->value;
252 y1 = y2 - (((v - mindata) / domain) * range);
253 cairo_move_to(cr, x1, y1);
254 cairo_line_to(cr, x1, y2);
255 cairo_line_to(cr, x2, y2);
256 cairo_line_to(cr, x2, y1);
257 cairo_close_path(cr);
264 static void draw_aligned_text(struct graph *g, cairo_t *cr, double x, double y,
265 double fontsize, const char *text, int alignment)
268 #define LEFT_JUSTIFIED 1
269 #define RIGHT_JUSTIFIED 2
271 double factor, direction;
272 cairo_text_extents_t extents;
279 case RIGHT_JUSTIFIED:
289 cairo_select_font_face (cr, g->font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
291 cairo_set_font_size(cr, fontsize);
292 cairo_text_extents(cr, text, &extents);
293 x = x + direction * (factor * extents.width + extents.x_bearing);
294 y = y - (extents.height / 2 + extents.y_bearing);
296 cairo_move_to(cr, x, y);
297 cairo_show_text(cr, text);
300 static inline void draw_centered_text(struct graph *g, cairo_t *cr, double x, double y,
301 double fontsize, const char *text)
303 draw_aligned_text(g, cr, x, y, fontsize, text, CENTERED);
306 static inline void draw_right_justified_text(struct graph *g, cairo_t *cr,
308 double fontsize, const char *text)
310 draw_aligned_text(g, cr, x, y, fontsize, text, RIGHT_JUSTIFIED);
313 static inline void draw_left_justified_text(struct graph *g, cairo_t *cr,
315 double fontsize, const char *text)
317 draw_aligned_text(g, cr, x, y, fontsize, text, LEFT_JUSTIFIED);
320 static void draw_vertical_centered_text(struct graph *g, cairo_t *cr, double x,
321 double y, double fontsize,
325 cairo_text_extents_t extents;
327 cairo_select_font_face(cr, g->font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
329 cairo_set_font_size(cr, fontsize);
330 cairo_text_extents(cr, text, &extents);
333 y = y + (extents.width / 2.0 + extents.x_bearing);
334 x = x - (extents.height / 2.0 + extents.y_bearing);
336 cairo_move_to(cr, x, y);
338 cairo_translate(cr, -sx, -sy);
339 cairo_rotate(cr, -90.0 * M_PI / 180.0);
340 cairo_translate(cr, sx, sy);
341 cairo_show_text(cr, text);
345 static void graph_draw_common(struct graph *g, cairo_t *cr,
346 double *x1, double *y1, double *x2, double *y2)
348 cairo_set_source_rgb(cr, 0, 0, 0);
349 cairo_set_line_width (cr, 0.8);
351 *x1 = 0.10 * g->xdim;
352 *x2 = 0.95 * g->xdim;
353 *y1 = 0.10 * g->ydim;
354 *y2 = 0.90 * g->ydim;
356 cairo_move_to(cr, *x1, *y1);
357 cairo_line_to(cr, *x1, *y2);
358 cairo_line_to(cr, *x2, *y2);
359 cairo_line_to(cr, *x2, *y1);
360 cairo_line_to(cr, *x1, *y1);
363 draw_centered_text(g, cr, g->xdim / 2, g->ydim / 20, 20.0, g->title);
364 draw_centered_text(g, cr, g->xdim / 2, g->ydim * 0.97, 14.0, g->xtitle);
365 draw_vertical_centered_text(g, cr, g->xdim * 0.02, g->ydim / 2, 14.0, g->ytitle);
369 static void graph_draw_x_ticks(struct graph *g, cairo_t *cr,
370 double x1, double y1, double x2, double y2,
371 double minx, double maxx, int nticks, int add_tm_text)
376 static double dash[] = { 1.0, 2.0 };
378 nticks = calc_tickmarks(minx, maxx, nticks, &tm, &power_of_ten,
379 g->x_axis_unit_change_callback == NULL, g->base_offset);
380 if (g->x_axis_unit_change_callback)
381 g->x_axis_unit_change_callback(g, power_of_ten);
383 for (i = 0; i < nticks; i++) {
384 tx = (((tm[i].value) - minx) / (maxx - minx)) * (x2 - x1) + x1;
391 g->xtick_zero_val = tm[0].value;
393 g->xtick_delta = (tm[1].value - tm[0].value) / (tx - g->xtick_zero);
394 g->xtick_one_val = tm[1].value;
397 /* really tx < yx || tx > x2, but protect against rounding */
398 if (x1 - tx > 0.01 || tx - x2 > 0.01)
402 cairo_set_line_width(cr, 0.8);
403 cairo_move_to(cr, tx, y2);
404 cairo_line_to(cr, tx, y2 + (y2 - y1) * 0.03);
407 /* draw grid lines */
409 cairo_set_dash(cr, dash, 2, 2.0);
410 cairo_set_line_width(cr, 0.5);
411 cairo_move_to(cr, tx, y1);
412 cairo_line_to(cr, tx, y2);
419 /* draw tickmark label */
420 draw_centered_text(g, cr, tx, y2 * 1.04, 12.0, tm[i].string);
425 static double graph_draw_y_ticks(struct graph *g, cairo_t *cr,
426 double x1, double y1, double x2, double y2,
427 double miny, double maxy, int nticks, int add_tm_text)
432 static double dash[] = { 2.0, 2.0 };
434 nticks = calc_tickmarks(miny, maxy, nticks, &tm, &power_of_ten,
435 g->y_axis_unit_change_callback == NULL, g->base_offset);
436 if (g->y_axis_unit_change_callback)
437 g->y_axis_unit_change_callback(g, power_of_ten);
440 * Use highest tickmark as top of graph, not highest value. Otherwise
441 * it's impossible to see what the max value is, if the graph is
444 maxy = tm[nticks - 1].value;
446 for (i = 0; i < nticks; i++) {
447 ty = y2 - (((tm[i].value) - miny) / (maxy - miny)) * (y2 - y1);
454 g->ytick_zero_val = tm[0].value;
456 g->ytick_delta = (tm[1].value - tm[0].value) / (ty - g->ytick_zero);
457 g->ytick_one_val = tm[1].value;
460 /* really ty < y1 || ty > y2, but protect against rounding */
461 if (y1 - ty > 0.01 || ty - y2 > 0.01)
465 cairo_move_to(cr, x1, ty);
466 cairo_line_to(cr, x1 - (x2 - x1) * 0.02, ty);
469 /* draw grid lines */
471 cairo_set_dash(cr, dash, 2, 2.0);
472 cairo_set_line_width(cr, 0.5);
473 cairo_move_to(cr, x1, ty);
474 cairo_line_to(cr, x2, ty);
481 /* draw tickmark label */
482 draw_right_justified_text(g, cr, x1 - (x2 - x1) * 0.025, ty, 12.0, tm[i].string);
487 * Return new max to use
492 void bar_graph_draw(struct graph *bg, cairo_t *cr)
494 double x1, y1, x2, y2;
495 double space_per_label, bar_width;
496 double label_offset, mindata, maxdata;
498 struct graph_label *lb;
499 struct flist_head *entry;
502 cairo_translate(cr, bg->xoffset, bg->yoffset);
503 graph_draw_common(bg, cr, &x1, &y1, &x2, &y2);
505 nlabels = count_labels(bg);
506 space_per_label = (x2 - x1) / (double) nlabels;
509 * Start bars at 0 unless we have negative values, otherwise we
510 * present a skewed picture comparing label X and X+1.
512 mindata = find_min_data(bg);
516 maxdata = find_max_data(bg);
518 if (fabs(maxdata - mindata) < 1e-20) {
519 draw_centered_text(bg, cr,
520 x1 + (x2 - x1) / 2.0,
521 y1 + (y2 - y1) / 2.0, 20.0, "No good data");
525 maxdata = graph_draw_y_ticks(bg, cr, x1, y1, x2, y2, mindata, maxdata, 10, 1);
527 flist_for_each(entry, &bg->label_list) {
530 lb = flist_entry(entry, struct graph_label, list);
531 nvalues = count_values(lb);
532 bar_width = (space_per_label - space_per_label * 0.2) / (double) nvalues;
533 label_offset = bg->xdim * 0.1 + space_per_label * (double) i + space_per_label * 0.1;
534 draw_bars(bg, cr, lb, label_offset, bar_width, mindata, maxdata);
535 // draw_centered_text(cr, label_offset + (bar_width / 2.0 + bar_width * 0.1), bg->ydim * 0.93,
536 draw_centered_text(bg, cr, x1 + space_per_label * (i + 0.5), bg->ydim * 0.93,
544 typedef double (*xy_value_extractor)(struct graph_value *v);
546 static double getx(struct graph_value *v)
548 struct xyvalue *xy = v->value;
552 static double gety(struct graph_value *v)
554 struct xyvalue *xy = v->value;
558 static double find_xy_value(struct graph *g, xy_value_extractor getvalue, double_comparator cmp)
560 double tmp, answer = 0.0;
561 struct graph_label *i;
562 struct graph_value *j;
563 struct flist_head *jentry, *entry;
566 flist_for_each(entry, &g->label_list) {
567 i = flist_entry(entry, struct graph_label, list);
569 flist_for_each(jentry, &i->value_list) {
570 j = flist_entry(jentry, struct graph_value, list);
576 answer = cmp(tmp, answer);
583 void line_graph_draw(struct graph *g, cairo_t *cr)
585 double x1, y1, x2, y2;
586 double minx, miny, maxx, maxy, gminx, gminy, gmaxx, gmaxy;
587 double tx, ty, top_extra, bottom_extra, left_extra, right_extra;
588 struct graph_label *i;
589 struct graph_value *j;
590 int good_data = 1, first = 1;
591 struct flist_head *entry, *lentry;
594 cairo_translate(cr, g->xoffset, g->yoffset);
595 graph_draw_common(g, cr, &x1, &y1, &x2, &y2);
597 minx = find_xy_value(g, getx, mindouble);
598 maxx = find_xy_value(g, getx, maxdouble);
599 miny = find_xy_value(g, gety, mindouble);
602 * Start graphs at zero, unless we have a value below. Otherwise
603 * it's hard to visually compare the read and write graph, since
604 * the lowest valued one will be the floor of the graph view.
609 maxy = find_xy_value(g, gety, maxdouble);
611 if (fabs(maxx - minx) < 1e-20 || fabs(maxy - miny) < 1e-20) {
624 if (g->top_extra > 0.001)
625 top_extra = fabs(maxy - miny) * g->top_extra;
626 if (g->bottom_extra > 0.001)
627 bottom_extra = fabs(maxy - miny) * g->bottom_extra;
628 if (g->left_extra > 0.001)
629 left_extra = fabs(maxx - minx) * g->left_extra;
630 if (g->right_extra > 0.001)
631 right_extra = fabs(maxx - minx) * g->right_extra;
633 gminx = minx - left_extra;
634 gmaxx = maxx + right_extra;
635 gminy = miny - bottom_extra;
636 gmaxy = maxy + top_extra;
638 graph_draw_x_ticks(g, cr, x1, y1, x2, y2, gminx, gmaxx, 10, good_data);
639 gmaxy = graph_draw_y_ticks(g, cr, x1, y1, x2, y2, gminy, gmaxy, 10, good_data);
644 cairo_set_line_width(cr, 1.5);
645 flist_for_each(lentry, &g->label_list) {
646 i = flist_entry(lentry, struct graph_label, list);
648 if (i->hide || i->r < 0) /* invisible data */
651 cairo_set_source_rgb(cr, i->r, i->g, i->b);
652 flist_for_each(entry, &i->value_list) {
653 j = flist_entry(entry, struct graph_value, list);
654 tx = ((getx(j) - gminx) / (gmaxx - gminx)) * (x2 - x1) + x1;
655 ty = y2 - ((gety(j) - gminy) / (gmaxy - gminy)) * (y2 - y1);
657 cairo_move_to(cr, tx, ty);
660 cairo_line_to(cr, tx, ty);
670 static void setstring(char **str, const char *value)
673 *str = strdup(value);
676 void graph_title(struct graph *bg, const char *title)
678 setstring(&bg->title, title);
681 void graph_x_title(struct graph *bg, const char *title)
683 setstring(&bg->xtitle, title);
686 void graph_y_title(struct graph *bg, const char *title)
688 setstring(&bg->ytitle, title);
691 static struct graph_label *graph_find_label(struct graph *bg,
694 struct flist_head *entry;
695 struct graph_label *i;
697 flist_for_each(entry, &bg->label_list) {
698 i = flist_entry(entry, struct graph_label, list);
700 if (strcmp(label, i->label) == 0)
707 graph_label_t graph_add_label(struct graph *bg, const char *label)
709 struct graph_label *i;
711 i = graph_find_label(bg, label);
713 return i; /* already present. */
714 i = calloc(1, sizeof(*i));
715 INIT_FLIST_HEAD(&i->value_list);
717 setstring(&i->label, label);
718 flist_add_tail(&i->list, &bg->label_list);
719 INIT_PRIO_TREE_ROOT(&i->prio_tree);
723 static void __graph_value_drop(struct graph_label *l, struct graph_value *v)
725 flist_del_init(&v->list);
733 static void graph_value_drop(struct graph_label *l, struct graph_value *v)
735 if (v->flags & GV_F_PRIO_SKIP) {
736 __graph_value_drop(l, v);
741 * Find head, the guy that's on the prio tree
743 while (!(v->flags & GV_F_ON_PRIO)) {
744 assert(!flist_empty(&v->alias));
745 v = flist_entry(v->alias.next, struct graph_value, alias);
748 prio_tree_remove(&l->prio_tree, &v->node);
753 while (!flist_empty(&v->alias)) {
754 struct graph_value *a;
756 a = flist_entry(v->alias.next, struct graph_value, alias);
757 flist_del_init(&a->alias);
759 __graph_value_drop(l, a);
762 __graph_value_drop(l, v);
765 static void graph_label_add_value(struct graph_label *i, void *value,
768 struct graph *g = i->parent;
769 struct graph_value *x;
771 x = malloc(sizeof(*x));
772 memset(x, 0, sizeof(*x));
773 INIT_FLIST_HEAD(&x->alias);
774 INIT_FLIST_HEAD(&x->list);
775 flist_add_tail(&x->list, &i->value_list);
780 double xval = getx(x);
781 double minx = xval - (g->xtick_one_val * TOOLTIP_DELTA);
782 double maxx = xval + (g->xtick_one_val * TOOLTIP_DELTA);
783 struct prio_tree_node *ret;
786 * use msec to avoid dropping too much precision when
787 * storing as an integer.
789 minx = minx * 1000.0;
790 maxx = maxx * 1000.0;
792 INIT_PRIO_TREE_NODE(&x->node);
793 x->node.start = minx;
795 x->tooltip = strdup(tooltip);
796 if (x->node.last == x->node.start) {
797 x->node.last += fabs(g->xtick_delta);
798 if (x->node.last == x->node.start)
803 * If ret != &x->node, we have an alias. Since the values
804 * should be identical, we can drop it
806 ret = prio_tree_insert(&i->prio_tree, &x->node);
807 if (ret != &x->node) {
808 struct graph_value *alias;
810 alias = container_of(ret, struct graph_value, node);
811 flist_add_tail(&x->alias, &alias->alias);
813 x->flags = GV_F_ON_PRIO;
815 x->flags = GV_F_PRIO_SKIP;
817 if (g->per_label_limit != -1 &&
818 i->value_count > g->per_label_limit) {
822 * If the limit was dynamically reduced, making us more
823 * than 1 entry ahead after adding this one, drop two
824 * entries. This will make us (eventually) reach the
827 if (i->value_count - g->per_label_limit >= 2)
830 while (to_drop-- && !flist_empty(&i->value_list)) {
831 x = flist_entry(i->value_list.next, struct graph_value, list);
832 graph_value_drop(i, x);
835 * If we have aliases, we could drop > 1 above.
837 if (i->value_count <= g->per_label_limit)
843 int graph_add_data(struct graph *bg, graph_label_t label, const double value)
845 struct graph_label *i = label;
848 d = malloc(sizeof(*d));
851 graph_label_add_value(i, d, NULL);
855 static int graph_nonzero_y(struct graph_label *l)
857 struct flist_head *entry;
859 flist_for_each(entry, &l->value_list) {
860 struct graph_value *v;
862 v = flist_entry(entry, struct graph_value, list);
870 int graph_add_xy_data(struct graph *bg, graph_label_t label,
871 const double x, const double y, const char *tooltip)
873 struct graph_label *i = label;
876 if (bg->dont_graph_all_zeroes && y == 0.0 && !graph_nonzero_y(i))
881 xy = malloc(sizeof(*xy));
885 graph_label_add_value(i, xy, tooltip);
889 static void graph_free_values(struct graph_label *l)
891 struct graph_value *i;
893 while (!flist_empty(&l->value_list)) {
894 i = flist_entry(l->value_list.next, struct graph_value, list);
895 graph_value_drop(l, i);
899 static void graph_free_labels(struct graph *g)
901 struct graph_label *i;
903 while (!flist_empty(&g->label_list)) {
904 i = flist_entry(g->label_list.next, struct graph_label, list);
906 graph_free_values(i);
911 void graph_set_color(struct graph *gr, graph_label_t label, double red,
912 double green, double blue)
914 struct graph_label *i = label;
917 if (red < 0.0) { /* invisible color */
939 void graph_free(struct graph *bg)
944 graph_free_labels(bg);
947 /* For each line in the line graph, up to per_label_limit segments may
948 * be added. After that, adding more data to the end of the line
949 * causes data to drop off of the front of the line.
951 void line_graph_set_data_count_limit(struct graph *g, int per_label_limit)
953 g->per_label_limit = per_label_limit;
956 void graph_add_extra_space(struct graph *g, double left_percent, double right_percent,
957 double top_percent, double bottom_percent)
959 g->left_extra = left_percent;
960 g->right_extra = right_percent;
961 g->top_extra = top_percent;
962 g->bottom_extra = bottom_percent;
966 * Normally values are logged in a base unit of 0, but for other purposes
967 * it makes more sense to log in higher unit. For instance for bandwidth
968 * purposes, you may want to log in KB/sec (or MB/sec) rather than bytes/sec.
970 void graph_set_base_offset(struct graph *g, unsigned int base_offset)
972 g->base_offset = base_offset;
975 int graph_has_tooltips(struct graph *g)
977 struct flist_head *entry;
978 struct graph_label *i;
980 flist_for_each(entry, &g->label_list) {
981 i = flist_entry(entry, struct graph_label, list);
983 if (!prio_tree_empty(&i->prio_tree))
990 int graph_contains_xy(struct graph *g, int x, int y)
992 int first_x = g->xoffset;
993 int last_x = g->xoffset + g->xdim;
994 int first_y = g->yoffset;
995 int last_y = g->yoffset + g->ydim;
997 return (x >= first_x && x <= last_x) && (y >= first_y && y <= last_y);
1000 const char *graph_find_tooltip(struct graph *g, int ix, int iy)
1002 double x = ix, y = iy;
1003 struct prio_tree_iter iter;
1004 struct prio_tree_node *n;
1005 struct graph_value *best = NULL;
1006 struct flist_head *entry;
1013 x = g->xtick_zero_val + ((x - g->xtick_zero) * g->xtick_delta);
1014 y = g->ytick_zero_val + ((y - g->ytick_zero) * g->ytick_delta);
1017 maxy = y + (g->ytick_one_val * TOOLTIP_DELTA);
1018 miny = y - (g->ytick_one_val * TOOLTIP_DELTA);
1019 best_delta = UINT_MAX;
1020 flist_for_each(entry, &g->label_list) {
1021 struct graph_label *i;
1023 i = flist_entry(entry, struct graph_label, list);
1027 INIT_PRIO_TREE_ITER(&iter);
1028 prio_tree_iter_init(&iter, &i->prio_tree, x, x);
1030 n = prio_tree_next(&iter);
1035 struct graph_value *v, *rootv;
1038 v = container_of(n, struct graph_value, node);
1042 ydiff = fabs(yval - y);
1045 * zero delta, or within or match critera, break
1047 if (ydiff < best_delta) {
1050 (yval >= miny && yval <= maxy)) {
1055 if (!flist_empty(&v->alias))
1056 v = flist_entry(v->alias.next, struct graph_value, alias);
1057 } while (v != rootv);
1058 } while ((n = prio_tree_next(&iter)) != NULL);
1061 * If we got matches in one label, don't check others.
1068 return best->tooltip;
1073 void graph_set_graph_all_zeroes(struct graph *g, unsigned int set)
1075 g->dont_graph_all_zeroes = !set;