Lines Matching refs:fmt
19 #define hpp__call_print_fn(hpp, fn, fmt, ...) \ argument
21 int __ret = fn(hpp, fmt, ##__VA_ARGS__); \
27 int nr_samples, const char *fmt, int len, in __hpp__fmt_print() argument
37 return hpp__call_print_fn(hpp, print_fn, fmt, len, percent); in __hpp__fmt_print()
43 return hpp__call_print_fn(hpp, print_fn, fmt, len, avg); in __hpp__fmt_print()
46 return hpp__call_print_fn(hpp, print_fn, fmt, len, val); in __hpp__fmt_print()
56 hpp_field_fn get_field, const char *fmt, int len, in __hpp__fmt() argument
103 values[i].samples, fmt, len, in __hpp__fmt()
119 int hpp__fmt(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, in hpp__fmt() argument
124 int len = fmt->user_len ?: fmt->len; in hpp__fmt()
139 int hpp__fmt_acc(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, in hpp__fmt_acc() argument
145 int len = fmt->user_len ?: fmt->len; in hpp__fmt_acc()
149 return hpp__fmt(fmt, hpp, he, get_field, fmtstr, print_fn, fmtype); in hpp__fmt_acc()
296 static int hpp__width_fn(struct perf_hpp_fmt *fmt, in hpp__width_fn() argument
300 int len = fmt->user_len ?: fmt->len; in hpp__width_fn()
313 len = max(len, nr * fmt->len); in hpp__width_fn()
316 if (len < (int)strlen(fmt->name)) in hpp__width_fn()
317 len = strlen(fmt->name); in hpp__width_fn()
322 static int hpp__header_fn(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, in hpp__header_fn() argument
326 int len = hpp__width_fn(fmt, hpp, hists); in hpp__header_fn()
327 return scnprintf(hpp->buf, hpp->size, "%*s", len, fmt->name); in hpp__header_fn()
330 int hpp_color_scnprintf(struct perf_hpp *hpp, const char *fmt, ...) in hpp_color_scnprintf() argument
337 va_start(args, fmt); in hpp_color_scnprintf()
340 ret = percent_color_len_snprintf(hpp->buf, hpp->size, fmt, len, percent); in hpp_color_scnprintf()
346 static int hpp_entry_scnprintf(struct perf_hpp *hpp, const char *fmt, ...) in hpp_entry_scnprintf() argument
352 va_start(args, fmt); in hpp_entry_scnprintf()
353 ret = vsnprintf(hpp->buf, hpp->size, fmt, args); in hpp_entry_scnprintf()
365 static int hpp__color_##_type(struct perf_hpp_fmt *fmt, \
368 return hpp__fmt(fmt, hpp, he, he_get_##_field, " %*.2f%%", \
373 static int hpp__entry_##_type(struct perf_hpp_fmt *fmt, \
376 return hpp__fmt(fmt, hpp, he, he_get_##_field, " %*.2f%%", \
381 static int64_t hpp__sort_##_type(struct perf_hpp_fmt *fmt __maybe_unused, \
393 static int hpp__color_##_type(struct perf_hpp_fmt *fmt, \
396 return hpp__fmt_acc(fmt, hpp, he, he_get_acc_##_field, " %*.2f%%", \
401 static int hpp__entry_##_type(struct perf_hpp_fmt *fmt, \
404 return hpp__fmt_acc(fmt, hpp, he, he_get_acc_##_field, " %*.2f%%", \
409 static int64_t hpp__sort_##_type(struct perf_hpp_fmt *fmt __maybe_unused, \
421 static int hpp__entry_##_type(struct perf_hpp_fmt *fmt, \
424 return hpp__fmt(fmt, hpp, he, he_get_raw_##_field, " %*"PRIu64, \
429 static int64_t hpp__sort_##_type(struct perf_hpp_fmt *fmt __maybe_unused, \
441 static int hpp__entry_##_type(struct perf_hpp_fmt *fmt, \
444 return hpp__fmt(fmt, hpp, he, he_get_##_field, " %*.1f", \
449 static int64_t hpp__sort_##_type(struct perf_hpp_fmt *fmt __maybe_unused, \
488 static int64_t hpp__nop_cmp(struct perf_hpp_fmt *fmt __maybe_unused, in HPP_PERCENT_FNS()
591 static void fmt_free(struct perf_hpp_fmt *fmt) in fmt_free() argument
597 BUG_ON(!list_empty(&fmt->list)); in fmt_free()
598 BUG_ON(!list_empty(&fmt->sort_list)); in fmt_free()
600 if (fmt->free) in fmt_free()
601 fmt->free(fmt); in fmt_free()
609 struct perf_hpp_fmt *fmt = &perf_hpp__format[i]; in perf_hpp__init() local
611 INIT_LIST_HEAD(&fmt->list); in perf_hpp__init()
614 if (fmt->sort_list.next == NULL) in perf_hpp__init()
615 INIT_LIST_HEAD(&fmt->sort_list); in perf_hpp__init()
674 struct perf_hpp_fmt *fmt, *acc, *ovh, *tmp; in perf_hpp__cancel_cumulate() local
682 perf_hpp_list__for_each_format_safe(&perf_hpp_list, fmt, tmp) { in perf_hpp__cancel_cumulate()
683 if (acc->equal(acc, fmt)) { in perf_hpp__cancel_cumulate()
684 perf_hpp__column_unregister(fmt); in perf_hpp__cancel_cumulate()
688 if (ovh->equal(ovh, fmt)) in perf_hpp__cancel_cumulate()
689 fmt->name = "Overhead"; in perf_hpp__cancel_cumulate()
700 struct perf_hpp_fmt *fmt; in perf_hpp__setup_output_field() local
703 perf_hpp_list__for_each_sort_list(list, fmt) { in perf_hpp__setup_output_field()
707 if (!fmt->entry && !fmt->color) in perf_hpp__setup_output_field()
711 if (fmt_equal(fmt, pos)) in perf_hpp__setup_output_field()
715 perf_hpp__column_register(fmt); in perf_hpp__setup_output_field()
723 struct perf_hpp_fmt *fmt; in perf_hpp__append_sort_keys() local
726 perf_hpp_list__for_each_format(list, fmt) { in perf_hpp__append_sort_keys()
730 if (fmt_equal(fmt, pos)) in perf_hpp__append_sort_keys()
734 perf_hpp__register_sort_field(fmt); in perf_hpp__append_sort_keys()
743 struct perf_hpp_fmt *fmt, *tmp; in perf_hpp__reset_output_field() local
746 perf_hpp_list__for_each_format_safe(list, fmt, tmp) { in perf_hpp__reset_output_field()
747 list_del_init(&fmt->list); in perf_hpp__reset_output_field()
748 list_del_init(&fmt->sort_list); in perf_hpp__reset_output_field()
749 fmt_free(fmt); in perf_hpp__reset_output_field()
753 perf_hpp_list__for_each_sort_list_safe(list, fmt, tmp) { in perf_hpp__reset_output_field()
754 list_del_init(&fmt->list); in perf_hpp__reset_output_field()
755 list_del_init(&fmt->sort_list); in perf_hpp__reset_output_field()
756 fmt_free(fmt); in perf_hpp__reset_output_field()
765 struct perf_hpp_fmt *fmt; in hists__sort_list_width() local
770 hists__for_each_format(hists, fmt) { in hists__sort_list_width()
771 if (perf_hpp__should_skip(fmt, hists)) in hists__sort_list_width()
779 ret += fmt->width(fmt, &dummy_hpp, hists); in hists__sort_list_width()
790 struct perf_hpp_fmt *fmt; in hists__overhead_width() local
795 hists__for_each_format(hists, fmt) { in hists__overhead_width()
796 if (perf_hpp__is_sort_entry(fmt) || perf_hpp__is_dynamic_entry(fmt)) in hists__overhead_width()
804 ret += fmt->width(fmt, &dummy_hpp, hists); in hists__overhead_width()
810 void perf_hpp__reset_width(struct perf_hpp_fmt *fmt, struct hists *hists) in perf_hpp__reset_width() argument
812 if (perf_hpp__is_sort_entry(fmt)) in perf_hpp__reset_width()
813 return perf_hpp__reset_sort_width(fmt, hists); in perf_hpp__reset_width()
815 if (perf_hpp__is_dynamic_entry(fmt)) in perf_hpp__reset_width()
818 BUG_ON(fmt->idx >= PERF_HPP__MAX_INDEX); in perf_hpp__reset_width()
820 switch (fmt->idx) { in perf_hpp__reset_width()
825 fmt->len = 8; in perf_hpp__reset_width()
830 fmt->len = 9; in perf_hpp__reset_width()
835 fmt->len = 12; in perf_hpp__reset_width()
841 fmt->len = 8; in perf_hpp__reset_width()
851 struct perf_hpp_fmt *fmt; in hists__reset_column_width() local
854 hists__for_each_format(hists, fmt) in hists__reset_column_width()
855 perf_hpp__reset_width(fmt, hists); in hists__reset_column_width()
859 perf_hpp_list__for_each_format(&node->hpp, fmt) in hists__reset_column_width()
860 perf_hpp__reset_width(fmt, hists); in hists__reset_column_width()
866 struct perf_hpp_fmt *fmt; in perf_hpp__set_user_width() local
869 perf_hpp_list__for_each_format(&perf_hpp_list, fmt) { in perf_hpp__set_user_width()
873 fmt->user_len = len; in perf_hpp__set_user_width()
882 static int add_hierarchy_fmt(struct hists *hists, struct perf_hpp_fmt *fmt) in add_hierarchy_fmt() argument
887 bool skip = perf_hpp__should_skip(fmt, hists); in add_hierarchy_fmt()
890 if (node->level == fmt->level) { in add_hierarchy_fmt()
902 node->level = fmt->level; in add_hierarchy_fmt()
909 fmt_copy = perf_hpp_fmt__dup(fmt); in add_hierarchy_fmt()
926 struct perf_hpp_fmt *fmt; in perf_hpp__setup_hists_formats() local
936 perf_hpp_list__for_each_sort_list(list, fmt) { in perf_hpp__setup_hists_formats()
937 if (perf_hpp__is_dynamic_entry(fmt) && in perf_hpp__setup_hists_formats()
938 !perf_hpp__defined_dynamic_entry(fmt, hists)) in perf_hpp__setup_hists_formats()
941 ret = add_hierarchy_fmt(hists, fmt); in perf_hpp__setup_hists_formats()