| 595 | } |
| 596 | |
| 597 | static inline int prom_push_stat(stat_var *stat, str *page, int max_len, |
| 598 | struct list_head *groups, struct list_head *label_groups) |
| 599 | { |
| 600 | int s, skip_type = 0; |
| 601 | group_stats *grp = NULL; |
| 602 | |
| 603 | /* first, check if the stat is part of a stats group */ |
| 604 | if ((stat->flags & STAT_HAS_GROUP) && (grp = get_stat_group(stat)) != NULL) { |
| 605 | /* if the group was already dumped, we don't need to do anything |
| 606 | * since the variable has already been printed */ |
| 607 | if (prom_groups_exists(groups, grp)) |
| 608 | return 0; |
| 609 | /* print all stats in the group - the first one prints the type */ |
| 610 | for (s = 0; s < grp->no; s++) |
| 611 | if (prom_print_stat(grp->vars[s], |
| 612 | &grp->name, NULL, page, max_len, &skip_type) < 0) |
| 613 | return -1; |
| 614 | prom_groups_add(groups, grp); /* add the group, to make sure |
| 615 | vars are not double printed */ |
| 616 | return 0; |
| 617 | } else if (prom_push_stat_labels(stat, label_groups) < 0) { |
| 618 | return prom_print_stat(stat, &stat->name, NULL, page, max_len, 0); |
| 619 | } else { |
| 620 | return 0; |
| 621 | } |
| 622 | } |
| 623 | |
| 624 | #define PROM_PUSH_STAT(_s, _m) \ |
| 625 | do { \ |
nothing calls this directly
no test coverage detected