Lines Matching refs:fmt
14 #define hpp__call_print_fn(hpp, fn, fmt, ...) \ argument
16 int __ret = fn(hpp, fmt, ##__VA_ARGS__); \
22 hpp_field_fn get_field, const char *fmt, int len, in __hpp__fmt() argument
38 ret = hpp__call_print_fn(hpp, print_fn, fmt, len, percent); in __hpp__fmt()
40 ret = hpp__call_print_fn(hpp, print_fn, fmt, len, get_field(he)); in __hpp__fmt()
66 fmt, len, 0.0); in __hpp__fmt()
69 fmt, len, 0ULL); in __hpp__fmt()
74 ret += hpp__call_print_fn(hpp, print_fn, fmt, len, in __hpp__fmt()
77 ret += hpp__call_print_fn(hpp, print_fn, fmt, in __hpp__fmt()
92 fmt, len, 0.0); in __hpp__fmt()
95 fmt, len, 0ULL); in __hpp__fmt()
110 int hpp__fmt(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, in hpp__fmt() argument
114 int len = fmt->user_len ?: fmt->len; in hpp__fmt()
129 int hpp__fmt_acc(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, in hpp__fmt_acc() argument
134 int len = fmt->user_len ?: fmt->len; in hpp__fmt_acc()
138 return hpp__fmt(fmt, hpp, he, get_field, fmtstr, print_fn, fmt_percent); in hpp__fmt_acc()
220 static int hpp__width_fn(struct perf_hpp_fmt *fmt, in hpp__width_fn() argument
224 int len = fmt->user_len ?: fmt->len; in hpp__width_fn()
228 len = max(len, evsel->nr_members * fmt->len); in hpp__width_fn()
230 if (len < (int)strlen(fmt->name)) in hpp__width_fn()
231 len = strlen(fmt->name); in hpp__width_fn()
236 static int hpp__header_fn(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, in hpp__header_fn() argument
240 int len = hpp__width_fn(fmt, hpp, hists); in hpp__header_fn()
241 return scnprintf(hpp->buf, hpp->size, "%*s", len, fmt->name); in hpp__header_fn()
244 int hpp_color_scnprintf(struct perf_hpp *hpp, const char *fmt, ...) in hpp_color_scnprintf() argument
251 va_start(args, fmt); in hpp_color_scnprintf()
254 ret = percent_color_len_snprintf(hpp->buf, hpp->size, fmt, len, percent); in hpp_color_scnprintf()
260 static int hpp_entry_scnprintf(struct perf_hpp *hpp, const char *fmt, ...) in hpp_entry_scnprintf() argument
266 va_start(args, fmt); in hpp_entry_scnprintf()
267 ret = vsnprintf(hpp->buf, hpp->size, fmt, args); in hpp_entry_scnprintf()
279 static int hpp__color_##_type(struct perf_hpp_fmt *fmt, \
282 return hpp__fmt(fmt, hpp, he, he_get_##_field, " %*.2f%%", \
287 static int hpp__entry_##_type(struct perf_hpp_fmt *fmt, \
290 return hpp__fmt(fmt, hpp, he, he_get_##_field, " %*.2f%%", \
295 static int64_t hpp__sort_##_type(struct perf_hpp_fmt *fmt __maybe_unused, \
307 static int hpp__color_##_type(struct perf_hpp_fmt *fmt, \
310 return hpp__fmt_acc(fmt, hpp, he, he_get_acc_##_field, " %*.2f%%", \
315 static int hpp__entry_##_type(struct perf_hpp_fmt *fmt, \
318 return hpp__fmt_acc(fmt, hpp, he, he_get_acc_##_field, " %*.2f%%", \
323 static int64_t hpp__sort_##_type(struct perf_hpp_fmt *fmt __maybe_unused, \
335 static int hpp__entry_##_type(struct perf_hpp_fmt *fmt, \
338 return hpp__fmt(fmt, hpp, he, he_get_raw_##_field, " %*"PRIu64, \
343 static int64_t hpp__sort_##_type(struct perf_hpp_fmt *fmt __maybe_unused, \
374 static int64_t hpp__nop_cmp(struct perf_hpp_fmt *fmt __maybe_unused, in HPP_PERCENT_FNS()
477 struct perf_hpp_fmt *fmt = &perf_hpp__format[i]; in perf_hpp__init() local
479 INIT_LIST_HEAD(&fmt->list); in perf_hpp__init()
482 if (fmt->sort_list.next == NULL) in perf_hpp__init()
483 INIT_LIST_HEAD(&fmt->sort_list); in perf_hpp__init()
541 struct perf_hpp_fmt *fmt, *acc, *ovh, *tmp; in perf_hpp__cancel_cumulate() local
549 perf_hpp_list__for_each_format_safe(&perf_hpp_list, fmt, tmp) { in perf_hpp__cancel_cumulate()
550 if (acc->equal(acc, fmt)) { in perf_hpp__cancel_cumulate()
551 perf_hpp__column_unregister(fmt); in perf_hpp__cancel_cumulate()
555 if (ovh->equal(ovh, fmt)) in perf_hpp__cancel_cumulate()
556 fmt->name = "Overhead"; in perf_hpp__cancel_cumulate()
567 struct perf_hpp_fmt *fmt; in perf_hpp__setup_output_field() local
570 perf_hpp_list__for_each_sort_list(list, fmt) { in perf_hpp__setup_output_field()
574 if (!fmt->entry && !fmt->color) in perf_hpp__setup_output_field()
578 if (fmt_equal(fmt, pos)) in perf_hpp__setup_output_field()
582 perf_hpp__column_register(fmt); in perf_hpp__setup_output_field()
590 struct perf_hpp_fmt *fmt; in perf_hpp__append_sort_keys() local
593 perf_hpp_list__for_each_format(list, fmt) { in perf_hpp__append_sort_keys()
597 if (fmt_equal(fmt, pos)) in perf_hpp__append_sort_keys()
601 perf_hpp__register_sort_field(fmt); in perf_hpp__append_sort_keys()
608 static void fmt_free(struct perf_hpp_fmt *fmt) in fmt_free() argument
614 BUG_ON(!list_empty(&fmt->list)); in fmt_free()
615 BUG_ON(!list_empty(&fmt->sort_list)); in fmt_free()
617 if (fmt->free) in fmt_free()
618 fmt->free(fmt); in fmt_free()
623 struct perf_hpp_fmt *fmt, *tmp; in perf_hpp__reset_output_field() local
626 perf_hpp_list__for_each_format_safe(list, fmt, tmp) { in perf_hpp__reset_output_field()
627 list_del_init(&fmt->list); in perf_hpp__reset_output_field()
628 list_del_init(&fmt->sort_list); in perf_hpp__reset_output_field()
629 fmt_free(fmt); in perf_hpp__reset_output_field()
633 perf_hpp_list__for_each_sort_list_safe(list, fmt, tmp) { in perf_hpp__reset_output_field()
634 list_del_init(&fmt->list); in perf_hpp__reset_output_field()
635 list_del_init(&fmt->sort_list); in perf_hpp__reset_output_field()
636 fmt_free(fmt); in perf_hpp__reset_output_field()
645 struct perf_hpp_fmt *fmt; in hists__sort_list_width() local
650 hists__for_each_format(hists, fmt) { in hists__sort_list_width()
651 if (perf_hpp__should_skip(fmt, hists)) in hists__sort_list_width()
659 ret += fmt->width(fmt, &dummy_hpp, hists); in hists__sort_list_width()
670 struct perf_hpp_fmt *fmt; in hists__overhead_width() local
675 hists__for_each_format(hists, fmt) { in hists__overhead_width()
676 if (perf_hpp__is_sort_entry(fmt) || perf_hpp__is_dynamic_entry(fmt)) in hists__overhead_width()
684 ret += fmt->width(fmt, &dummy_hpp, hists); in hists__overhead_width()
690 void perf_hpp__reset_width(struct perf_hpp_fmt *fmt, struct hists *hists) in perf_hpp__reset_width() argument
692 if (perf_hpp__is_sort_entry(fmt)) in perf_hpp__reset_width()
693 return perf_hpp__reset_sort_width(fmt, hists); in perf_hpp__reset_width()
695 if (perf_hpp__is_dynamic_entry(fmt)) in perf_hpp__reset_width()
698 BUG_ON(fmt->idx >= PERF_HPP__MAX_INDEX); in perf_hpp__reset_width()
700 switch (fmt->idx) { in perf_hpp__reset_width()
705 fmt->len = 8; in perf_hpp__reset_width()
710 fmt->len = 9; in perf_hpp__reset_width()
715 fmt->len = 12; in perf_hpp__reset_width()
725 struct perf_hpp_fmt *fmt; in hists__reset_column_width() local
728 hists__for_each_format(hists, fmt) in hists__reset_column_width()
729 perf_hpp__reset_width(fmt, hists); in hists__reset_column_width()
733 perf_hpp_list__for_each_format(&node->hpp, fmt) in hists__reset_column_width()
734 perf_hpp__reset_width(fmt, hists); in hists__reset_column_width()
740 struct perf_hpp_fmt *fmt; in perf_hpp__set_user_width() local
743 perf_hpp_list__for_each_format(&perf_hpp_list, fmt) { in perf_hpp__set_user_width()
747 fmt->user_len = len; in perf_hpp__set_user_width()
756 static int add_hierarchy_fmt(struct hists *hists, struct perf_hpp_fmt *fmt) in add_hierarchy_fmt() argument
761 bool skip = perf_hpp__should_skip(fmt, hists); in add_hierarchy_fmt()
764 if (node->level == fmt->level) { in add_hierarchy_fmt()
776 node->level = fmt->level; in add_hierarchy_fmt()
783 fmt_copy = perf_hpp_fmt__dup(fmt); in add_hierarchy_fmt()
800 struct perf_hpp_fmt *fmt; in perf_hpp__setup_hists_formats() local
810 perf_hpp_list__for_each_sort_list(list, fmt) { in perf_hpp__setup_hists_formats()
811 if (perf_hpp__is_dynamic_entry(fmt) && in perf_hpp__setup_hists_formats()
812 !perf_hpp__defined_dynamic_entry(fmt, hists)) in perf_hpp__setup_hists_formats()
815 ret = add_hierarchy_fmt(hists, fmt); in perf_hpp__setup_hists_formats()