Lines Matching +full:depth +full:-
1 // SPDX-License-Identifier: GPL-2.0
18 #include "../../util/block-info.h"
33 static size_t ipchain__fprintf_graph_line(FILE *fp, int depth, int depth_mask, in ipchain__fprintf_graph_line() argument
39 for (i = 0; i < depth; i++) in ipchain__fprintf_graph_line()
52 int depth, int depth_mask, int period, in ipchain__fprintf_graph() argument
62 for (i = 0; i < depth; i++) { in ipchain__fprintf_graph()
67 if (!period && i == depth - 1) { in ipchain__fprintf_graph()
68 ret += fprintf(fp, "--"); in ipchain__fprintf_graph()
70 ret += fprintf(fp, "--"); in ipchain__fprintf_graph()
105 strcpy(rem_sq_bracket->name, "[...]"); in init_rem_hits()
110 u64 total_samples, int depth, in __callchain__fprintf_graph() argument
132 remaining -= cumul; in __callchain__fprintf_graph()
136 * The depth mask manages the output of pipes that show in __callchain__fprintf_graph()
137 * the depth. We don't want to keep the pipes of the current in __callchain__fprintf_graph()
138 * level for the last child of this depth. in __callchain__fprintf_graph()
144 new_depth_mask &= ~(1 << (depth - 1)); in __callchain__fprintf_graph()
147 * But we keep the older depth mask for the line separator in __callchain__fprintf_graph()
150 ret += ipchain__fprintf_graph_line(fp, depth, depth_mask, in __callchain__fprintf_graph()
153 list_for_each_entry(chain, &child->val, list) { in __callchain__fprintf_graph()
154 ret += ipchain__fprintf_graph(fp, child, chain, depth, in __callchain__fprintf_graph()
161 new_total = child->children_hit; in __callchain__fprintf_graph()
165 ret += __callchain__fprintf_graph(fp, &child->rb_root, new_total, in __callchain__fprintf_graph()
166 depth + 1, in __callchain__fprintf_graph()
167 new_depth_mask | (1 << depth), in __callchain__fprintf_graph()
183 if (callchain_param.value == CCVAL_COUNT && child && child->parent) { in __callchain__fprintf_graph()
184 rem_node.count = child->parent->children_count - cumul_count; in __callchain__fprintf_graph()
189 new_depth_mask &= ~(1 << (depth - 1)); in __callchain__fprintf_graph()
190 ret += ipchain__fprintf_graph(fp, &rem_node, &rem_hits, depth, in __callchain__fprintf_graph()
203 * However when percent-limit applied, it's possible that single callchain
204 * node have different (non-100% in fractal mode) percentage.
233 list_for_each_entry(chain, &cnode->val, list) { in callchain__fprintf_graph()
247 ret += fprintf(fp, "---"); in callchain__fprintf_graph()
266 root = &cnode->rb_root; in callchain__fprintf_graph()
292 ret += __callchain__fprintf_flat(fp, node->parent, total_samples); in __callchain__fprintf_flat()
295 list_for_each_entry(chain, &node->val, list) { in __callchain__fprintf_flat()
296 if (chain->ip >= PERF_CONTEXT_MAX) in __callchain__fprintf_flat()
341 ret += __callchain__fprintf_folded(fp, node->parent); in __callchain__fprintf_folded()
344 list_for_each_entry(chain, &node->val, list) { in __callchain__fprintf_folded()
345 if (chain->ip >= PERF_CONTEXT_MAX) in __callchain__fprintf_folded()
385 u64 parent_samples = he->stat.period; in hist_entry_callchain__fprintf()
388 parent_samples = he->stat_acc->period; in hist_entry_callchain__fprintf()
392 return callchain__fprintf_graph(fp, &he->sorted_chain, total_samples, in hist_entry_callchain__fprintf()
396 return callchain__fprintf_graph(fp, &he->sorted_chain, total_samples, in hist_entry_callchain__fprintf()
400 return callchain__fprintf_flat(fp, &he->sorted_chain, total_samples); in hist_entry_callchain__fprintf()
403 return callchain__fprintf_folded(fp, &he->sorted_chain, total_samples); in hist_entry_callchain__fprintf()
419 char *start = hpp->buf; in __hist_entry__snprintf()
423 if (symbol_conf.exclude_other && !he->parent) in __hist_entry__snprintf()
427 if (perf_hpp__should_skip(fmt, he->hists)) in __hist_entry__snprintf()
435 ret = scnprintf(hpp->buf, hpp->size, "%s", sep ?: " "); in __hist_entry__snprintf()
440 if (perf_hpp__use_color() && fmt->color) in __hist_entry__snprintf()
441 ret = fmt->color(fmt, hpp, he); in __hist_entry__snprintf()
443 ret = fmt->entry(fmt, hpp, he); in __hist_entry__snprintf()
449 return hpp->buf - start; in __hist_entry__snprintf()
454 return __hist_entry__snprintf(he, hpp, he->hists->hpp_list); in hist_entry__snprintf()
465 char *buf = hpp->buf; in hist_entry__hierarchy_fprintf()
466 size_t size = hpp->size; in hist_entry__hierarchy_fprintf()
470 if (symbol_conf.exclude_other && !he->parent) in hist_entry__hierarchy_fprintf()
473 ret = scnprintf(hpp->buf, hpp->size, "%*s", he->depth * HIERARCHY_INDENT, ""); in hist_entry__hierarchy_fprintf()
477 fmt_node = list_first_entry(&hists->hpp_formats, in hist_entry__hierarchy_fprintf()
479 perf_hpp_list__for_each_format(&fmt_node->hpp, fmt) { in hist_entry__hierarchy_fprintf()
485 ret = scnprintf(hpp->buf, hpp->size, "%s", sep ?: " "); in hist_entry__hierarchy_fprintf()
490 if (perf_hpp__use_color() && fmt->color) in hist_entry__hierarchy_fprintf()
491 ret = fmt->color(fmt, hpp, he); in hist_entry__hierarchy_fprintf()
493 ret = fmt->entry(fmt, hpp, he); in hist_entry__hierarchy_fprintf()
500 ret = scnprintf(hpp->buf, hpp->size, "%*s", in hist_entry__hierarchy_fprintf()
501 (hists->nr_hpp_node - 2) * HIERARCHY_INDENT, ""); in hist_entry__hierarchy_fprintf()
506 perf_hpp_list__for_each_format(he->hpp_list, fmt) { in hist_entry__hierarchy_fprintf()
507 hpp->buf = buf; in hist_entry__hierarchy_fprintf()
508 hpp->size = size; in hist_entry__hierarchy_fprintf()
514 if (perf_hpp__use_color() && fmt->color) in hist_entry__hierarchy_fprintf()
515 fmt->color(fmt, hpp, he); in hist_entry__hierarchy_fprintf()
517 fmt->entry(fmt, hpp, he); in hist_entry__hierarchy_fprintf()
520 * dynamic entries are right-aligned but we want left-aligned in hist_entry__hierarchy_fprintf()
527 if (he->leaf && hist_entry__has_callchains(he) && symbol_conf.use_callchain) { in hist_entry__hierarchy_fprintf()
545 for (unsigned int i = 0; i < bh->block_hists.nr_entries; i++) { in hist_entry__block_fprintf()
552 bh->block_idx = i; in hist_entry__block_fprintf()
591 struct hists *hists = he->hists; in hist_entry__fprintf()
592 u64 total_period = hists->stats.total_period; in hist_entry__fprintf()
627 width = (indent - 2) * HIERARCHY_INDENT; in print_hierarchy_indent()
629 return fprintf(fp, "%-*.*s", width, width, line); in print_hierarchy_indent()
637 int depth; in hists__fprintf_hierarchy_headers() local
644 indent = hists->nr_hpp_node; in hists__fprintf_hierarchy_headers()
646 /* preserve max indent depth for column headers */ in hists__fprintf_hierarchy_headers()
650 fmt_node = list_first_entry(&hists->hpp_formats, in hists__fprintf_hierarchy_headers()
653 perf_hpp_list__for_each_format(&fmt_node->hpp, fmt) { in hists__fprintf_hierarchy_headers()
654 fmt->header(fmt, hpp, hists, 0, NULL); in hists__fprintf_hierarchy_headers()
655 fprintf(fp, "%s%s", hpp->buf, sep ?: " "); in hists__fprintf_hierarchy_headers()
660 list_for_each_entry_continue(fmt_node, &hists->hpp_formats, list) { in hists__fprintf_hierarchy_headers()
666 perf_hpp_list__for_each_format(&fmt_node->hpp, fmt) { in hists__fprintf_hierarchy_headers()
674 fmt->header(fmt, hpp, hists, 0, NULL); in hists__fprintf_hierarchy_headers()
676 header_width += fprintf(fp, "%s", strim(hpp->buf)); in hists__fprintf_hierarchy_headers()
682 /* preserve max indent depth for initial dots */ in hists__fprintf_hierarchy_headers()
686 fmt_node = list_first_entry(&hists->hpp_formats, in hists__fprintf_hierarchy_headers()
690 perf_hpp_list__for_each_format(&fmt_node->hpp, fmt) { in hists__fprintf_hierarchy_headers()
695 width = fmt->width(fmt, hpp, hists); in hists__fprintf_hierarchy_headers()
699 depth = 0; in hists__fprintf_hierarchy_headers()
700 list_for_each_entry_continue(fmt_node, &hists->hpp_formats, list) { in hists__fprintf_hierarchy_headers()
702 width = depth * HIERARCHY_INDENT; in hists__fprintf_hierarchy_headers()
704 perf_hpp_list__for_each_format(&fmt_node->hpp, fmt) { in hists__fprintf_hierarchy_headers()
712 width += fmt->width(fmt, hpp, hists); in hists__fprintf_hierarchy_headers()
718 depth++; in hists__fprintf_hierarchy_headers()
721 fprintf(fp, "%s%-.*s", sep ?: " ", header_width, dots); in hists__fprintf_hierarchy_headers()
745 fmt->header(fmt, hpp, hists, line, &span); in fprintf_line()
748 fprintf(fp, "%s", hpp->buf); in fprintf_line()
757 struct perf_hpp_list *hpp_list = hists->hpp_list; in hists__fprintf_standard_headers()
764 for (line = 0; line < hpp_list->nr_header_lines; line++) { in hists__fprintf_standard_headers()
773 return hpp_list->nr_header_lines; in hists__fprintf_standard_headers()
790 width = fmt->width(fmt, hpp, hists); in hists__fprintf_standard_headers()
797 return hpp_list->nr_header_lines + 2; in hists__fprintf_standard_headers()
846 ret = -1; in hists__fprintf()
852 for (nd = rb_first_cached(&hists->entries); nd; in hists__fprintf()
857 if (h->filtered) in hists__fprintf()
874 * If all children are filtered out or percent-limited, in hists__fprintf()
877 if (!h->leaf && !hist_entry__has_hierarchy_children(h, min_pcnt)) { in hists__fprintf()
878 int depth = hists->nr_hpp_node + h->depth + 1; in hists__fprintf() local
880 print_hierarchy_indent(sep, depth, " ", fp); in hists__fprintf()
887 if (h->ms.map == NULL && verbose > 1) { in hists__fprintf()
888 maps__fprintf(h->thread->maps, fp); in hists__fprintf()
905 u32 total = stats->nr_events[0]; in events_stats__fprintf()
913 if (skip_empty && !stats->nr_events[i]) in events_stats__fprintf()
918 name, stats->nr_events[i], in events_stats__fprintf()
919 100.0 * stats->nr_events[i] / total); in events_stats__fprintf()
922 name, stats->nr_events[i]); in events_stats__fprintf()