1 // SPDX-License-Identifier: GPL-2.0
4 #include <linux/compiler.h>
6 #include "../util/callchain.h"
7 #include "../util/hist.h"
8 #include "../util/util.h"
9 #include "../util/sort.h"
10 #include "../util/evsel.h"
11 #include "../util/evlist.h"
13 /* hist period print (hpp) functions */
15 #define hpp__call_print_fn(hpp, fn, fmt, ...) \
17 int __ret = fn(hpp, fmt, ##__VA_ARGS__); \
18 advance_hpp(hpp, __ret); \
22 static int __hpp__fmt(struct perf_hpp
*hpp
, struct hist_entry
*he
,
23 hpp_field_fn get_field
, const char *fmt
, int len
,
24 hpp_snprint_fn print_fn
, bool fmt_percent
)
27 struct hists
*hists
= he
->hists
;
28 struct perf_evsel
*evsel
= hists_to_evsel(hists
);
30 size_t size
= hpp
->size
;
34 u64 total
= hists__total_period(hists
);
37 percent
= 100.0 * get_field(he
) / total
;
39 ret
= hpp__call_print_fn(hpp
, print_fn
, fmt
, len
, percent
);
41 ret
= hpp__call_print_fn(hpp
, print_fn
, fmt
, len
, get_field(he
));
43 if (perf_evsel__is_group_event(evsel
)) {
44 int prev_idx
, idx_delta
;
45 struct hist_entry
*pair
;
46 int nr_members
= evsel
->nr_members
;
48 prev_idx
= perf_evsel__group_idx(evsel
);
50 list_for_each_entry(pair
, &he
->pairs
.head
, pairs
.node
) {
51 u64 period
= get_field(pair
);
52 u64 total
= hists__total_period(pair
->hists
);
57 evsel
= hists_to_evsel(pair
->hists
);
58 idx_delta
= perf_evsel__group_idx(evsel
) - prev_idx
- 1;
62 * zero-fill group members in the middle which
66 ret
+= hpp__call_print_fn(hpp
, print_fn
,
69 ret
+= hpp__call_print_fn(hpp
, print_fn
,
75 ret
+= hpp__call_print_fn(hpp
, print_fn
, fmt
, len
,
76 100.0 * period
/ total
);
78 ret
+= hpp__call_print_fn(hpp
, print_fn
, fmt
,
82 prev_idx
= perf_evsel__group_idx(evsel
);
85 idx_delta
= nr_members
- prev_idx
- 1;
89 * zero-fill group members at last which have no sample
92 ret
+= hpp__call_print_fn(hpp
, print_fn
,
95 ret
+= hpp__call_print_fn(hpp
, print_fn
,
102 * Restore original buf and size as it's where caller expects
103 * the result will be saved.
111 int hpp__fmt(struct perf_hpp_fmt
*fmt
, struct perf_hpp
*hpp
,
112 struct hist_entry
*he
, hpp_field_fn get_field
,
113 const char *fmtstr
, hpp_snprint_fn print_fn
, bool fmt_percent
)
115 int len
= fmt
->user_len
?: fmt
->len
;
117 if (symbol_conf
.field_sep
) {
118 return __hpp__fmt(hpp
, he
, get_field
, fmtstr
, 1,
119 print_fn
, fmt_percent
);
123 len
-= 2; /* 2 for a space and a % sign */
127 return __hpp__fmt(hpp
, he
, get_field
, fmtstr
, len
, print_fn
, fmt_percent
);
130 int hpp__fmt_acc(struct perf_hpp_fmt
*fmt
, struct perf_hpp
*hpp
,
131 struct hist_entry
*he
, hpp_field_fn get_field
,
132 const char *fmtstr
, hpp_snprint_fn print_fn
, bool fmt_percent
)
134 if (!symbol_conf
.cumulate_callchain
) {
135 int len
= fmt
->user_len
?: fmt
->len
;
136 return snprintf(hpp
->buf
, hpp
->size
, " %*s", len
- 1, "N/A");
139 return hpp__fmt(fmt
, hpp
, he
, get_field
, fmtstr
, print_fn
, fmt_percent
);
142 static int field_cmp(u64 field_a
, u64 field_b
)
144 if (field_a
> field_b
)
146 if (field_a
< field_b
)
151 static int __hpp__sort(struct hist_entry
*a
, struct hist_entry
*b
,
152 hpp_field_fn get_field
)
156 struct perf_evsel
*evsel
;
157 struct hist_entry
*pair
;
158 u64
*fields_a
, *fields_b
;
160 ret
= field_cmp(get_field(a
), get_field(b
));
161 if (ret
|| !symbol_conf
.event_group
)
164 evsel
= hists_to_evsel(a
->hists
);
165 if (!perf_evsel__is_group_event(evsel
))
168 nr_members
= evsel
->nr_members
;
169 fields_a
= calloc(nr_members
, sizeof(*fields_a
));
170 fields_b
= calloc(nr_members
, sizeof(*fields_b
));
172 if (!fields_a
|| !fields_b
)
175 list_for_each_entry(pair
, &a
->pairs
.head
, pairs
.node
) {
176 evsel
= hists_to_evsel(pair
->hists
);
177 fields_a
[perf_evsel__group_idx(evsel
)] = get_field(pair
);
180 list_for_each_entry(pair
, &b
->pairs
.head
, pairs
.node
) {
181 evsel
= hists_to_evsel(pair
->hists
);
182 fields_b
[perf_evsel__group_idx(evsel
)] = get_field(pair
);
185 for (i
= 1; i
< nr_members
; i
++) {
186 ret
= field_cmp(fields_a
[i
], fields_b
[i
]);
198 static int __hpp__sort_acc(struct hist_entry
*a
, struct hist_entry
*b
,
199 hpp_field_fn get_field
)
203 if (symbol_conf
.cumulate_callchain
) {
205 * Put caller above callee when they have equal period.
207 ret
= field_cmp(get_field(a
), get_field(b
));
211 if (a
->thread
!= b
->thread
|| !hist_entry__has_callchains(a
) || !symbol_conf
.use_callchain
)
214 ret
= b
->callchain
->max_depth
- a
->callchain
->max_depth
;
215 if (callchain_param
.order
== ORDER_CALLER
)
221 static int hpp__width_fn(struct perf_hpp_fmt
*fmt
,
222 struct perf_hpp
*hpp __maybe_unused
,
225 int len
= fmt
->user_len
?: fmt
->len
;
226 struct perf_evsel
*evsel
= hists_to_evsel(hists
);
228 if (symbol_conf
.event_group
)
229 len
= max(len
, evsel
->nr_members
* fmt
->len
);
231 if (len
< (int)strlen(fmt
->name
))
232 len
= strlen(fmt
->name
);
237 static int hpp__header_fn(struct perf_hpp_fmt
*fmt
, struct perf_hpp
*hpp
,
238 struct hists
*hists
, int line __maybe_unused
,
239 int *span __maybe_unused
)
241 int len
= hpp__width_fn(fmt
, hpp
, hists
);
242 return scnprintf(hpp
->buf
, hpp
->size
, "%*s", len
, fmt
->name
);
245 int hpp_color_scnprintf(struct perf_hpp
*hpp
, const char *fmt
, ...)
248 ssize_t ssize
= hpp
->size
;
253 len
= va_arg(args
, int);
254 percent
= va_arg(args
, double);
255 ret
= percent_color_len_snprintf(hpp
->buf
, hpp
->size
, fmt
, len
, percent
);
258 return (ret
>= ssize
) ? (ssize
- 1) : ret
;
261 static int hpp_entry_scnprintf(struct perf_hpp
*hpp
, const char *fmt
, ...)
264 ssize_t ssize
= hpp
->size
;
268 ret
= vsnprintf(hpp
->buf
, hpp
->size
, fmt
, args
);
271 return (ret
>= ssize
) ? (ssize
- 1) : ret
;
274 #define __HPP_COLOR_PERCENT_FN(_type, _field) \
275 static u64 he_get_##_field(struct hist_entry *he) \
277 return he->stat._field; \
280 static int hpp__color_##_type(struct perf_hpp_fmt *fmt, \
281 struct perf_hpp *hpp, struct hist_entry *he) \
283 return hpp__fmt(fmt, hpp, he, he_get_##_field, " %*.2f%%", \
284 hpp_color_scnprintf, true); \
287 #define __HPP_ENTRY_PERCENT_FN(_type, _field) \
288 static int hpp__entry_##_type(struct perf_hpp_fmt *fmt, \
289 struct perf_hpp *hpp, struct hist_entry *he) \
291 return hpp__fmt(fmt, hpp, he, he_get_##_field, " %*.2f%%", \
292 hpp_entry_scnprintf, true); \
295 #define __HPP_SORT_FN(_type, _field) \
296 static int64_t hpp__sort_##_type(struct perf_hpp_fmt *fmt __maybe_unused, \
297 struct hist_entry *a, struct hist_entry *b) \
299 return __hpp__sort(a, b, he_get_##_field); \
302 #define __HPP_COLOR_ACC_PERCENT_FN(_type, _field) \
303 static u64 he_get_acc_##_field(struct hist_entry *he) \
305 return he->stat_acc->_field; \
308 static int hpp__color_##_type(struct perf_hpp_fmt *fmt, \
309 struct perf_hpp *hpp, struct hist_entry *he) \
311 return hpp__fmt_acc(fmt, hpp, he, he_get_acc_##_field, " %*.2f%%", \
312 hpp_color_scnprintf, true); \
315 #define __HPP_ENTRY_ACC_PERCENT_FN(_type, _field) \
316 static int hpp__entry_##_type(struct perf_hpp_fmt *fmt, \
317 struct perf_hpp *hpp, struct hist_entry *he) \
319 return hpp__fmt_acc(fmt, hpp, he, he_get_acc_##_field, " %*.2f%%", \
320 hpp_entry_scnprintf, true); \
323 #define __HPP_SORT_ACC_FN(_type, _field) \
324 static int64_t hpp__sort_##_type(struct perf_hpp_fmt *fmt __maybe_unused, \
325 struct hist_entry *a, struct hist_entry *b) \
327 return __hpp__sort_acc(a, b, he_get_acc_##_field); \
330 #define __HPP_ENTRY_RAW_FN(_type, _field) \
331 static u64 he_get_raw_##_field(struct hist_entry *he) \
333 return he->stat._field; \
336 static int hpp__entry_##_type(struct perf_hpp_fmt *fmt, \
337 struct perf_hpp *hpp, struct hist_entry *he) \
339 return hpp__fmt(fmt, hpp, he, he_get_raw_##_field, " %*"PRIu64, \
340 hpp_entry_scnprintf, false); \
343 #define __HPP_SORT_RAW_FN(_type, _field) \
344 static int64_t hpp__sort_##_type(struct perf_hpp_fmt *fmt __maybe_unused, \
345 struct hist_entry *a, struct hist_entry *b) \
347 return __hpp__sort(a, b, he_get_raw_##_field); \
351 #define HPP_PERCENT_FNS(_type, _field) \
352 __HPP_COLOR_PERCENT_FN(_type, _field) \
353 __HPP_ENTRY_PERCENT_FN(_type, _field) \
354 __HPP_SORT_FN(_type, _field)
356 #define HPP_PERCENT_ACC_FNS(_type, _field) \
357 __HPP_COLOR_ACC_PERCENT_FN(_type, _field) \
358 __HPP_ENTRY_ACC_PERCENT_FN(_type, _field) \
359 __HPP_SORT_ACC_FN(_type, _field)
361 #define HPP_RAW_FNS(_type, _field) \
362 __HPP_ENTRY_RAW_FN(_type, _field) \
363 __HPP_SORT_RAW_FN(_type, _field)
365 HPP_PERCENT_FNS(overhead
, period
)
366 HPP_PERCENT_FNS(overhead_sys
, period_sys
)
367 HPP_PERCENT_FNS(overhead_us
, period_us
)
368 HPP_PERCENT_FNS(overhead_guest_sys
, period_guest_sys
)
369 HPP_PERCENT_FNS(overhead_guest_us
, period_guest_us
)
370 HPP_PERCENT_ACC_FNS(overhead_acc
, period
)
372 HPP_RAW_FNS(samples
, nr_events
)
373 HPP_RAW_FNS(period
, period
)
375 static int64_t hpp__nop_cmp(struct perf_hpp_fmt
*fmt __maybe_unused
,
376 struct hist_entry
*a __maybe_unused
,
377 struct hist_entry
*b __maybe_unused
)
382 static bool perf_hpp__is_hpp_entry(struct perf_hpp_fmt
*a
)
384 return a
->header
== hpp__header_fn
;
387 static bool hpp__equal(struct perf_hpp_fmt
*a
, struct perf_hpp_fmt
*b
)
389 if (!perf_hpp__is_hpp_entry(a
) || !perf_hpp__is_hpp_entry(b
))
392 return a
->idx
== b
->idx
;
395 #define HPP__COLOR_PRINT_FNS(_name, _fn, _idx) \
398 .header = hpp__header_fn, \
399 .width = hpp__width_fn, \
400 .color = hpp__color_ ## _fn, \
401 .entry = hpp__entry_ ## _fn, \
402 .cmp = hpp__nop_cmp, \
403 .collapse = hpp__nop_cmp, \
404 .sort = hpp__sort_ ## _fn, \
405 .idx = PERF_HPP__ ## _idx, \
406 .equal = hpp__equal, \
409 #define HPP__COLOR_ACC_PRINT_FNS(_name, _fn, _idx) \
412 .header = hpp__header_fn, \
413 .width = hpp__width_fn, \
414 .color = hpp__color_ ## _fn, \
415 .entry = hpp__entry_ ## _fn, \
416 .cmp = hpp__nop_cmp, \
417 .collapse = hpp__nop_cmp, \
418 .sort = hpp__sort_ ## _fn, \
419 .idx = PERF_HPP__ ## _idx, \
420 .equal = hpp__equal, \
423 #define HPP__PRINT_FNS(_name, _fn, _idx) \
426 .header = hpp__header_fn, \
427 .width = hpp__width_fn, \
428 .entry = hpp__entry_ ## _fn, \
429 .cmp = hpp__nop_cmp, \
430 .collapse = hpp__nop_cmp, \
431 .sort = hpp__sort_ ## _fn, \
432 .idx = PERF_HPP__ ## _idx, \
433 .equal = hpp__equal, \
436 struct perf_hpp_fmt perf_hpp__format
[] = {
437 HPP__COLOR_PRINT_FNS("Overhead", overhead
, OVERHEAD
),
438 HPP__COLOR_PRINT_FNS("sys", overhead_sys
, OVERHEAD_SYS
),
439 HPP__COLOR_PRINT_FNS("usr", overhead_us
, OVERHEAD_US
),
440 HPP__COLOR_PRINT_FNS("guest sys", overhead_guest_sys
, OVERHEAD_GUEST_SYS
),
441 HPP__COLOR_PRINT_FNS("guest usr", overhead_guest_us
, OVERHEAD_GUEST_US
),
442 HPP__COLOR_ACC_PRINT_FNS("Children", overhead_acc
, OVERHEAD_ACC
),
443 HPP__PRINT_FNS("Samples", samples
, SAMPLES
),
444 HPP__PRINT_FNS("Period", period
, PERIOD
)
447 struct perf_hpp_list perf_hpp_list
= {
448 .fields
= LIST_HEAD_INIT(perf_hpp_list
.fields
),
449 .sorts
= LIST_HEAD_INIT(perf_hpp_list
.sorts
),
450 .nr_header_lines
= 1,
453 #undef HPP__COLOR_PRINT_FNS
454 #undef HPP__COLOR_ACC_PRINT_FNS
455 #undef HPP__PRINT_FNS
457 #undef HPP_PERCENT_FNS
458 #undef HPP_PERCENT_ACC_FNS
461 #undef __HPP_HEADER_FN
462 #undef __HPP_WIDTH_FN
463 #undef __HPP_COLOR_PERCENT_FN
464 #undef __HPP_ENTRY_PERCENT_FN
465 #undef __HPP_COLOR_ACC_PERCENT_FN
466 #undef __HPP_ENTRY_ACC_PERCENT_FN
467 #undef __HPP_ENTRY_RAW_FN
469 #undef __HPP_SORT_ACC_FN
470 #undef __HPP_SORT_RAW_FN
473 void perf_hpp__init(void)
477 for (i
= 0; i
< PERF_HPP__MAX_INDEX
; i
++) {
478 struct perf_hpp_fmt
*fmt
= &perf_hpp__format
[i
];
480 INIT_LIST_HEAD(&fmt
->list
);
482 /* sort_list may be linked by setup_sorting() */
483 if (fmt
->sort_list
.next
== NULL
)
484 INIT_LIST_HEAD(&fmt
->sort_list
);
488 * If user specified field order, no need to setup default fields.
490 if (is_strict_order(field_order
))
493 if (symbol_conf
.cumulate_callchain
) {
494 hpp_dimension__add_output(PERF_HPP__OVERHEAD_ACC
);
495 perf_hpp__format
[PERF_HPP__OVERHEAD
].name
= "Self";
498 hpp_dimension__add_output(PERF_HPP__OVERHEAD
);
500 if (symbol_conf
.show_cpu_utilization
) {
501 hpp_dimension__add_output(PERF_HPP__OVERHEAD_SYS
);
502 hpp_dimension__add_output(PERF_HPP__OVERHEAD_US
);
505 hpp_dimension__add_output(PERF_HPP__OVERHEAD_GUEST_SYS
);
506 hpp_dimension__add_output(PERF_HPP__OVERHEAD_GUEST_US
);
510 if (symbol_conf
.show_nr_samples
)
511 hpp_dimension__add_output(PERF_HPP__SAMPLES
);
513 if (symbol_conf
.show_total_period
)
514 hpp_dimension__add_output(PERF_HPP__PERIOD
);
517 void perf_hpp_list__column_register(struct perf_hpp_list
*list
,
518 struct perf_hpp_fmt
*format
)
520 list_add_tail(&format
->list
, &list
->fields
);
523 void perf_hpp_list__register_sort_field(struct perf_hpp_list
*list
,
524 struct perf_hpp_fmt
*format
)
526 list_add_tail(&format
->sort_list
, &list
->sorts
);
529 void perf_hpp_list__prepend_sort_field(struct perf_hpp_list
*list
,
530 struct perf_hpp_fmt
*format
)
532 list_add(&format
->sort_list
, &list
->sorts
);
535 void perf_hpp__column_unregister(struct perf_hpp_fmt
*format
)
537 list_del_init(&format
->list
);
540 void perf_hpp__cancel_cumulate(void)
542 struct perf_hpp_fmt
*fmt
, *acc
, *ovh
, *tmp
;
544 if (is_strict_order(field_order
))
547 ovh
= &perf_hpp__format
[PERF_HPP__OVERHEAD
];
548 acc
= &perf_hpp__format
[PERF_HPP__OVERHEAD_ACC
];
550 perf_hpp_list__for_each_format_safe(&perf_hpp_list
, fmt
, tmp
) {
551 if (acc
->equal(acc
, fmt
)) {
552 perf_hpp__column_unregister(fmt
);
556 if (ovh
->equal(ovh
, fmt
))
557 fmt
->name
= "Overhead";
561 static bool fmt_equal(struct perf_hpp_fmt
*a
, struct perf_hpp_fmt
*b
)
563 return a
->equal
&& a
->equal(a
, b
);
566 void perf_hpp__setup_output_field(struct perf_hpp_list
*list
)
568 struct perf_hpp_fmt
*fmt
;
570 /* append sort keys to output field */
571 perf_hpp_list__for_each_sort_list(list
, fmt
) {
572 struct perf_hpp_fmt
*pos
;
574 /* skip sort-only fields ("sort_compute" in perf diff) */
575 if (!fmt
->entry
&& !fmt
->color
)
578 perf_hpp_list__for_each_format(list
, pos
) {
579 if (fmt_equal(fmt
, pos
))
583 perf_hpp__column_register(fmt
);
589 void perf_hpp__append_sort_keys(struct perf_hpp_list
*list
)
591 struct perf_hpp_fmt
*fmt
;
593 /* append output fields to sort keys */
594 perf_hpp_list__for_each_format(list
, fmt
) {
595 struct perf_hpp_fmt
*pos
;
597 perf_hpp_list__for_each_sort_list(list
, pos
) {
598 if (fmt_equal(fmt
, pos
))
602 perf_hpp__register_sort_field(fmt
);
609 static void fmt_free(struct perf_hpp_fmt
*fmt
)
612 * At this point fmt should be completely
613 * unhooked, if not it's a bug.
615 BUG_ON(!list_empty(&fmt
->list
));
616 BUG_ON(!list_empty(&fmt
->sort_list
));
622 void perf_hpp__reset_output_field(struct perf_hpp_list
*list
)
624 struct perf_hpp_fmt
*fmt
, *tmp
;
626 /* reset output fields */
627 perf_hpp_list__for_each_format_safe(list
, fmt
, tmp
) {
628 list_del_init(&fmt
->list
);
629 list_del_init(&fmt
->sort_list
);
633 /* reset sort keys */
634 perf_hpp_list__for_each_sort_list_safe(list
, fmt
, tmp
) {
635 list_del_init(&fmt
->list
);
636 list_del_init(&fmt
->sort_list
);
642 * See hists__fprintf to match the column widths
644 unsigned int hists__sort_list_width(struct hists
*hists
)
646 struct perf_hpp_fmt
*fmt
;
649 struct perf_hpp dummy_hpp
;
651 hists__for_each_format(hists
, fmt
) {
652 if (perf_hpp__should_skip(fmt
, hists
))
660 ret
+= fmt
->width(fmt
, &dummy_hpp
, hists
);
663 if (verbose
> 0 && hists__has(hists
, sym
)) /* Addr + origin */
664 ret
+= 3 + BITS_PER_LONG
/ 4;
669 unsigned int hists__overhead_width(struct hists
*hists
)
671 struct perf_hpp_fmt
*fmt
;
674 struct perf_hpp dummy_hpp
;
676 hists__for_each_format(hists
, fmt
) {
677 if (perf_hpp__is_sort_entry(fmt
) || perf_hpp__is_dynamic_entry(fmt
))
685 ret
+= fmt
->width(fmt
, &dummy_hpp
, hists
);
691 void perf_hpp__reset_width(struct perf_hpp_fmt
*fmt
, struct hists
*hists
)
693 if (perf_hpp__is_sort_entry(fmt
))
694 return perf_hpp__reset_sort_width(fmt
, hists
);
696 if (perf_hpp__is_dynamic_entry(fmt
))
699 BUG_ON(fmt
->idx
>= PERF_HPP__MAX_INDEX
);
702 case PERF_HPP__OVERHEAD
:
703 case PERF_HPP__OVERHEAD_SYS
:
704 case PERF_HPP__OVERHEAD_US
:
705 case PERF_HPP__OVERHEAD_ACC
:
709 case PERF_HPP__OVERHEAD_GUEST_SYS
:
710 case PERF_HPP__OVERHEAD_GUEST_US
:
714 case PERF_HPP__SAMPLES
:
715 case PERF_HPP__PERIOD
:
724 void hists__reset_column_width(struct hists
*hists
)
726 struct perf_hpp_fmt
*fmt
;
727 struct perf_hpp_list_node
*node
;
729 hists__for_each_format(hists
, fmt
)
730 perf_hpp__reset_width(fmt
, hists
);
732 /* hierarchy entries have their own hpp list */
733 list_for_each_entry(node
, &hists
->hpp_formats
, list
) {
734 perf_hpp_list__for_each_format(&node
->hpp
, fmt
)
735 perf_hpp__reset_width(fmt
, hists
);
739 void perf_hpp__set_user_width(const char *width_list_str
)
741 struct perf_hpp_fmt
*fmt
;
742 const char *ptr
= width_list_str
;
744 perf_hpp_list__for_each_format(&perf_hpp_list
, fmt
) {
747 int len
= strtol(ptr
, &p
, 10);
757 static int add_hierarchy_fmt(struct hists
*hists
, struct perf_hpp_fmt
*fmt
)
759 struct perf_hpp_list_node
*node
= NULL
;
760 struct perf_hpp_fmt
*fmt_copy
;
762 bool skip
= perf_hpp__should_skip(fmt
, hists
);
764 list_for_each_entry(node
, &hists
->hpp_formats
, list
) {
765 if (node
->level
== fmt
->level
) {
772 node
= malloc(sizeof(*node
));
777 node
->level
= fmt
->level
;
778 perf_hpp_list__init(&node
->hpp
);
780 hists
->nr_hpp_node
++;
781 list_add_tail(&node
->list
, &hists
->hpp_formats
);
784 fmt_copy
= perf_hpp_fmt__dup(fmt
);
785 if (fmt_copy
== NULL
)
791 list_add_tail(&fmt_copy
->list
, &node
->hpp
.fields
);
792 list_add_tail(&fmt_copy
->sort_list
, &node
->hpp
.sorts
);
797 int perf_hpp__setup_hists_formats(struct perf_hpp_list
*list
,
798 struct perf_evlist
*evlist
)
800 struct perf_evsel
*evsel
;
801 struct perf_hpp_fmt
*fmt
;
805 if (!symbol_conf
.report_hierarchy
)
808 evlist__for_each_entry(evlist
, evsel
) {
809 hists
= evsel__hists(evsel
);
811 perf_hpp_list__for_each_sort_list(list
, fmt
) {
812 if (perf_hpp__is_dynamic_entry(fmt
) &&
813 !perf_hpp__defined_dynamic_entry(fmt
, hists
))
816 ret
= add_hierarchy_fmt(hists
, fmt
);