Lines Matching +full:avg +full:- +full:samples

1 // SPDX-License-Identifier: GPL-2.0
42 double avg = nr_samples ? (1.0 * val / nr_samples) : 0; in __hpp__fmt_print() local
44 return hpp__call_print_fn(hpp, print_fn, fmt, len, avg); in __hpp__fmt_print()
53 int samples; member
61 struct hists *hists = he->hists; in __hpp__fmt()
64 char *buf = hpp->buf; in __hpp__fmt()
65 size_t size = hpp->size; in __hpp__fmt()
70 nr_members = evsel->core.nr_members; in __hpp__fmt()
78 values[0].samples = he->stat.nr_events; in __hpp__fmt()
86 list_for_each_entry(pair, &he->pairs.head, pairs.node) { in __hpp__fmt()
88 if (values[i].hists != pair->hists) in __hpp__fmt()
92 values[i].samples = pair->stat.nr_events; in __hpp__fmt()
100 values[i].hists->stats.nr_samples == 0) in __hpp__fmt()
104 values[i].samples, fmt, len, in __hpp__fmt()
114 hpp->buf = buf; in __hpp__fmt()
115 hpp->size = size; in __hpp__fmt()
125 int len = max(fmt->user_len ?: fmt->len, (int)strlen(fmt->name)); in hpp__fmt()
133 len -= 2; /* 2 for a space and a % sign */ in hpp__fmt()
135 len -= 1; in hpp__fmt()
146 int len = fmt->user_len ?: fmt->len; in hpp__fmt_acc()
147 return snprintf(hpp->buf, hpp->size, " %*s", len - 1, "N/A"); in hpp__fmt_acc()
158 return -1; in field_cmp()
173 list_for_each_entry(pair, &a->pairs.head, pairs.node) { in hist_entry__new_pair()
174 struct evsel *evsel = hists_to_evsel(pair->hists); in hist_entry__new_pair()
178 list_for_each_entry(pair, &b->pairs.head, pairs.node) { in hist_entry__new_pair()
179 struct evsel *evsel = hists_to_evsel(pair->hists); in hist_entry__new_pair()
190 return -1; in hist_entry__new_pair()
196 struct evsel *evsel = hists_to_evsel(a->hists); in __hpp__group_sort_idx()
204 nr_members = evsel->core.nr_members; in __hpp__group_sort_idx()
250 evsel = hists_to_evsel(a->hists); in __hpp__sort()
254 nr_members = evsel->core.nr_members; in __hpp__sort()
285 if ((a->thread == NULL ? NULL : RC_CHK_ACCESS(a->thread)) != in __hpp__sort_acc()
286 (b->thread == NULL ? NULL : RC_CHK_ACCESS(b->thread)) || in __hpp__sort_acc()
290 ret = b->callchain->max_depth - a->callchain->max_depth; in __hpp__sort_acc()
292 ret = -ret; in __hpp__sort_acc()
301 int len = fmt->user_len ?: fmt->len; in hpp__width_fn()
310 evsel__hists(pos)->stats.nr_samples) in hpp__width_fn()
314 len = max(len, nr * fmt->len); in hpp__width_fn()
317 if (len < (int)strlen(fmt->name)) in hpp__width_fn()
318 len = strlen(fmt->name); in hpp__width_fn()
328 return scnprintf(hpp->buf, hpp->size, "%*s", len, fmt->name); in hpp__header_fn()
334 ssize_t ssize = hpp->size; in hpp_color_scnprintf()
341 ret = percent_color_len_snprintf(hpp->buf, hpp->size, fmt, len, percent); in hpp_color_scnprintf()
344 return (ret >= ssize) ? (ssize - 1) : ret; in hpp_color_scnprintf()
350 ssize_t ssize = hpp->size; in hpp_entry_scnprintf()
354 ret = vsnprintf(hpp->buf, hpp->size, fmt, args); in hpp_entry_scnprintf()
357 return (ret >= ssize) ? (ssize - 1) : ret; in hpp_entry_scnprintf()
363 return he->stat._field; \
391 return he->stat_acc->_field; \
419 return he->stat._field; \
439 return he->stat._field; \
484 HPP_RAW_FNS(samples, nr_events) in HPP_PERCENT_FNS()
500 return a->header == hpp__header_fn; in perf_hpp__is_hpp_entry()
508 return a->idx == b->idx; in hpp__equal()
561 HPP__PRINT_FNS("Samples", samples, SAMPLES),
602 BUG_ON(!list_empty(&fmt->list)); in fmt_free()
603 BUG_ON(!list_empty(&fmt->sort_list)); in fmt_free()
605 if (fmt->free) in fmt_free()
606 fmt->free(fmt); in fmt_free()
611 return a->equal && a->equal(a, b); in fmt_equal()
621 INIT_LIST_HEAD(&fmt->list); in perf_hpp__init()
624 if (fmt->sort_list.next == NULL) in perf_hpp__init()
625 INIT_LIST_HEAD(&fmt->sort_list); in perf_hpp__init()
681 list_add_tail(&format->list, &list->fields); in perf_hpp_list__column_register()
687 list_add_tail(&format->sort_list, &list->sorts); in perf_hpp_list__register_sort_field()
693 list_add(&format->sort_list, &list->sorts); in perf_hpp_list__prepend_sort_field()
698 list_del_init(&format->list); in perf_hpp__column_unregister()
720 fmt->name = "Overhead"; in perf_hpp__cancel_cumulate()
750 /* skip sort-only fields ("sort_compute" in perf diff) */ in perf_hpp__setup_output_field()
751 if (!fmt->entry && !fmt->color) in perf_hpp__setup_output_field()
791 list_del_init(&fmt->list); in perf_hpp__reset_output_field()
792 list_del_init(&fmt->sort_list); in perf_hpp__reset_output_field()
798 list_del_init(&fmt->list); in perf_hpp__reset_output_field()
799 list_del_init(&fmt->sort_list); in perf_hpp__reset_output_field()
823 ret += fmt->width(fmt, &dummy_hpp, hists); in hists__sort_list_width()
848 ret += fmt->width(fmt, &dummy_hpp, hists); in hists__overhead_width()
862 BUG_ON(fmt->idx >= PERF_HPP__MAX_INDEX); in perf_hpp__reset_width()
864 switch (fmt->idx) { in perf_hpp__reset_width()
870 fmt->len = 8; in perf_hpp__reset_width()
875 fmt->len = 9; in perf_hpp__reset_width()
880 fmt->len = 12; in perf_hpp__reset_width()
886 fmt->len = 8; in perf_hpp__reset_width()
903 list_for_each_entry(node, &hists->hpp_formats, list) { in hists__reset_column_width()
904 perf_hpp_list__for_each_format(&node->hpp, fmt) in hists__reset_column_width()
918 fmt->user_len = len; in perf_hpp__set_user_width()
934 list_for_each_entry(node, &hists->hpp_formats, list) { in add_hierarchy_fmt()
935 if (node->level == fmt->level) { in add_hierarchy_fmt()
944 return -1; in add_hierarchy_fmt()
946 node->skip = skip; in add_hierarchy_fmt()
947 node->level = fmt->level; in add_hierarchy_fmt()
948 perf_hpp_list__init(&node->hpp); in add_hierarchy_fmt()
950 hists->nr_hpp_node++; in add_hierarchy_fmt()
951 list_add_tail(&node->list, &hists->hpp_formats); in add_hierarchy_fmt()
956 return -1; in add_hierarchy_fmt()
959 node->skip = false; in add_hierarchy_fmt()
961 list_add_tail(&fmt_copy->list, &node->hpp.fields); in add_hierarchy_fmt()
962 list_add_tail(&fmt_copy->sort_list, &node->hpp.sorts); in add_hierarchy_fmt()