Lines Matching +full:display +full:- +full:depth
1 // SPDX-License-Identifier: GPL-2.0
19 #include "../../util/block-info.h"
37 static size_t ipchain__fprintf_graph_line(FILE *fp, int depth, int depth_mask, in ipchain__fprintf_graph_line() argument
43 for (i = 0; i < depth; i++) in ipchain__fprintf_graph_line()
56 int depth, int depth_mask, int period, in ipchain__fprintf_graph() argument
66 for (i = 0; i < depth; i++) { in ipchain__fprintf_graph()
71 if (!period && i == depth - 1) { in ipchain__fprintf_graph()
72 ret += fprintf(fp, "--"); in ipchain__fprintf_graph()
74 ret += fprintf(fp, "--"); in ipchain__fprintf_graph()
105 fprintf(stderr, "Not enough memory to display remaining hits\n"); in init_rem_hits()
109 strcpy(rem_sq_bracket->name, "[...]"); in init_rem_hits()
114 u64 total_samples, int depth, in __callchain__fprintf_graph() argument
136 remaining -= cumul; in __callchain__fprintf_graph()
140 * The depth mask manages the output of pipes that show in __callchain__fprintf_graph()
141 * the depth. We don't want to keep the pipes of the current in __callchain__fprintf_graph()
142 * level for the last child of this depth. in __callchain__fprintf_graph()
148 new_depth_mask &= ~(1 << (depth - 1)); in __callchain__fprintf_graph()
151 * But we keep the older depth mask for the line separator in __callchain__fprintf_graph()
154 ret += ipchain__fprintf_graph_line(fp, depth, depth_mask, in __callchain__fprintf_graph()
157 list_for_each_entry(chain, &child->val, list) { in __callchain__fprintf_graph()
158 ret += ipchain__fprintf_graph(fp, child, chain, depth, in __callchain__fprintf_graph()
165 new_total = child->children_hit; in __callchain__fprintf_graph()
169 ret += __callchain__fprintf_graph(fp, &child->rb_root, new_total, in __callchain__fprintf_graph()
170 depth + 1, in __callchain__fprintf_graph()
171 new_depth_mask | (1 << depth), in __callchain__fprintf_graph()
187 if (callchain_param.value == CCVAL_COUNT && child && child->parent) { in __callchain__fprintf_graph()
188 rem_node.count = child->parent->children_count - cumul_count; in __callchain__fprintf_graph()
193 new_depth_mask &= ~(1 << (depth - 1)); in __callchain__fprintf_graph()
194 ret += ipchain__fprintf_graph(fp, &rem_node, &rem_hits, depth, in __callchain__fprintf_graph()
207 * However when percent-limit applied, it's possible that single callchain
208 * node have different (non-100% in fractal mode) percentage.
237 list_for_each_entry(chain, &cnode->val, list) { in callchain__fprintf_graph()
251 ret += fprintf(fp, "---"); in callchain__fprintf_graph()
270 root = &cnode->rb_root; in callchain__fprintf_graph()
296 ret += __callchain__fprintf_flat(fp, node->parent, total_samples); in __callchain__fprintf_flat()
299 list_for_each_entry(chain, &node->val, list) { in __callchain__fprintf_flat()
300 if (chain->ip >= PERF_CONTEXT_MAX) in __callchain__fprintf_flat()
345 ret += __callchain__fprintf_folded(fp, node->parent); in __callchain__fprintf_folded()
348 list_for_each_entry(chain, &node->val, list) { in __callchain__fprintf_folded()
349 if (chain->ip >= PERF_CONTEXT_MAX) in __callchain__fprintf_folded()
389 u64 parent_samples = he->stat.period; in hist_entry_callchain__fprintf()
392 parent_samples = he->stat_acc->period; 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_graph(fp, &he->sorted_chain, total_samples, in hist_entry_callchain__fprintf()
404 return callchain__fprintf_flat(fp, &he->sorted_chain, total_samples); in hist_entry_callchain__fprintf()
407 return callchain__fprintf_folded(fp, &he->sorted_chain, total_samples); in hist_entry_callchain__fprintf()
423 char *start = hpp->buf; in __hist_entry__snprintf()
427 if (symbol_conf.exclude_other && !he->parent) in __hist_entry__snprintf()
431 if (perf_hpp__should_skip(fmt, he->hists)) in __hist_entry__snprintf()
436 * to display initial ' '. in __hist_entry__snprintf()
439 ret = scnprintf(hpp->buf, hpp->size, "%s", sep ?: " "); in __hist_entry__snprintf()
444 if (perf_hpp__use_color() && fmt->color) in __hist_entry__snprintf()
445 ret = fmt->color(fmt, hpp, he); in __hist_entry__snprintf()
447 ret = fmt->entry(fmt, hpp, he); in __hist_entry__snprintf()
453 return hpp->buf - start; in __hist_entry__snprintf()
458 return __hist_entry__snprintf(he, hpp, he->hists->hpp_list); in hist_entry__snprintf()
469 char *buf = hpp->buf; in hist_entry__hierarchy_fprintf()
470 size_t size = hpp->size; in hist_entry__hierarchy_fprintf()
474 if (symbol_conf.exclude_other && !he->parent) in hist_entry__hierarchy_fprintf()
477 ret = scnprintf(hpp->buf, hpp->size, "%*s", he->depth * HIERARCHY_INDENT, ""); in hist_entry__hierarchy_fprintf()
481 fmt_node = list_first_entry(&hists->hpp_formats, in hist_entry__hierarchy_fprintf()
483 perf_hpp_list__for_each_format(&fmt_node->hpp, fmt) { in hist_entry__hierarchy_fprintf()
486 * to display initial ' '. in hist_entry__hierarchy_fprintf()
489 ret = scnprintf(hpp->buf, hpp->size, "%s", sep ?: " "); in hist_entry__hierarchy_fprintf()
494 if (perf_hpp__use_color() && fmt->color) in hist_entry__hierarchy_fprintf()
495 ret = fmt->color(fmt, hpp, he); in hist_entry__hierarchy_fprintf()
497 ret = fmt->entry(fmt, hpp, he); in hist_entry__hierarchy_fprintf()
504 ret = scnprintf(hpp->buf, hpp->size, "%*s", in hist_entry__hierarchy_fprintf()
505 (hists->nr_hpp_node - 2) * HIERARCHY_INDENT, ""); in hist_entry__hierarchy_fprintf()
510 perf_hpp_list__for_each_format(he->hpp_list, fmt) { in hist_entry__hierarchy_fprintf()
511 hpp->buf = buf; in hist_entry__hierarchy_fprintf()
512 hpp->size = size; in hist_entry__hierarchy_fprintf()
518 if (perf_hpp__use_color() && fmt->color) in hist_entry__hierarchy_fprintf()
519 fmt->color(fmt, hpp, he); in hist_entry__hierarchy_fprintf()
521 fmt->entry(fmt, hpp, he); in hist_entry__hierarchy_fprintf()
524 * dynamic entries are right-aligned but we want left-aligned in hist_entry__hierarchy_fprintf()
531 if (he->leaf && hist_entry__has_callchains(he) && symbol_conf.use_callchain) { in hist_entry__hierarchy_fprintf()
549 for (unsigned int i = 0; i < bh->block_hists.nr_entries; i++) { in hist_entry__block_fprintf()
556 bh->block_idx = i; in hist_entry__block_fprintf()
595 struct hists *hists = he->hists; in hist_entry__fprintf()
596 u64 total_period = hists->stats.total_period; in hist_entry__fprintf()
631 width = (indent - 2) * HIERARCHY_INDENT; in print_hierarchy_indent()
633 return fprintf(fp, "%-*.*s", width, width, line); in print_hierarchy_indent()
641 int depth; in hists__fprintf_hierarchy_headers() local
648 indent = hists->nr_hpp_node; in hists__fprintf_hierarchy_headers()
650 /* preserve max indent depth for column headers */ in hists__fprintf_hierarchy_headers()
654 fmt_node = list_first_entry(&hists->hpp_formats, in hists__fprintf_hierarchy_headers()
657 perf_hpp_list__for_each_format(&fmt_node->hpp, fmt) { in hists__fprintf_hierarchy_headers()
658 fmt->header(fmt, hpp, hists, 0, NULL); in hists__fprintf_hierarchy_headers()
659 fprintf(fp, "%s%s", hpp->buf, sep ?: " "); in hists__fprintf_hierarchy_headers()
664 list_for_each_entry_continue(fmt_node, &hists->hpp_formats, list) { in hists__fprintf_hierarchy_headers()
670 perf_hpp_list__for_each_format(&fmt_node->hpp, fmt) { in hists__fprintf_hierarchy_headers()
678 fmt->header(fmt, hpp, hists, 0, NULL); in hists__fprintf_hierarchy_headers()
680 header_width += fprintf(fp, "%s", strim(hpp->buf)); in hists__fprintf_hierarchy_headers()
686 /* preserve max indent depth for initial dots */ in hists__fprintf_hierarchy_headers()
690 fmt_node = list_first_entry(&hists->hpp_formats, in hists__fprintf_hierarchy_headers()
694 perf_hpp_list__for_each_format(&fmt_node->hpp, fmt) { in hists__fprintf_hierarchy_headers()
699 width = fmt->width(fmt, hpp, hists); in hists__fprintf_hierarchy_headers()
703 depth = 0; in hists__fprintf_hierarchy_headers()
704 list_for_each_entry_continue(fmt_node, &hists->hpp_formats, list) { in hists__fprintf_hierarchy_headers()
706 width = depth * HIERARCHY_INDENT; in hists__fprintf_hierarchy_headers()
708 perf_hpp_list__for_each_format(&fmt_node->hpp, fmt) { in hists__fprintf_hierarchy_headers()
716 width += fmt->width(fmt, hpp, hists); in hists__fprintf_hierarchy_headers()
722 depth++; in hists__fprintf_hierarchy_headers()
725 fprintf(fp, "%s%-.*s", sep ?: " ", header_width, dots); in hists__fprintf_hierarchy_headers()
749 fmt->header(fmt, hpp, hists, line, &span); in fprintf_line()
752 fprintf(fp, "%s", hpp->buf); in fprintf_line()
761 struct perf_hpp_list *hpp_list = hists->hpp_list; in hists__fprintf_standard_headers()
768 for (line = 0; line < hpp_list->nr_header_lines; line++) { in hists__fprintf_standard_headers()
777 return hpp_list->nr_header_lines; in hists__fprintf_standard_headers()
794 width = fmt->width(fmt, hpp, hists); in hists__fprintf_standard_headers()
801 return hpp_list->nr_header_lines + 2; in hists__fprintf_standard_headers()
850 ret = -1; in hists__fprintf()
856 for (nd = rb_first_cached(&hists->entries); nd; in hists__fprintf()
861 if (h->filtered) in hists__fprintf()
878 * If all children are filtered out or percent-limited, in hists__fprintf()
879 * display "no entry >= x.xx%" message. in hists__fprintf()
881 if (!h->leaf && !hist_entry__has_hierarchy_children(h, min_pcnt)) { in hists__fprintf()
882 int depth = hists->nr_hpp_node + h->depth + 1; in hists__fprintf() local
884 print_hierarchy_indent(sep, depth, " ", fp); in hists__fprintf()
891 if (h->ms.map == NULL && verbose > 1) { in hists__fprintf()
892 maps__fprintf(thread__maps(h->thread), fp); in hists__fprintf()
908 u32 total = stats->nr_events[0]; in events_stats__fprintf()
916 if (symbol_conf.skip_empty && !stats->nr_events[i]) in events_stats__fprintf()
921 name, stats->nr_events[i], in events_stats__fprintf()
922 100.0 * stats->nr_events[i] / total); in events_stats__fprintf()
925 name, stats->nr_events[i]); in events_stats__fprintf()