Lines Matching refs:fmt
11 #define hpp__call_print_fn(hpp, fn, fmt, ...) \ argument
13 int __ret = fn(hpp, fmt, ##__VA_ARGS__); \
19 hpp_field_fn get_field, const char *fmt, int len, in __hpp__fmt() argument
35 ret = hpp__call_print_fn(hpp, print_fn, fmt, len, percent); in __hpp__fmt()
37 ret = hpp__call_print_fn(hpp, print_fn, fmt, len, get_field(he)); in __hpp__fmt()
63 fmt, len, 0.0); in __hpp__fmt()
66 fmt, len, 0ULL); in __hpp__fmt()
71 ret += hpp__call_print_fn(hpp, print_fn, fmt, len, in __hpp__fmt()
74 ret += hpp__call_print_fn(hpp, print_fn, fmt, in __hpp__fmt()
89 fmt, len, 0.0); in __hpp__fmt()
92 fmt, len, 0ULL); in __hpp__fmt()
107 int hpp__fmt(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, in hpp__fmt() argument
111 int len = fmt->user_len ?: fmt->len; in hpp__fmt()
126 int hpp__fmt_acc(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, in hpp__fmt_acc() argument
131 int len = fmt->user_len ?: fmt->len; in hpp__fmt_acc()
135 return hpp__fmt(fmt, hpp, he, get_field, fmtstr, print_fn, fmt_percent); in hpp__fmt_acc()
215 static int hpp__width_fn(struct perf_hpp_fmt *fmt, in hpp__width_fn() argument
219 int len = fmt->user_len ?: fmt->len; in hpp__width_fn()
222 len = max(len, evsel->nr_members * fmt->len); in hpp__width_fn()
224 if (len < (int)strlen(fmt->name)) in hpp__width_fn()
225 len = strlen(fmt->name); in hpp__width_fn()
230 static int hpp__header_fn(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, in hpp__header_fn() argument
233 int len = hpp__width_fn(fmt, hpp, evsel); in hpp__header_fn()
234 return scnprintf(hpp->buf, hpp->size, "%*s", len, fmt->name); in hpp__header_fn()
237 static int hpp_color_scnprintf(struct perf_hpp *hpp, const char *fmt, ...) in hpp_color_scnprintf() argument
244 va_start(args, fmt); in hpp_color_scnprintf()
247 ret = percent_color_len_snprintf(hpp->buf, hpp->size, fmt, len, percent); in hpp_color_scnprintf()
253 static int hpp_entry_scnprintf(struct perf_hpp *hpp, const char *fmt, ...) in hpp_entry_scnprintf() argument
259 va_start(args, fmt); in hpp_entry_scnprintf()
260 ret = vsnprintf(hpp->buf, hpp->size, fmt, args); in hpp_entry_scnprintf()
272 static int hpp__color_##_type(struct perf_hpp_fmt *fmt, \
275 return hpp__fmt(fmt, hpp, he, he_get_##_field, " %*.2f%%", \
280 static int hpp__entry_##_type(struct perf_hpp_fmt *fmt, \
283 return hpp__fmt(fmt, hpp, he, he_get_##_field, " %*.2f%%", \
288 static int64_t hpp__sort_##_type(struct perf_hpp_fmt *fmt __maybe_unused, \
300 static int hpp__color_##_type(struct perf_hpp_fmt *fmt, \
303 return hpp__fmt_acc(fmt, hpp, he, he_get_acc_##_field, " %*.2f%%", \
308 static int hpp__entry_##_type(struct perf_hpp_fmt *fmt, \
311 return hpp__fmt_acc(fmt, hpp, he, he_get_acc_##_field, " %*.2f%%", \
316 static int64_t hpp__sort_##_type(struct perf_hpp_fmt *fmt __maybe_unused, \
328 static int hpp__entry_##_type(struct perf_hpp_fmt *fmt, \
331 return hpp__fmt(fmt, hpp, he, he_get_raw_##_field, " %*"PRIu64, \
336 static int64_t hpp__sort_##_type(struct perf_hpp_fmt *fmt __maybe_unused, \
367 static int64_t hpp__nop_cmp(struct perf_hpp_fmt *fmt __maybe_unused, in HPP_PERCENT_FNS()
450 struct perf_hpp_fmt *fmt = &perf_hpp__format[i]; in perf_hpp__init() local
452 INIT_LIST_HEAD(&fmt->list); in perf_hpp__init()
455 if (fmt->sort_list.next == NULL) in perf_hpp__init()
456 INIT_LIST_HEAD(&fmt->sort_list); in perf_hpp__init()
538 struct perf_hpp_fmt *fmt; in perf_hpp__setup_output_field() local
541 perf_hpp__for_each_sort_list(fmt) { in perf_hpp__setup_output_field()
542 if (!list_empty(&fmt->list)) in perf_hpp__setup_output_field()
550 if (perf_hpp__is_sort_entry(fmt)) { in perf_hpp__setup_output_field()
554 if (perf_hpp__same_sort_entry(pos, fmt)) in perf_hpp__setup_output_field()
559 perf_hpp__column_register(fmt); in perf_hpp__setup_output_field()
567 struct perf_hpp_fmt *fmt; in perf_hpp__append_sort_keys() local
570 perf_hpp__for_each_format(fmt) { in perf_hpp__append_sort_keys()
571 if (!list_empty(&fmt->sort_list)) in perf_hpp__append_sort_keys()
579 if (perf_hpp__is_sort_entry(fmt)) { in perf_hpp__append_sort_keys()
583 if (perf_hpp__same_sort_entry(pos, fmt)) in perf_hpp__append_sort_keys()
588 perf_hpp__register_sort_field(fmt); in perf_hpp__append_sort_keys()
596 struct perf_hpp_fmt *fmt, *tmp; in perf_hpp__reset_output_field() local
599 perf_hpp__for_each_format_safe(fmt, tmp) { in perf_hpp__reset_output_field()
600 list_del_init(&fmt->list); in perf_hpp__reset_output_field()
601 list_del_init(&fmt->sort_list); in perf_hpp__reset_output_field()
605 perf_hpp__for_each_sort_list_safe(fmt, tmp) { in perf_hpp__reset_output_field()
606 list_del_init(&fmt->list); in perf_hpp__reset_output_field()
607 list_del_init(&fmt->sort_list); in perf_hpp__reset_output_field()
616 struct perf_hpp_fmt *fmt; in hists__sort_list_width() local
621 perf_hpp__for_each_format(fmt) { in hists__sort_list_width()
622 if (perf_hpp__should_skip(fmt)) in hists__sort_list_width()
630 ret += fmt->width(fmt, &dummy_hpp, hists_to_evsel(hists)); in hists__sort_list_width()
639 void perf_hpp__reset_width(struct perf_hpp_fmt *fmt, struct hists *hists) in perf_hpp__reset_width() argument
643 if (perf_hpp__is_sort_entry(fmt)) in perf_hpp__reset_width()
644 return perf_hpp__reset_sort_width(fmt, hists); in perf_hpp__reset_width()
647 if (fmt == &perf_hpp__format[idx]) in perf_hpp__reset_width()
659 fmt->len = 8; in perf_hpp__reset_width()
664 fmt->len = 9; in perf_hpp__reset_width()
669 fmt->len = 12; in perf_hpp__reset_width()
679 struct perf_hpp_fmt *fmt; in perf_hpp__set_user_width() local
682 perf_hpp__for_each_format(fmt) { in perf_hpp__set_user_width()
686 fmt->user_len = len; in perf_hpp__set_user_width()