Lines Matching refs:hists

34 static bool hists__filter_entry_by_dso(struct hists *hists,
36 static bool hists__filter_entry_by_thread(struct hists *hists,
38 static bool hists__filter_entry_by_symbol(struct hists *hists,
40 static bool hists__filter_entry_by_socket(struct hists *hists,
43 u16 hists__col_len(struct hists *hists, enum hist_column col) in hists__col_len() argument
45 return hists->col_len[col]; in hists__col_len()
48 void hists__set_col_len(struct hists *hists, enum hist_column col, u16 len) in hists__set_col_len() argument
50 hists->col_len[col] = len; in hists__set_col_len()
53 bool hists__new_col_len(struct hists *hists, enum hist_column col, u16 len) in hists__new_col_len() argument
55 if (len > hists__col_len(hists, col)) { in hists__new_col_len()
56 hists__set_col_len(hists, col, len); in hists__new_col_len()
62 void hists__reset_col_len(struct hists *hists) in hists__reset_col_len() argument
67 hists__set_col_len(hists, col, 0); in hists__reset_col_len()
70 static void hists__set_unres_dso_col_len(struct hists *hists, int dso) in hists__set_unres_dso_col_len() argument
74 if (hists__col_len(hists, dso) < unresolved_col_width && in hists__set_unres_dso_col_len()
77 hists__set_col_len(hists, dso, unresolved_col_width); in hists__set_unres_dso_col_len()
80 void hists__calc_col_len(struct hists *hists, struct hist_entry *h) in hists__calc_col_len() argument
97 hists__new_col_len(hists, HISTC_SYMBOL, symlen); in hists__calc_col_len()
100 hists__new_col_len(hists, HISTC_SYMBOL, symlen); in hists__calc_col_len()
101 hists__set_unres_dso_col_len(hists, HISTC_DSO); in hists__calc_col_len()
105 if (hists__new_col_len(hists, HISTC_COMM, len)) in hists__calc_col_len()
106 hists__set_col_len(hists, HISTC_THREAD, len + 8); in hists__calc_col_len()
110 hists__new_col_len(hists, HISTC_DSO, len); in hists__calc_col_len()
114 hists__new_col_len(hists, HISTC_PARENT, h->parent->namelen); in hists__calc_col_len()
121 hists__new_col_len(hists, HISTC_SYMBOL_FROM, symlen); in hists__calc_col_len()
124 hists__new_col_len(hists, HISTC_DSO_FROM, symlen); in hists__calc_col_len()
127 hists__new_col_len(hists, HISTC_SYMBOL_FROM, symlen); in hists__calc_col_len()
128 hists__new_col_len(hists, HISTC_ADDR_FROM, symlen); in hists__calc_col_len()
129 hists__set_unres_dso_col_len(hists, HISTC_DSO_FROM); in hists__calc_col_len()
136 hists__new_col_len(hists, HISTC_SYMBOL_TO, symlen); in hists__calc_col_len()
139 hists__new_col_len(hists, HISTC_DSO_TO, symlen); in hists__calc_col_len()
142 hists__new_col_len(hists, HISTC_SYMBOL_TO, symlen); in hists__calc_col_len()
143 hists__new_col_len(hists, HISTC_ADDR_TO, symlen); in hists__calc_col_len()
144 hists__set_unres_dso_col_len(hists, HISTC_DSO_TO); in hists__calc_col_len()
148 hists__new_col_len(hists, HISTC_SRCLINE_FROM, in hists__calc_col_len()
151 hists__new_col_len(hists, HISTC_SRCLINE_TO, in hists__calc_col_len()
159 hists__new_col_len(hists, HISTC_MEM_DADDR_SYMBOL, in hists__calc_col_len()
161 hists__new_col_len(hists, HISTC_MEM_DCACHELINE, in hists__calc_col_len()
165 hists__new_col_len(hists, HISTC_MEM_DADDR_SYMBOL, in hists__calc_col_len()
167 hists__new_col_len(hists, HISTC_MEM_DCACHELINE, in hists__calc_col_len()
174 hists__new_col_len(hists, HISTC_MEM_IADDR_SYMBOL, in hists__calc_col_len()
178 hists__new_col_len(hists, HISTC_MEM_IADDR_SYMBOL, in hists__calc_col_len()
184 hists__new_col_len(hists, HISTC_MEM_DADDR_DSO, in hists__calc_col_len()
188 hists__set_unres_dso_col_len(hists, HISTC_MEM_DADDR_DSO); in hists__calc_col_len()
191 hists__new_col_len(hists, HISTC_MEM_PHYS_DADDR, in hists__calc_col_len()
194 hists__new_col_len(hists, HISTC_MEM_DATA_PAGE_SIZE, in hists__calc_col_len()
199 hists__new_col_len(hists, HISTC_MEM_DADDR_SYMBOL, symlen); in hists__calc_col_len()
200 hists__new_col_len(hists, HISTC_MEM_IADDR_SYMBOL, symlen); in hists__calc_col_len()
201 hists__set_unres_dso_col_len(hists, HISTC_MEM_DADDR_DSO); in hists__calc_col_len()
204 hists__new_col_len(hists, HISTC_CGROUP, 6); in hists__calc_col_len()
205 hists__new_col_len(hists, HISTC_CGROUP_ID, 20); in hists__calc_col_len()
206 hists__new_col_len(hists, HISTC_CPU, 3); in hists__calc_col_len()
207 hists__new_col_len(hists, HISTC_SOCKET, 6); in hists__calc_col_len()
208 hists__new_col_len(hists, HISTC_MEM_LOCKED, 6); in hists__calc_col_len()
209 hists__new_col_len(hists, HISTC_MEM_TLB, 22); in hists__calc_col_len()
210 hists__new_col_len(hists, HISTC_MEM_SNOOP, 12); in hists__calc_col_len()
211 hists__new_col_len(hists, HISTC_MEM_LVL, 36 + 3); in hists__calc_col_len()
212 hists__new_col_len(hists, HISTC_LOCAL_WEIGHT, 12); in hists__calc_col_len()
213 hists__new_col_len(hists, HISTC_GLOBAL_WEIGHT, 12); in hists__calc_col_len()
214 hists__new_col_len(hists, HISTC_MEM_BLOCKED, 10); in hists__calc_col_len()
215 hists__new_col_len(hists, HISTC_LOCAL_INS_LAT, 13); in hists__calc_col_len()
216 hists__new_col_len(hists, HISTC_GLOBAL_INS_LAT, 13); in hists__calc_col_len()
217 hists__new_col_len(hists, HISTC_LOCAL_P_STAGE_CYC, 13); in hists__calc_col_len()
218 hists__new_col_len(hists, HISTC_GLOBAL_P_STAGE_CYC, 13); in hists__calc_col_len()
219 hists__new_col_len(hists, HISTC_ADDR, BITS_PER_LONG / 4 + 2); in hists__calc_col_len()
222 hists__new_col_len(hists, HISTC_TIME, 16); in hists__calc_col_len()
224 hists__new_col_len(hists, HISTC_TIME, 12); in hists__calc_col_len()
225 hists__new_col_len(hists, HISTC_CODE_PAGE_SIZE, 6); in hists__calc_col_len()
229 hists__new_col_len(hists, HISTC_SRCLINE, len); in hists__calc_col_len()
233 hists__new_col_len(hists, HISTC_SRCFILE, strlen(h->srcfile)); in hists__calc_col_len()
236 hists__new_col_len(hists, HISTC_TRANSACTION, in hists__calc_col_len()
240 hists__new_col_len(hists, HISTC_TRACE, strlen(h->trace_output)); in hists__calc_col_len()
249 hists__new_col_len(hists, HISTC_CGROUP, strlen(cgrp_name)); in hists__calc_col_len()
253 void hists__output_recalc_col_len(struct hists *hists, int max_rows) in hists__output_recalc_col_len() argument
255 struct rb_node *next = rb_first_cached(&hists->entries); in hists__output_recalc_col_len()
259 hists__reset_col_len(hists); in hists__output_recalc_col_len()
264 hists__calc_col_len(hists, n); in hists__output_recalc_col_len()
321 static void hists__delete_entry(struct hists *hists, struct hist_entry *he);
323 static bool hists__decay_entry(struct hists *hists, struct hist_entry *he) in hists__decay_entry() argument
339 hists->stats.total_period -= diff; in hists__decay_entry()
341 hists->stats.total_non_filtered_period -= diff; in hists__decay_entry()
351 if (hists__decay_entry(hists, child)) in hists__decay_entry()
352 hists__delete_entry(hists, child); in hists__decay_entry()
359 static void hists__delete_entry(struct hists *hists, struct hist_entry *he) in hists__delete_entry() argument
368 if (hists__has(hists, need_collapse)) in hists__delete_entry()
369 root_in = &hists->entries_collapsed; in hists__delete_entry()
371 root_in = hists->entries_in; in hists__delete_entry()
372 root_out = &hists->entries; in hists__delete_entry()
378 --hists->nr_entries; in hists__delete_entry()
380 --hists->nr_non_filtered_entries; in hists__delete_entry()
385 void hists__decay_entries(struct hists *hists, bool zap_user, bool zap_kernel) in hists__decay_entries() argument
387 struct rb_node *next = rb_first_cached(&hists->entries); in hists__decay_entries()
395 hists__decay_entry(hists, n))) { in hists__decay_entries()
396 hists__delete_entry(hists, n); in hists__decay_entries()
401 void hists__delete_entries(struct hists *hists) in hists__delete_entries() argument
403 struct rb_node *next = rb_first_cached(&hists->entries); in hists__delete_entries()
410 hists__delete_entry(hists, n); in hists__delete_entries()
414 struct hist_entry *hists__get_entry(struct hists *hists, int idx) in hists__get_entry() argument
416 struct rb_node *next = rb_first_cached(&hists->entries); in hists__get_entry()
586 he->hists->callchain_period += period; in hist_entry__add_callchain_period()
588 he->hists->callchain_non_filtered_period += period; in hist_entry__add_callchain_period()
591 static struct hist_entry *hists__findnew_entry(struct hists *hists, in hists__findnew_entry() argument
603 p = &hists->entries_in->rb_root.rb_node; in hists__findnew_entry()
661 hists->nr_entries++; in hists__findnew_entry()
664 rb_insert_color_cached(&he->rb_node_in, hists->entries_in, leftmost); in hists__findnew_entry()
700 __hists__add_entry(struct hists *hists, in __hists__add_entry() argument
738 .hists = hists, in __hists__add_entry()
752 }, *he = hists__findnew_entry(hists, &entry, al, sample_self); in __hists__add_entry()
754 if (!hists->has_callchains && he && he->callchain_size != 0) in __hists__add_entry()
755 hists->has_callchains = true; in __hists__add_entry()
761 struct hist_entry *hists__add_entry(struct hists *hists, in hists__add_entry() argument
770 return __hists__add_entry(hists, al, sym_parent, bi, mi, ki, NULL, in hists__add_entry()
774 struct hist_entry *hists__add_entry_ops(struct hists *hists, in hists__add_entry_ops() argument
784 return __hists__add_entry(hists, al, sym_parent, bi, mi, ki, NULL, in hists__add_entry_ops()
788 struct hist_entry *hists__add_entry_block(struct hists *hists, in hists__add_entry_block() argument
794 .hists = hists, in hists__add_entry_block()
800 }, *he = hists__findnew_entry(hists, &entry, al, false); in hists__add_entry_block()
838 struct hists *hists = evsel__hists(iter->evsel); in iter_add_single_mem_entry() local
858 he = hists__add_entry(hists, al, iter->parent, NULL, mi, NULL, in iter_add_single_mem_entry()
872 struct hists *hists = evsel__hists(evsel); in iter_finish_mem_entry() local
879 hists__inc_nr_samples(hists, he->filtered); in iter_finish_mem_entry()
945 struct hists *hists = evsel__hists(evsel); in iter_add_next_branch_entry() local
963 he = hists__add_entry(hists, al, iter->parent, &bi[i], NULL, NULL, in iter_add_next_branch_entry()
968 hists__inc_nr_samples(hists, he->filtered); in iter_add_next_branch_entry()
1059 struct hists *hists = evsel__hists(evsel); in iter_add_single_cumulative_entry() local
1065 he = hists__add_entry(hists, al, iter->parent, NULL, NULL, NULL, in iter_add_single_cumulative_entry()
1081 hists__inc_nr_samples(hists, he->filtered); in iter_add_single_cumulative_entry()
1122 .hists = evsel__hists(evsel), in iter_add_next_cumulative_entry()
1139 bool fast = hists__has(he_tmp.hists, sym); in iter_add_next_cumulative_entry()
1278 struct hists *hists = left->hists; in hist_entry__cmp() local
1282 hists__for_each_sort_list(hists, fmt) { in hist_entry__cmp()
1284 !perf_hpp__defined_dynamic_entry(fmt, hists)) in hist_entry__cmp()
1298 struct hists *hists = left->hists; in hist_entry__collapse() local
1302 hists__for_each_sort_list(hists, fmt) { in hist_entry__collapse()
1304 !perf_hpp__defined_dynamic_entry(fmt, hists)) in hist_entry__collapse()
1364 if (!list_is_last(&fmt->list, &he->hists->hpp_list->fields)) { in hist_entry__snprintf_alignment()
1365 const int width = fmt->width(fmt, hpp, he->hists); in hist_entry__snprintf_alignment()
1379 static void hists__apply_filters(struct hists *hists, struct hist_entry *he);
1380 static void hists__remove_entry_filter(struct hists *hists, struct hist_entry *he,
1471 hists__apply_filters(he->hists, he); in hist_entry__apply_hierarchy_filters()
1474 static struct hist_entry *hierarchy_insert_entry(struct hists *hists, in hierarchy_insert_entry() argument
1515 hists->nr_entries++; in hierarchy_insert_entry()
1546 static int hists__hierarchy_insert_entry(struct hists *hists, in hists__hierarchy_insert_entry() argument
1556 list_for_each_entry(node, &hists->hpp_formats, list) { in hists__hierarchy_insert_entry()
1562 new_he = hierarchy_insert_entry(hists, root, he, parent, &node->hpp); in hists__hierarchy_insert_entry()
1598 static int hists__collapse_insert_entry(struct hists *hists, in hists__collapse_insert_entry() argument
1609 return hists__hierarchy_insert_entry(hists, root, he); in hists__collapse_insert_entry()
1646 hists->nr_entries++; in hists__collapse_insert_entry()
1653 struct rb_root_cached *hists__get_rotate_entries_in(struct hists *hists) in hists__get_rotate_entries_in() argument
1657 mutex_lock(&hists->lock); in hists__get_rotate_entries_in()
1659 root = hists->entries_in; in hists__get_rotate_entries_in()
1660 if (++hists->entries_in > &hists->entries_in_array[1]) in hists__get_rotate_entries_in()
1661 hists->entries_in = &hists->entries_in_array[0]; in hists__get_rotate_entries_in()
1663 mutex_unlock(&hists->lock); in hists__get_rotate_entries_in()
1668 static void hists__apply_filters(struct hists *hists, struct hist_entry *he) in hists__apply_filters() argument
1670 hists__filter_entry_by_dso(hists, he); in hists__apply_filters()
1671 hists__filter_entry_by_thread(hists, he); in hists__apply_filters()
1672 hists__filter_entry_by_symbol(hists, he); in hists__apply_filters()
1673 hists__filter_entry_by_socket(hists, he); in hists__apply_filters()
1676 int hists__collapse_resort(struct hists *hists, struct ui_progress *prog) in hists__collapse_resort() argument
1683 if (!hists__has(hists, need_collapse)) in hists__collapse_resort()
1686 hists->nr_entries = 0; in hists__collapse_resort()
1688 root = hists__get_rotate_entries_in(hists); in hists__collapse_resort()
1699 ret = hists__collapse_insert_entry(hists, &hists->entries_collapsed, n); in hists__collapse_resort()
1709 hists__apply_filters(hists, n); in hists__collapse_resort()
1719 struct hists *hists = a->hists; in hist_entry__sort() local
1723 hists__for_each_sort_list(hists, fmt) { in hist_entry__sort()
1724 if (perf_hpp__should_skip(fmt, a->hists)) in hist_entry__sort()
1735 static void hists__reset_filter_stats(struct hists *hists) in hists__reset_filter_stats() argument
1737 hists->nr_non_filtered_entries = 0; in hists__reset_filter_stats()
1738 hists->stats.total_non_filtered_period = 0; in hists__reset_filter_stats()
1741 void hists__reset_stats(struct hists *hists) in hists__reset_stats() argument
1743 hists->nr_entries = 0; in hists__reset_stats()
1744 hists->stats.total_period = 0; in hists__reset_stats()
1746 hists__reset_filter_stats(hists); in hists__reset_stats()
1749 static void hists__inc_filter_stats(struct hists *hists, struct hist_entry *h) in hists__inc_filter_stats() argument
1751 hists->nr_non_filtered_entries++; in hists__inc_filter_stats()
1752 hists->stats.total_non_filtered_period += h->stat.period; in hists__inc_filter_stats()
1755 void hists__inc_stats(struct hists *hists, struct hist_entry *h) in hists__inc_stats() argument
1758 hists__inc_filter_stats(hists, h); in hists__inc_stats()
1760 hists->nr_entries++; in hists__inc_stats()
1761 hists->stats.total_period += h->stat.period; in hists__inc_stats()
1764 static void hierarchy_recalc_total_periods(struct hists *hists) in hierarchy_recalc_total_periods() argument
1769 node = rb_first_cached(&hists->entries); in hierarchy_recalc_total_periods()
1771 hists->stats.total_period = 0; in hierarchy_recalc_total_periods()
1772 hists->stats.total_non_filtered_period = 0; in hierarchy_recalc_total_periods()
1783 hists->stats.total_period += he->stat.period; in hierarchy_recalc_total_periods()
1785 hists->stats.total_non_filtered_period += he->stat.period; in hierarchy_recalc_total_periods()
1820 static void hists__hierarchy_output_resort(struct hists *hists, in hists__hierarchy_output_resort() argument
1842 hists->nr_entries++; in hists__hierarchy_output_resort()
1844 hists->nr_non_filtered_entries++; in hists__hierarchy_output_resort()
1845 hists__calc_col_len(hists, he); in hists__hierarchy_output_resort()
1849 hists__hierarchy_output_resort(hists, prog, in hists__hierarchy_output_resort()
1920 static void output_resort(struct hists *hists, struct ui_progress *prog, in output_resort() argument
1930 callchain_total = hists->callchain_period; in output_resort()
1932 callchain_total = hists->callchain_non_filtered_period; in output_resort()
1936 hists__reset_stats(hists); in output_resort()
1937 hists__reset_col_len(hists); in output_resort()
1940 hists__hierarchy_output_resort(hists, prog, in output_resort()
1941 &hists->entries_collapsed, in output_resort()
1942 &hists->entries, in output_resort()
1945 hierarchy_recalc_total_periods(hists); in output_resort()
1949 if (hists__has(hists, need_collapse)) in output_resort()
1950 root = &hists->entries_collapsed; in output_resort()
1952 root = hists->entries_in; in output_resort()
1955 hists->entries = RB_ROOT_CACHED; in output_resort()
1964 __hists__insert_output_entry(&hists->entries, n, min_callchain_hits, use_callchain); in output_resort()
1965 hists__inc_stats(hists, n); in output_resort()
1968 hists__calc_col_len(hists, n); in output_resort()
1995 void hists__output_resort(struct hists *hists, struct ui_progress *prog) in hists__output_resort() argument
1997 output_resort(hists, prog, symbol_conf.use_callchain, NULL, NULL); in hists__output_resort()
2000 void hists__output_resort_cb(struct hists *hists, struct ui_progress *prog, in hists__output_resort_cb() argument
2003 output_resort(hists, prog, symbol_conf.use_callchain, cb, NULL); in hists__output_resort_cb()
2087 static void hists__remove_entry_filter(struct hists *hists, struct hist_entry *h, in hists__remove_entry_filter() argument
2122 hists->stats.nr_non_filtered_samples += h->stat.nr_events; in hists__remove_entry_filter()
2124 hists__inc_filter_stats(hists, h); in hists__remove_entry_filter()
2125 hists__calc_col_len(hists, h); in hists__remove_entry_filter()
2129 static bool hists__filter_entry_by_dso(struct hists *hists, in hists__filter_entry_by_dso() argument
2132 if (hists->dso_filter != NULL && in hists__filter_entry_by_dso()
2133 (he->ms.map == NULL || map__dso(he->ms.map) != hists->dso_filter)) { in hists__filter_entry_by_dso()
2141 static bool hists__filter_entry_by_thread(struct hists *hists, in hists__filter_entry_by_thread() argument
2144 if (hists->thread_filter != NULL && in hists__filter_entry_by_thread()
2145 RC_CHK_ACCESS(he->thread) != RC_CHK_ACCESS(hists->thread_filter)) { in hists__filter_entry_by_thread()
2153 static bool hists__filter_entry_by_symbol(struct hists *hists, in hists__filter_entry_by_symbol() argument
2156 if (hists->symbol_filter_str != NULL && in hists__filter_entry_by_symbol()
2158 hists->symbol_filter_str) == NULL)) { in hists__filter_entry_by_symbol()
2166 static bool hists__filter_entry_by_socket(struct hists *hists, in hists__filter_entry_by_socket() argument
2169 if ((hists->socket_filter > -1) && in hists__filter_entry_by_socket()
2170 (he->socket != hists->socket_filter)) { in hists__filter_entry_by_socket()
2178 typedef bool (*filter_fn_t)(struct hists *hists, struct hist_entry *he);
2180 static void hists__filter_by_type(struct hists *hists, int type, filter_fn_t filter) in hists__filter_by_type() argument
2184 hists->stats.nr_non_filtered_samples = 0; in hists__filter_by_type()
2186 hists__reset_filter_stats(hists); in hists__filter_by_type()
2187 hists__reset_col_len(hists); in hists__filter_by_type()
2189 for (nd = rb_first_cached(&hists->entries); nd; nd = rb_next(nd)) { in hists__filter_by_type()
2192 if (filter(hists, h)) in hists__filter_by_type()
2195 hists__remove_entry_filter(hists, h, type); in hists__filter_by_type()
2240 static void hists__filter_hierarchy(struct hists *hists, int type, const void *arg) in hists__filter_hierarchy() argument
2245 hists->stats.nr_non_filtered_samples = 0; in hists__filter_hierarchy()
2247 hists__reset_filter_stats(hists); in hists__filter_hierarchy()
2248 hists__reset_col_len(hists); in hists__filter_hierarchy()
2250 nd = rb_first_cached(&hists->entries); in hists__filter_hierarchy()
2282 hists__remove_entry_filter(hists, h, type); in hists__filter_hierarchy()
2288 hierarchy_recalc_total_periods(hists); in hists__filter_hierarchy()
2294 nd = rb_first_cached(&hists->entries); in hists__filter_hierarchy()
2299 rb_erase_cached(&h->rb_node, &hists->entries); in hists__filter_hierarchy()
2304 hists->entries = new_root; in hists__filter_hierarchy()
2307 void hists__filter_by_thread(struct hists *hists) in hists__filter_by_thread() argument
2310 hists__filter_hierarchy(hists, HIST_FILTER__THREAD, in hists__filter_by_thread()
2311 hists->thread_filter); in hists__filter_by_thread()
2313 hists__filter_by_type(hists, HIST_FILTER__THREAD, in hists__filter_by_thread()
2317 void hists__filter_by_dso(struct hists *hists) in hists__filter_by_dso() argument
2320 hists__filter_hierarchy(hists, HIST_FILTER__DSO, in hists__filter_by_dso()
2321 hists->dso_filter); in hists__filter_by_dso()
2323 hists__filter_by_type(hists, HIST_FILTER__DSO, in hists__filter_by_dso()
2327 void hists__filter_by_symbol(struct hists *hists) in hists__filter_by_symbol() argument
2330 hists__filter_hierarchy(hists, HIST_FILTER__SYMBOL, in hists__filter_by_symbol()
2331 hists->symbol_filter_str); in hists__filter_by_symbol()
2333 hists__filter_by_type(hists, HIST_FILTER__SYMBOL, in hists__filter_by_symbol()
2337 void hists__filter_by_socket(struct hists *hists) in hists__filter_by_socket() argument
2340 hists__filter_hierarchy(hists, HIST_FILTER__SOCKET, in hists__filter_by_socket()
2341 &hists->socket_filter); in hists__filter_by_socket()
2343 hists__filter_by_type(hists, HIST_FILTER__SOCKET, in hists__filter_by_socket()
2358 void hists__inc_nr_events(struct hists *hists) in hists__inc_nr_events() argument
2360 hists_stats__inc(&hists->stats); in hists__inc_nr_events()
2363 void hists__inc_nr_samples(struct hists *hists, bool filtered) in hists__inc_nr_samples() argument
2365 hists_stats__inc(&hists->stats); in hists__inc_nr_samples()
2367 hists->stats.nr_non_filtered_samples++; in hists__inc_nr_samples()
2370 void hists__inc_nr_lost_samples(struct hists *hists, u32 lost) in hists__inc_nr_lost_samples() argument
2372 hists->stats.nr_lost_samples += lost; in hists__inc_nr_lost_samples()
2375 static struct hist_entry *hists__add_dummy_entry(struct hists *hists, in hists__add_dummy_entry() argument
2385 if (hists__has(hists, need_collapse)) in hists__add_dummy_entry()
2386 root = &hists->entries_collapsed; in hists__add_dummy_entry()
2388 root = hists->entries_in; in hists__add_dummy_entry()
2412 he->hists = hists; in hists__add_dummy_entry()
2417 hists__inc_stats(hists, he); in hists__add_dummy_entry()
2424 static struct hist_entry *add_dummy_hierarchy_entry(struct hists *hists, in add_dummy_hierarchy_entry() argument
2463 he->hists = hists; in add_dummy_hierarchy_entry()
2465 hists__inc_stats(hists, he); in add_dummy_hierarchy_entry()
2471 static struct hist_entry *hists__find_entry(struct hists *hists, in hists__find_entry() argument
2476 if (hists__has(hists, need_collapse)) in hists__find_entry()
2477 n = hists->entries_collapsed.rb_root.rb_node; in hists__find_entry()
2479 n = hists->entries_in->rb_root.rb_node; in hists__find_entry()
2544 void hists__match(struct hists *leader, struct hists *other) in hists__match()
2570 static int hists__link_hierarchy(struct hists *leader_hists, in hists__link_hierarchy()
2585 if (leader->hists == leader_hists) { in hists__link_hierarchy()
2619 int hists__link(struct hists *leader, struct hists *other) in hists__link()
2651 int hists__unlink(struct hists *hists) in hists__unlink() argument
2657 if (hists__has(hists, need_collapse)) in hists__unlink()
2658 root = &hists->entries_collapsed; in hists__unlink()
2660 root = hists->entries_in; in hists__unlink()
2716 struct hists *hists = evsel__hists(pos); in evlist__fprintf_nr_events() local
2718 if (skip_empty && !hists->stats.nr_samples && !hists->stats.nr_lost_samples) in evlist__fprintf_nr_events()
2722 if (hists->stats.nr_samples) in evlist__fprintf_nr_events()
2724 "SAMPLE", hists->stats.nr_samples); in evlist__fprintf_nr_events()
2725 if (hists->stats.nr_lost_samples) in evlist__fprintf_nr_events()
2727 "LOST_SAMPLES", hists->stats.nr_lost_samples); in evlist__fprintf_nr_events()
2734 u64 hists__total_period(struct hists *hists) in hists__total_period() argument
2736 return symbol_conf.filter_relative ? hists->stats.total_non_filtered_period : in hists__total_period()
2737 hists->stats.total_period; in hists__total_period()
2740 int __hists__scnprintf_title(struct hists *hists, char *bf, size_t size, bool show_freq) in __hists__scnprintf_title() argument
2744 const struct dso *dso = hists->dso_filter; in __hists__scnprintf_title()
2745 struct thread *thread = hists->thread_filter; in __hists__scnprintf_title()
2746 int socket_id = hists->socket_filter; in __hists__scnprintf_title()
2747 unsigned long nr_samples = hists->stats.nr_samples; in __hists__scnprintf_title()
2748 u64 nr_events = hists->stats.total_period; in __hists__scnprintf_title()
2749 struct evsel *evsel = hists_to_evsel(hists); in __hists__scnprintf_title()
2757 nr_samples = hists->stats.nr_non_filtered_samples; in __hists__scnprintf_title()
2758 nr_events = hists->stats.total_non_filtered_period; in __hists__scnprintf_title()
2768 struct hists *pos_hists = evsel__hists(pos); in __hists__scnprintf_title()
2794 if (hists->uid_filter_str) in __hists__scnprintf_title()
2796 ", UID: %s", hists->uid_filter_str); in __hists__scnprintf_title()
2798 if (hists__has(hists, thread)) { in __hists__scnprintf_title()
2842 int __hists__init(struct hists *hists, struct perf_hpp_list *hpp_list) in __hists__init() argument
2844 memset(hists, 0, sizeof(*hists)); in __hists__init()
2845 hists->entries_in_array[0] = hists->entries_in_array[1] = RB_ROOT_CACHED; in __hists__init()
2846 hists->entries_in = &hists->entries_in_array[0]; in __hists__init()
2847 hists->entries_collapsed = RB_ROOT_CACHED; in __hists__init()
2848 hists->entries = RB_ROOT_CACHED; in __hists__init()
2849 mutex_init(&hists->lock); in __hists__init()
2850 hists->socket_filter = -1; in __hists__init()
2851 hists->hpp_list = hpp_list; in __hists__init()
2852 INIT_LIST_HEAD(&hists->hpp_formats); in __hists__init()
2870 static void hists__delete_all_entries(struct hists *hists) in hists__delete_all_entries() argument
2872 hists__delete_entries(hists); in hists__delete_all_entries()
2873 hists__delete_remaining_entries(&hists->entries_in_array[0]); in hists__delete_all_entries()
2874 hists__delete_remaining_entries(&hists->entries_in_array[1]); in hists__delete_all_entries()
2875 hists__delete_remaining_entries(&hists->entries_collapsed); in hists__delete_all_entries()
2880 struct hists *hists = evsel__hists(evsel); in hists_evsel__exit() local
2884 hists__delete_all_entries(hists); in hists_evsel__exit()
2886 list_for_each_entry_safe(node, tmp, &hists->hpp_formats, list) { in hists_evsel__exit()
2898 struct hists *hists = evsel__hists(evsel); in hists_evsel__init() local
2900 __hists__init(hists, &perf_hpp_list); in hists_evsel__init()