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
51 struct flist_head list;
52 struct prio_tree_node node;
53 struct flist_head alias;
60 struct flist_head list;
62 struct flist_head value_list;
63 struct prio_tree_root prio_tree;
79 unsigned int xdim, ydim;
80 double xoffset, yoffset;
81 struct flist_head label_list;
84 graph_axis_unit_change_callback x_axis_unit_change_callback;
85 graph_axis_unit_change_callback y_axis_unit_change_callback;
86 unsigned int base_offset;
87 unsigned int dont_graph_all_zeroes;
95 double xtick_zero_val;
99 double ytick_zero_val;
100 double ytick_one_val;
103 void graph_set_size(struct graph *g, unsigned int xdim, unsigned int ydim)
109 void graph_set_position(struct graph *g, double xoffset, double yoffset)
111 g->xoffset = xoffset;
112 g->yoffset = yoffset;
115 struct graph *graph_new(unsigned int xdim, unsigned int ydim, const char *font)
119 g = calloc(1, sizeof(*g));
120 INIT_FLIST_HEAD(&g->label_list);
121 graph_set_size(g, xdim, ydim);
122 g->per_label_limit = -1;
129 void graph_x_axis_unit_change_notify(struct graph *g, graph_axis_unit_change_callback f)
131 g->x_axis_unit_change_callback = f;
134 void graph_y_axis_unit_change_notify(struct graph *g, graph_axis_unit_change_callback f)
136 g->y_axis_unit_change_callback = f;
139 static int count_labels(struct graph *g)
141 struct flist_head *entry;
144 flist_for_each(entry, &g->label_list)
150 static int count_values(struct graph_label *l)
152 struct flist_head *entry;
155 flist_for_each(entry, &l->value_list)
161 typedef double (*double_comparator)(double a, double b);
163 static double mindouble(double a, double b)
165 return a < b ? a : b;
168 static double maxdouble(double a, double b)
170 return a < b ? b : a;
173 static double find_double_values(struct graph_label *l, double_comparator cmp)
175 struct flist_head *entry;
179 if (flist_empty(&l->value_list))
182 flist_for_each(entry, &l->value_list) {
183 struct graph_value *i;
185 i = flist_entry(entry, struct graph_value, list);
186 tmp = *(double *) i->value;
191 answer = cmp(answer, tmp);
197 static double find_double_data(struct graph *g, double_comparator cmp)
199 struct flist_head *entry;
200 struct graph_label *i;
204 if (flist_empty(&g->label_list))
207 flist_for_each(entry, &g->label_list) {
208 i = flist_entry(entry, struct graph_label, list);
209 tmp = find_double_values(i, cmp);
214 answer = cmp(tmp, answer);
220 static double find_min_data(struct graph *g)
222 return find_double_data(g, mindouble);
225 static double find_max_data(struct graph *g)
227 return find_double_data(g, maxdouble);
230 static void draw_bars(struct graph *bg, cairo_t *cr, struct graph_label *lb,
231 double label_offset, double bar_width,
232 double mindata, double maxdata)
234 struct flist_head *entry;
235 double x1, y1, x2, y2;
237 double domain, range, v;
239 domain = (maxdata - mindata);
240 range = (double) bg->ydim * 0.80; /* FIXME */
242 flist_for_each(entry, &lb->value_list) {
243 struct graph_value *i;
245 i = flist_entry(entry, struct graph_value, list);
247 x1 = label_offset + (double) bar_num * bar_width + (bar_width * 0.05);
248 x2 = x1 + bar_width * 0.90;
249 y2 = bg->ydim * 0.90;
250 v = *(double *) i->value;
251 y1 = y2 - (((v - mindata) / domain) * range);
252 cairo_move_to(cr, x1, y1);
253 cairo_line_to(cr, x1, y2);
254 cairo_line_to(cr, x2, y2);
255 cairo_line_to(cr, x2, y1);
256 cairo_close_path(cr);
263 static void draw_aligned_text(struct graph *g, cairo_t *cr, double x, double y,
264 double fontsize, const char *text, int alignment)
267 #define LEFT_JUSTIFIED 1
268 #define RIGHT_JUSTIFIED 2
270 double factor, direction;
271 cairo_text_extents_t extents;
278 case RIGHT_JUSTIFIED:
288 cairo_select_font_face (cr, g->font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
290 cairo_set_font_size(cr, fontsize);
291 cairo_text_extents(cr, text, &extents);
292 x = x + direction * (factor * extents.width + extents.x_bearing);
293 y = y - (extents.height / 2 + extents.y_bearing);
295 cairo_move_to(cr, x, y);
296 cairo_show_text(cr, text);
299 static inline void draw_centered_text(struct graph *g, cairo_t *cr, double x, double y,
300 double fontsize, const char *text)
302 draw_aligned_text(g, cr, x, y, fontsize, text, CENTERED);
305 static inline void draw_right_justified_text(struct graph *g, cairo_t *cr,
307 double fontsize, const char *text)
309 draw_aligned_text(g, cr, x, y, fontsize, text, RIGHT_JUSTIFIED);
312 static inline void draw_left_justified_text(struct graph *g, cairo_t *cr,
314 double fontsize, const char *text)
316 draw_aligned_text(g, cr, x, y, fontsize, text, LEFT_JUSTIFIED);
319 static void draw_vertical_centered_text(struct graph *g, cairo_t *cr, double x,
320 double y, double fontsize,
324 cairo_text_extents_t extents;
326 cairo_select_font_face(cr, g->font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
328 cairo_set_font_size(cr, fontsize);
329 cairo_text_extents(cr, text, &extents);
332 y = y + (extents.width / 2.0 + extents.x_bearing);
333 x = x - (extents.height / 2.0 + extents.y_bearing);
335 cairo_move_to(cr, x, y);
337 cairo_translate(cr, -sx, -sy);
338 cairo_rotate(cr, -90.0 * M_PI / 180.0);
339 cairo_translate(cr, sx, sy);
340 cairo_show_text(cr, text);
344 static void graph_draw_common(struct graph *g, cairo_t *cr,
345 double *x1, double *y1, double *x2, double *y2)
347 cairo_set_source_rgb(cr, 0, 0, 0);
348 cairo_set_line_width (cr, 0.8);
350 *x1 = 0.10 * g->xdim;
351 *x2 = 0.95 * g->xdim;
352 *y1 = 0.10 * g->ydim;
353 *y2 = 0.90 * g->ydim;
355 cairo_move_to(cr, *x1, *y1);
356 cairo_line_to(cr, *x1, *y2);
357 cairo_line_to(cr, *x2, *y2);
358 cairo_line_to(cr, *x2, *y1);
359 cairo_line_to(cr, *x1, *y1);
362 draw_centered_text(g, cr, g->xdim / 2, g->ydim / 20, 20.0, g->title);
363 draw_centered_text(g, cr, g->xdim / 2, g->ydim * 0.97, 14.0, g->xtitle);
364 draw_vertical_centered_text(g, cr, g->xdim * 0.02, g->ydim / 2, 14.0, g->ytitle);
368 static void graph_draw_x_ticks(struct graph *g, cairo_t *cr,
369 double x1, double y1, double x2, double y2,
370 double minx, double maxx, int nticks, int add_tm_text)
375 static double dash[] = { 1.0, 2.0 };
377 nticks = calc_tickmarks(minx, maxx, nticks, &tm, &power_of_ten,
378 g->x_axis_unit_change_callback == NULL, g->base_offset);
379 if (g->x_axis_unit_change_callback)
380 g->x_axis_unit_change_callback(g, power_of_ten);
382 for (i = 0; i < nticks; i++) {
383 tx = (((tm[i].value) - minx) / (maxx - minx)) * (x2 - x1) + x1;
390 g->xtick_zero_val = tm[0].value;
392 g->xtick_delta = (tm[1].value - tm[0].value) / (tx - g->xtick_zero);
393 g->xtick_one_val = tm[1].value;
396 /* really tx < yx || tx > x2, but protect against rounding */
397 if (x1 - tx > 0.01 || tx - x2 > 0.01)
401 cairo_set_line_width(cr, 0.8);
402 cairo_move_to(cr, tx, y2);
403 cairo_line_to(cr, tx, y2 + (y2 - y1) * 0.03);
406 /* draw grid lines */
408 cairo_set_dash(cr, dash, 2, 2.0);
409 cairo_set_line_width(cr, 0.5);
410 cairo_move_to(cr, tx, y1);
411 cairo_line_to(cr, tx, y2);
418 /* draw tickmark label */
419 draw_centered_text(g, cr, tx, y2 * 1.04, 12.0, tm[i].string);
424 static double graph_draw_y_ticks(struct graph *g, cairo_t *cr,
425 double x1, double y1, double x2, double y2,
426 double miny, double maxy, int nticks, int add_tm_text)
431 static double dash[] = { 2.0, 2.0 };
433 nticks = calc_tickmarks(miny, maxy, nticks, &tm, &power_of_ten,
434 g->y_axis_unit_change_callback == NULL, g->base_offset);
435 if (g->y_axis_unit_change_callback)
436 g->y_axis_unit_change_callback(g, power_of_ten);
439 * Use highest tickmark as top of graph, not highest value. Otherwise
440 * it's impossible to see what the max value is, if the graph is
443 maxy = tm[nticks - 1].value;
445 for (i = 0; i < nticks; i++) {
446 ty = y2 - (((tm[i].value) - miny) / (maxy - miny)) * (y2 - y1);
453 g->ytick_zero_val = tm[0].value;
455 g->ytick_delta = (tm[1].value - tm[0].value) / (ty - g->ytick_zero);
456 g->ytick_one_val = tm[1].value;
459 /* really ty < y1 || ty > y2, but protect against rounding */
460 if (y1 - ty > 0.01 || ty - y2 > 0.01)
464 cairo_move_to(cr, x1, ty);
465 cairo_line_to(cr, x1 - (x2 - x1) * 0.02, ty);
468 /* draw grid lines */
470 cairo_set_dash(cr, dash, 2, 2.0);
471 cairo_set_line_width(cr, 0.5);
472 cairo_move_to(cr, x1, ty);
473 cairo_line_to(cr, x2, ty);
480 /* draw tickmark label */
481 draw_right_justified_text(g, cr, x1 - (x2 - x1) * 0.025, ty, 12.0, tm[i].string);
486 * Return new max to use
491 void bar_graph_draw(struct graph *bg, cairo_t *cr)
493 double x1, y1, x2, y2;
494 double space_per_label, bar_width;
495 double label_offset, mindata, maxdata;
497 struct graph_label *lb;
498 struct flist_head *entry;
501 cairo_translate(cr, bg->xoffset, bg->yoffset);
502 graph_draw_common(bg, cr, &x1, &y1, &x2, &y2);
504 nlabels = count_labels(bg);
505 space_per_label = (x2 - x1) / (double) nlabels;
508 * Start bars at 0 unless we have negative values, otherwise we
509 * present a skewed picture comparing label X and X+1.
511 mindata = find_min_data(bg);
515 maxdata = find_max_data(bg);
517 if (fabs(maxdata - mindata) < 1e-20) {
518 draw_centered_text(bg, cr,
519 x1 + (x2 - x1) / 2.0,
520 y1 + (y2 - y1) / 2.0, 20.0, "No good data");
524 maxdata = graph_draw_y_ticks(bg, cr, x1, y1, x2, y2, mindata, maxdata, 10, 1);
526 flist_for_each(entry, &bg->label_list) {
529 lb = flist_entry(entry, struct graph_label, list);
530 nvalues = count_values(lb);
531 bar_width = (space_per_label - space_per_label * 0.2) / (double) nvalues;
532 label_offset = bg->xdim * 0.1 + space_per_label * (double) i + space_per_label * 0.1;
533 draw_bars(bg, cr, lb, label_offset, bar_width, mindata, maxdata);
534 // draw_centered_text(cr, label_offset + (bar_width / 2.0 + bar_width * 0.1), bg->ydim * 0.93,
535 draw_centered_text(bg, cr, x1 + space_per_label * (i + 0.5), bg->ydim * 0.93,
543 typedef double (*xy_value_extractor)(struct graph_value *v);
545 static double getx(struct graph_value *v)
547 struct xyvalue *xy = v->value;
551 static double gety(struct graph_value *v)
553 struct xyvalue *xy = v->value;
557 static double find_xy_value(struct graph *g, xy_value_extractor getvalue, double_comparator cmp)
559 double tmp, answer = 0.0;
560 struct graph_label *i;
561 struct graph_value *j;
562 struct flist_head *jentry, *entry;
565 flist_for_each(entry, &g->label_list) {
566 i = flist_entry(entry, struct graph_label, list);
568 flist_for_each(jentry, &i->value_list) {
569 j = flist_entry(jentry, struct graph_value, list);
575 answer = cmp(tmp, answer);
582 void line_graph_draw(struct graph *g, cairo_t *cr)
584 double x1, y1, x2, y2;
585 double minx, miny, maxx, maxy, gminx, gminy, gmaxx, gmaxy;
586 double tx, ty, top_extra, bottom_extra, left_extra, right_extra;
587 struct graph_label *i;
588 struct graph_value *j;
589 int good_data = 1, first = 1;
590 struct flist_head *entry, *lentry;
593 cairo_translate(cr, g->xoffset, g->yoffset);
594 graph_draw_common(g, cr, &x1, &y1, &x2, &y2);
596 minx = find_xy_value(g, getx, mindouble);
597 maxx = find_xy_value(g, getx, maxdouble);
598 miny = find_xy_value(g, gety, mindouble);
601 * Start graphs at zero, unless we have a value below. Otherwise
602 * it's hard to visually compare the read and write graph, since
603 * the lowest valued one will be the floor of the graph view.
608 maxy = find_xy_value(g, gety, maxdouble);
610 if (fabs(maxx - minx) < 1e-20 || fabs(maxy - miny) < 1e-20) {
623 if (g->top_extra > 0.001)
624 top_extra = fabs(maxy - miny) * g->top_extra;
625 if (g->bottom_extra > 0.001)
626 bottom_extra = fabs(maxy - miny) * g->bottom_extra;
627 if (g->left_extra > 0.001)
628 left_extra = fabs(maxx - minx) * g->left_extra;
629 if (g->right_extra > 0.001)
630 right_extra = fabs(maxx - minx) * g->right_extra;
632 gminx = minx - left_extra;
633 gmaxx = maxx + right_extra;
634 gminy = miny - bottom_extra;
635 gmaxy = maxy + top_extra;
637 graph_draw_x_ticks(g, cr, x1, y1, x2, y2, gminx, gmaxx, 10, good_data);
638 gmaxy = graph_draw_y_ticks(g, cr, x1, y1, x2, y2, gminy, gmaxy, 10, good_data);
643 cairo_set_line_width(cr, 1.5);
644 flist_for_each(lentry, &g->label_list) {
645 i = flist_entry(lentry, struct graph_label, list);
647 if (i->hide || i->r < 0) /* invisible data */
650 cairo_set_source_rgb(cr, i->r, i->g, i->b);
651 flist_for_each(entry, &i->value_list) {
652 j = flist_entry(entry, struct graph_value, list);
653 tx = ((getx(j) - gminx) / (gmaxx - gminx)) * (x2 - x1) + x1;
654 ty = y2 - ((gety(j) - gminy) / (gmaxy - gminy)) * (y2 - y1);
656 cairo_move_to(cr, tx, ty);
659 cairo_line_to(cr, tx, ty);
669 static void setstring(char **str, const char *value)
672 *str = strdup(value);
675 void graph_title(struct graph *bg, const char *title)
677 setstring(&bg->title, title);
680 void graph_x_title(struct graph *bg, const char *title)
682 setstring(&bg->xtitle, title);
685 void graph_y_title(struct graph *bg, const char *title)
687 setstring(&bg->ytitle, title);
690 static struct graph_label *graph_find_label(struct graph *bg,
693 struct flist_head *entry;
694 struct graph_label *i;
696 flist_for_each(entry, &bg->label_list) {
697 i = flist_entry(entry, struct graph_label, list);
699 if (strcmp(label, i->label) == 0)
706 void graph_add_label(struct graph *bg, const char *label)
708 struct graph_label *i;
710 i = graph_find_label(bg, label);
712 return; /* already present. */
713 i = calloc(1, sizeof(*i));
714 INIT_FLIST_HEAD(&i->value_list);
716 setstring(&i->label, label);
717 flist_add_tail(&i->list, &bg->label_list);
718 INIT_PRIO_TREE_ROOT(&i->prio_tree);
721 static void __graph_value_drop(struct graph_label *l, struct graph_value *v)
723 flist_del_init(&v->list);
731 static void graph_value_drop(struct graph_label *l, struct graph_value *v)
734 * Find head, the guy that's on the prio tree
736 while (!(v->flags & GV_F_ON_PRIO)) {
737 assert(!flist_empty(&v->alias));
738 v = flist_entry(v->alias.next, struct graph_value, alias);
741 prio_tree_remove(&l->prio_tree, &v->node);
746 while (!flist_empty(&v->alias)) {
747 struct graph_value *a;
749 a = flist_entry(v->alias.next, struct graph_value, alias);
750 flist_del_init(&a->alias);
752 __graph_value_drop(l, a);
755 __graph_value_drop(l, v);
758 static void graph_label_add_value(struct graph_label *i, void *value,
761 struct graph *g = i->parent;
762 struct graph_value *x;
764 x = malloc(sizeof(*x));
765 memset(x, 0, sizeof(*x));
766 INIT_FLIST_HEAD(&x->alias);
767 INIT_FLIST_HEAD(&x->list);
768 flist_add_tail(&x->list, &i->value_list);
773 double xval = getx(x);
774 double minx = xval - (g->xtick_one_val * TOOLTIP_DELTA);
775 double maxx = xval + (g->xtick_one_val * TOOLTIP_DELTA);
776 struct prio_tree_node *ret;
779 * use msec to avoid dropping too much precision when
780 * storing as an integer.
782 minx = minx * 1000.0;
783 maxx = maxx * 1000.0;
785 INIT_PRIO_TREE_NODE(&x->node);
786 x->node.start = minx;
788 x->tooltip = strdup(tooltip);
789 if (x->node.last == x->node.start) {
790 x->node.last += fabs(g->xtick_delta);
791 if (x->node.last == x->node.start)
796 * If ret != &x->node, we have an alias. Since the values
797 * should be identical, we can drop it
799 ret = prio_tree_insert(&i->prio_tree, &x->node);
800 if (ret != &x->node) {
801 struct graph_value *alias;
803 alias = container_of(ret, struct graph_value, node);
804 flist_add_tail(&x->alias, &alias->alias);
806 x->flags = GV_F_ON_PRIO;
809 if (g->per_label_limit != -1 &&
810 i->value_count > g->per_label_limit) {
814 * If the limit was dynamically reduced, making us more
815 * than 1 entry ahead after adding this one, drop two
816 * entries. This will make us (eventually) reach the
819 if (i->value_count - g->per_label_limit >= 2)
822 while (to_drop-- && !flist_empty(&i->value_list)) {
823 x = flist_entry(i->value_list.next, struct graph_value, list);
824 graph_value_drop(i, x);
827 * If we have aliases, we could drop > 1 above.
829 if (i->value_count <= g->per_label_limit)
835 int graph_add_data(struct graph *bg, const char *label, const double value)
837 struct graph_label *i;
840 d = malloc(sizeof(*d));
843 i = graph_find_label(bg, label);
846 graph_label_add_value(i, d, NULL);
850 static int graph_nonzero_y(struct graph_label *l)
852 struct flist_head *entry;
854 flist_for_each(entry, &l->value_list) {
855 struct graph_value *v;
857 v = flist_entry(entry, struct graph_value, list);
865 int graph_add_xy_data(struct graph *bg, const char *label,
866 const double x, const double y, const char *tooltip)
868 struct graph_label *i;
871 i = graph_find_label(bg, label);
875 if (bg->dont_graph_all_zeroes && y == 0.0 && !graph_nonzero_y(i))
880 xy = malloc(sizeof(*xy));
884 graph_label_add_value(i, xy, tooltip);
888 static void graph_free_values(struct graph_label *l)
890 struct graph_value *i;
892 while (!flist_empty(&l->value_list)) {
893 i = flist_entry(l->value_list.next, struct graph_value, list);
894 graph_value_drop(l, i);
898 static void graph_free_labels(struct graph *g)
900 struct graph_label *i;
902 while (!flist_empty(&g->label_list)) {
903 i = flist_entry(g->label_list.next, struct graph_label, list);
905 graph_free_values(i);
910 void graph_set_color(struct graph *gr, const char *label,
911 double red, double green, double blue)
913 struct flist_head *entry;
914 struct graph_label *i;
917 if (red < 0.0) { /* invisible color */
934 flist_for_each(entry, &gr->label_list) {
935 i = flist_entry(entry, struct graph_label, list);
937 if (strcmp(i->label, label) == 0) {
946 void graph_free(struct graph *bg)
951 graph_free_labels(bg);
954 /* For each line in the line graph, up to per_label_limit segments may
955 * be added. After that, adding more data to the end of the line
956 * causes data to drop off of the front of the line.
958 void line_graph_set_data_count_limit(struct graph *g, int per_label_limit)
960 g->per_label_limit = per_label_limit;
963 void graph_add_extra_space(struct graph *g, double left_percent, double right_percent,
964 double top_percent, double bottom_percent)
966 g->left_extra = left_percent;
967 g->right_extra = right_percent;
968 g->top_extra = top_percent;
969 g->bottom_extra = bottom_percent;
973 * Normally values are logged in a base unit of 0, but for other purposes
974 * it makes more sense to log in higher unit. For instance for bandwidth
975 * purposes, you may want to log in KB/sec (or MB/sec) rather than bytes/sec.
977 void graph_set_base_offset(struct graph *g, unsigned int base_offset)
979 g->base_offset = base_offset;
982 int graph_has_tooltips(struct graph *g)
984 struct flist_head *entry;
985 struct graph_label *i;
987 flist_for_each(entry, &g->label_list) {
988 i = flist_entry(entry, struct graph_label, list);
990 if (!prio_tree_empty(&i->prio_tree))
997 int graph_contains_xy(struct graph *g, int x, int y)
999 int first_x = g->xoffset;
1000 int last_x = g->xoffset + g->xdim;
1001 int first_y = g->yoffset;
1002 int last_y = g->yoffset + g->ydim;
1004 return (x >= first_x && x <= last_x) && (y >= first_y && y <= last_y);
1007 const char *graph_find_tooltip(struct graph *g, int ix, int iy)
1009 double x = ix, y = iy;
1010 struct prio_tree_iter iter;
1011 struct prio_tree_node *n;
1012 struct graph_value *best = NULL;
1013 struct flist_head *entry;
1020 x = g->xtick_zero_val + ((x - g->xtick_zero) * g->xtick_delta);
1021 y = g->ytick_zero_val + ((y - g->ytick_zero) * g->ytick_delta);
1024 maxy = y + (g->ytick_one_val * TOOLTIP_DELTA);
1025 miny = y - (g->ytick_one_val * TOOLTIP_DELTA);
1026 best_delta = UINT_MAX;
1027 flist_for_each(entry, &g->label_list) {
1028 struct graph_label *i;
1030 i = flist_entry(entry, struct graph_label, list);
1034 INIT_PRIO_TREE_ITER(&iter);
1035 prio_tree_iter_init(&iter, &i->prio_tree, x, x);
1037 n = prio_tree_next(&iter);
1042 struct graph_value *v, *rootv;
1045 v = container_of(n, struct graph_value, node);
1049 ydiff = fabs(yval - y);
1052 * zero delta, or within or match critera, break
1054 if (ydiff < best_delta) {
1057 (yval >= miny && yval <= maxy)) {
1062 if (!flist_empty(&v->alias))
1063 v = flist_entry(v->alias.next, struct graph_value, alias);
1064 } while (v != rootv);
1065 } while ((n = prio_tree_next(&iter)) != NULL);
1068 * If we got matches in one label, don't check others.
1075 return best->tooltip;
1080 void graph_set_graph_all_zeroes(struct graph *g, unsigned int set)
1082 g->dont_graph_all_zeroes = !set;