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

1 // SPDX-License-Identifier: GPL-2.0
41 double avg = nr_samples ? (1.0 * val / nr_samples) : 0; in __hpp__fmt_print() local
43 return hpp__call_print_fn(hpp, print_fn, fmt, len, avg); in __hpp__fmt_print()
52 int samples; member
60 struct hists *hists = he->hists; in __hpp__fmt()
63 char *buf = hpp->buf; in __hpp__fmt()
64 size_t size = hpp->size; in __hpp__fmt()
69 nr_members = evsel->core.nr_members; in __hpp__fmt()
77 values[0].samples = he->stat.nr_events; in __hpp__fmt()
85 list_for_each_entry(pair, &he->pairs.head, pairs.node) { in __hpp__fmt()
87 if (values[i].hists != pair->hists) in __hpp__fmt()
91 values[i].samples = pair->stat.nr_events; in __hpp__fmt()
99 values[i].hists->stats.nr_samples == 0) in __hpp__fmt()
103 values[i].samples, fmt, len, in __hpp__fmt()
113 hpp->buf = buf; in __hpp__fmt()
114 hpp->size = size; in __hpp__fmt()
124 int len = max(fmt->user_len ?: fmt->len, (int)strlen(fmt->name)); in hpp__fmt()
132 len -= 2; /* 2 for a space and a % sign */ in hpp__fmt()
134 len -= 1; in hpp__fmt()
145 int len = fmt->user_len ?: fmt->len; in hpp__fmt_acc()
146 return snprintf(hpp->buf, hpp->size, " %*s", len - 1, "N/A"); in hpp__fmt_acc()
157 return -1; in field_cmp()
172 list_for_each_entry(pair, &a->pairs.head, pairs.node) { in hist_entry__new_pair()
173 struct evsel *evsel = hists_to_evsel(pair->hists); in hist_entry__new_pair()
177 list_for_each_entry(pair, &b->pairs.head, pairs.node) { in hist_entry__new_pair()
178 struct evsel *evsel = hists_to_evsel(pair->hists); in hist_entry__new_pair()
189 return -1; in hist_entry__new_pair()
195 struct evsel *evsel = hists_to_evsel(a->hists); in __hpp__group_sort_idx()
203 nr_members = evsel->core.nr_members; in __hpp__group_sort_idx()
249 evsel = hists_to_evsel(a->hists); in __hpp__sort()
253 nr_members = evsel->core.nr_members; in __hpp__sort()
284 if ((a->thread == NULL ? NULL : RC_CHK_ACCESS(a->thread)) != in __hpp__sort_acc()
285 (b->thread == NULL ? NULL : RC_CHK_ACCESS(b->thread)) || in __hpp__sort_acc()
289 ret = b->callchain->max_depth - a->callchain->max_depth; in __hpp__sort_acc()
291 ret = -ret; in __hpp__sort_acc()
300 int len = fmt->user_len ?: fmt->len; in hpp__width_fn()
309 evsel__hists(pos)->stats.nr_samples) 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()
327 return scnprintf(hpp->buf, hpp->size, "%*s", len, fmt->name); in hpp__header_fn()
333 ssize_t ssize = hpp->size; in hpp_color_scnprintf()
340 ret = percent_color_len_snprintf(hpp->buf, hpp->size, fmt, len, percent); in hpp_color_scnprintf()
343 return (ret >= ssize) ? (ssize - 1) : ret; in hpp_color_scnprintf()
349 ssize_t ssize = hpp->size; in hpp_entry_scnprintf()
353 ret = vsnprintf(hpp->buf, hpp->size, fmt, args); in hpp_entry_scnprintf()
356 return (ret >= ssize) ? (ssize - 1) : ret; in hpp_entry_scnprintf()
362 return he->stat._field; \
390 return he->stat_acc->_field; \
418 return he->stat._field; \
438 return he->stat._field; \
481 HPP_RAW_FNS(samples, nr_events) in HPP_PERCENT_FNS()
497 return a->header == hpp__header_fn; in perf_hpp__is_hpp_entry()
505 return a->idx == b->idx; in hpp__equal()
556 HPP__PRINT_FNS("Samples", samples, SAMPLES),
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()
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()
651 list_add_tail(&format->list, &list->fields); in perf_hpp_list__column_register()
657 list_add_tail(&format->sort_list, &list->sorts); in perf_hpp_list__register_sort_field()
663 list_add(&format->sort_list, &list->sorts); in perf_hpp_list__prepend_sort_field()
668 list_del_init(&format->list); in perf_hpp__column_unregister()
683 if (acc->equal(acc, 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()
695 return a->equal && a->equal(a, b); in fmt_equal()
706 /* skip sort-only fields ("sort_compute" in perf diff) */ in perf_hpp__setup_output_field()
707 if (!fmt->entry && !fmt->color) in perf_hpp__setup_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()
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()
779 ret += fmt->width(fmt, &dummy_hpp, hists); in hists__sort_list_width()
804 ret += fmt->width(fmt, &dummy_hpp, hists); in hists__overhead_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()
858 list_for_each_entry(node, &hists->hpp_formats, list) { in hists__reset_column_width()
859 perf_hpp_list__for_each_format(&node->hpp, fmt) in hists__reset_column_width()
873 fmt->user_len = len; in perf_hpp__set_user_width()
889 list_for_each_entry(node, &hists->hpp_formats, list) { in add_hierarchy_fmt()
890 if (node->level == fmt->level) { in add_hierarchy_fmt()
899 return -1; in add_hierarchy_fmt()
901 node->skip = skip; in add_hierarchy_fmt()
902 node->level = fmt->level; in add_hierarchy_fmt()
903 perf_hpp_list__init(&node->hpp); in add_hierarchy_fmt()
905 hists->nr_hpp_node++; in add_hierarchy_fmt()
906 list_add_tail(&node->list, &hists->hpp_formats); in add_hierarchy_fmt()
911 return -1; in add_hierarchy_fmt()
914 node->skip = false; in add_hierarchy_fmt()
916 list_add_tail(&fmt_copy->list, &node->hpp.fields); in add_hierarchy_fmt()
917 list_add_tail(&fmt_copy->sort_list, &node->hpp.sorts); in add_hierarchy_fmt()