Lines Matching refs:hists

31 static bool hists__filter_entry_by_dso(struct hists *hists,
33 static bool hists__filter_entry_by_thread(struct hists *hists,
35 static bool hists__filter_entry_by_symbol(struct hists *hists,
37 static bool hists__filter_entry_by_socket(struct hists *hists,
40 u16 hists__col_len(struct hists *hists, enum hist_column col) in hists__col_len() argument
42 return hists->col_len[col]; in hists__col_len()
45 void hists__set_col_len(struct hists *hists, enum hist_column col, u16 len) in hists__set_col_len() argument
47 hists->col_len[col] = len; in hists__set_col_len()
50 bool hists__new_col_len(struct hists *hists, enum hist_column col, u16 len) in hists__new_col_len() argument
52 if (len > hists__col_len(hists, col)) { in hists__new_col_len()
53 hists__set_col_len(hists, col, len); in hists__new_col_len()
59 void hists__reset_col_len(struct hists *hists) in hists__reset_col_len() argument
64 hists__set_col_len(hists, col, 0); in hists__reset_col_len()
67 static void hists__set_unres_dso_col_len(struct hists *hists, int dso) in hists__set_unres_dso_col_len() argument
71 if (hists__col_len(hists, dso) < unresolved_col_width && in hists__set_unres_dso_col_len()
74 hists__set_col_len(hists, dso, unresolved_col_width); in hists__set_unres_dso_col_len()
77 void hists__calc_col_len(struct hists *hists, struct hist_entry *h) in hists__calc_col_len() argument
92 hists__new_col_len(hists, HISTC_SYMBOL, symlen); in hists__calc_col_len()
95 hists__new_col_len(hists, HISTC_SYMBOL, symlen); in hists__calc_col_len()
96 hists__set_unres_dso_col_len(hists, HISTC_DSO); in hists__calc_col_len()
100 if (hists__new_col_len(hists, HISTC_COMM, len)) in hists__calc_col_len()
101 hists__set_col_len(hists, HISTC_THREAD, len + 8); in hists__calc_col_len()
105 hists__new_col_len(hists, HISTC_DSO, len); in hists__calc_col_len()
109 hists__new_col_len(hists, HISTC_PARENT, h->parent->namelen); in hists__calc_col_len()
116 hists__new_col_len(hists, HISTC_SYMBOL_FROM, symlen); in hists__calc_col_len()
119 hists__new_col_len(hists, HISTC_DSO_FROM, symlen); in hists__calc_col_len()
122 hists__new_col_len(hists, HISTC_SYMBOL_FROM, symlen); in hists__calc_col_len()
123 hists__set_unres_dso_col_len(hists, HISTC_DSO_FROM); in hists__calc_col_len()
130 hists__new_col_len(hists, HISTC_SYMBOL_TO, symlen); in hists__calc_col_len()
133 hists__new_col_len(hists, HISTC_DSO_TO, symlen); in hists__calc_col_len()
136 hists__new_col_len(hists, HISTC_SYMBOL_TO, symlen); in hists__calc_col_len()
137 hists__set_unres_dso_col_len(hists, HISTC_DSO_TO); in hists__calc_col_len()
141 hists__new_col_len(hists, HISTC_SRCLINE_FROM, in hists__calc_col_len()
144 hists__new_col_len(hists, HISTC_SRCLINE_TO, in hists__calc_col_len()
152 hists__new_col_len(hists, HISTC_MEM_DADDR_SYMBOL, in hists__calc_col_len()
154 hists__new_col_len(hists, HISTC_MEM_DCACHELINE, in hists__calc_col_len()
158 hists__new_col_len(hists, HISTC_MEM_DADDR_SYMBOL, in hists__calc_col_len()
160 hists__new_col_len(hists, HISTC_MEM_DCACHELINE, in hists__calc_col_len()
167 hists__new_col_len(hists, HISTC_MEM_IADDR_SYMBOL, in hists__calc_col_len()
171 hists__new_col_len(hists, HISTC_MEM_IADDR_SYMBOL, in hists__calc_col_len()
177 hists__new_col_len(hists, HISTC_MEM_DADDR_DSO, in hists__calc_col_len()
181 hists__set_unres_dso_col_len(hists, HISTC_MEM_DADDR_DSO); in hists__calc_col_len()
184 hists__new_col_len(hists, HISTC_MEM_PHYS_DADDR, in hists__calc_col_len()
189 hists__new_col_len(hists, HISTC_MEM_DADDR_SYMBOL, symlen); in hists__calc_col_len()
190 hists__new_col_len(hists, HISTC_MEM_IADDR_SYMBOL, symlen); in hists__calc_col_len()
191 hists__set_unres_dso_col_len(hists, HISTC_MEM_DADDR_DSO); in hists__calc_col_len()
194 hists__new_col_len(hists, HISTC_CGROUP_ID, 20); in hists__calc_col_len()
195 hists__new_col_len(hists, HISTC_CPU, 3); in hists__calc_col_len()
196 hists__new_col_len(hists, HISTC_SOCKET, 6); in hists__calc_col_len()
197 hists__new_col_len(hists, HISTC_MEM_LOCKED, 6); in hists__calc_col_len()
198 hists__new_col_len(hists, HISTC_MEM_TLB, 22); in hists__calc_col_len()
199 hists__new_col_len(hists, HISTC_MEM_SNOOP, 12); in hists__calc_col_len()
200 hists__new_col_len(hists, HISTC_MEM_LVL, 21 + 3); in hists__calc_col_len()
201 hists__new_col_len(hists, HISTC_LOCAL_WEIGHT, 12); in hists__calc_col_len()
202 hists__new_col_len(hists, HISTC_GLOBAL_WEIGHT, 12); in hists__calc_col_len()
204 hists__new_col_len(hists, HISTC_TIME, 16); in hists__calc_col_len()
206 hists__new_col_len(hists, HISTC_TIME, 12); in hists__calc_col_len()
210 hists__new_col_len(hists, HISTC_SRCLINE, len); in hists__calc_col_len()
214 hists__new_col_len(hists, HISTC_SRCFILE, strlen(h->srcfile)); in hists__calc_col_len()
217 hists__new_col_len(hists, HISTC_TRANSACTION, in hists__calc_col_len()
221 hists__new_col_len(hists, HISTC_TRACE, strlen(h->trace_output)); in hists__calc_col_len()
224 void hists__output_recalc_col_len(struct hists *hists, int max_rows) in hists__output_recalc_col_len() argument
226 struct rb_node *next = rb_first_cached(&hists->entries); in hists__output_recalc_col_len()
230 hists__reset_col_len(hists); in hists__output_recalc_col_len()
235 hists__calc_col_len(hists, n); in hists__output_recalc_col_len()
296 static void hists__delete_entry(struct hists *hists, struct hist_entry *he);
298 static bool hists__decay_entry(struct hists *hists, struct hist_entry *he) in hists__decay_entry() argument
314 hists->stats.total_period -= diff; in hists__decay_entry()
316 hists->stats.total_non_filtered_period -= diff; in hists__decay_entry()
326 if (hists__decay_entry(hists, child)) in hists__decay_entry()
327 hists__delete_entry(hists, child); in hists__decay_entry()
334 static void hists__delete_entry(struct hists *hists, struct hist_entry *he) in hists__delete_entry() argument
343 if (hists__has(hists, need_collapse)) in hists__delete_entry()
344 root_in = &hists->entries_collapsed; in hists__delete_entry()
346 root_in = hists->entries_in; in hists__delete_entry()
347 root_out = &hists->entries; in hists__delete_entry()
353 --hists->nr_entries; in hists__delete_entry()
355 --hists->nr_non_filtered_entries; in hists__delete_entry()
360 void hists__decay_entries(struct hists *hists, bool zap_user, bool zap_kernel) in hists__decay_entries() argument
362 struct rb_node *next = rb_first_cached(&hists->entries); in hists__decay_entries()
370 hists__decay_entry(hists, n))) { in hists__decay_entries()
371 hists__delete_entry(hists, n); in hists__decay_entries()
376 void hists__delete_entries(struct hists *hists) in hists__delete_entries() argument
378 struct rb_node *next = rb_first_cached(&hists->entries); in hists__delete_entries()
385 hists__delete_entry(hists, n); in hists__delete_entries()
389 struct hist_entry *hists__get_entry(struct hists *hists, int idx) in hists__get_entry() argument
391 struct rb_node *next = rb_first_cached(&hists->entries); in hists__get_entry()
559 he->hists->callchain_period += period; in hist_entry__add_callchain_period()
561 he->hists->callchain_non_filtered_period += period; in hist_entry__add_callchain_period()
564 static struct hist_entry *hists__findnew_entry(struct hists *hists, in hists__findnew_entry() argument
577 p = &hists->entries_in->rb_root.rb_node; in hists__findnew_entry()
634 hists->nr_entries++; in hists__findnew_entry()
637 rb_insert_color_cached(&he->rb_node_in, hists->entries_in, leftmost); in hists__findnew_entry()
673 __hists__add_entry(struct hists *hists, in __hists__add_entry() argument
708 .hists = hists, in __hists__add_entry()
717 }, *he = hists__findnew_entry(hists, &entry, al, sample_self); in __hists__add_entry()
719 if (!hists->has_callchains && he && he->callchain_size != 0) in __hists__add_entry()
720 hists->has_callchains = true; in __hists__add_entry()
726 struct hist_entry *hists__add_entry(struct hists *hists, in hists__add_entry() argument
734 return __hists__add_entry(hists, al, sym_parent, bi, mi, NULL, in hists__add_entry()
738 struct hist_entry *hists__add_entry_ops(struct hists *hists, in hists__add_entry_ops() argument
747 return __hists__add_entry(hists, al, sym_parent, bi, mi, NULL, in hists__add_entry_ops()
751 struct hist_entry *hists__add_entry_block(struct hists *hists, in hists__add_entry_block() argument
757 .hists = hists, in hists__add_entry_block()
758 }, *he = hists__findnew_entry(hists, &entry, al, false); in hists__add_entry_block()
796 struct hists *hists = evsel__hists(iter->evsel); in iter_add_single_mem_entry() local
816 he = hists__add_entry(hists, al, iter->parent, NULL, mi, in iter_add_single_mem_entry()
830 struct hists *hists = evsel__hists(evsel); in iter_finish_mem_entry() local
837 hists__inc_nr_samples(hists, he->filtered); in iter_finish_mem_entry()
900 struct hists *hists = evsel__hists(evsel); in iter_add_next_branch_entry() local
918 he = hists__add_entry(hists, al, iter->parent, &bi[i], NULL, in iter_add_next_branch_entry()
923 hists__inc_nr_samples(hists, he->filtered); in iter_add_next_branch_entry()
1010 struct hists *hists = evsel__hists(evsel); in iter_add_single_cumulative_entry() local
1016 he = hists__add_entry(hists, al, iter->parent, NULL, NULL, in iter_add_single_cumulative_entry()
1032 hists__inc_nr_samples(hists, he->filtered); in iter_add_single_cumulative_entry()
1059 .hists = evsel__hists(evsel), in iter_add_next_cumulative_entry()
1202 struct hists *hists = left->hists; in hist_entry__cmp() local
1206 hists__for_each_sort_list(hists, fmt) { in hist_entry__cmp()
1208 !perf_hpp__defined_dynamic_entry(fmt, hists)) in hist_entry__cmp()
1222 struct hists *hists = left->hists; in hist_entry__collapse() local
1226 hists__for_each_sort_list(hists, fmt) { in hist_entry__collapse()
1228 !perf_hpp__defined_dynamic_entry(fmt, hists)) in hist_entry__collapse()
1284 if (!list_is_last(&fmt->list, &he->hists->hpp_list->fields)) { in hist_entry__snprintf_alignment()
1285 const int width = fmt->width(fmt, hpp, he->hists); in hist_entry__snprintf_alignment()
1299 static void hists__apply_filters(struct hists *hists, struct hist_entry *he);
1300 static void hists__remove_entry_filter(struct hists *hists, struct hist_entry *he,
1391 hists__apply_filters(he->hists, he); in hist_entry__apply_hierarchy_filters()
1394 static struct hist_entry *hierarchy_insert_entry(struct hists *hists, in hierarchy_insert_entry() argument
1435 hists->nr_entries++; in hierarchy_insert_entry()
1466 static int hists__hierarchy_insert_entry(struct hists *hists, in hists__hierarchy_insert_entry() argument
1476 list_for_each_entry(node, &hists->hpp_formats, list) { in hists__hierarchy_insert_entry()
1482 new_he = hierarchy_insert_entry(hists, root, he, parent, &node->hpp); in hists__hierarchy_insert_entry()
1513 static int hists__collapse_insert_entry(struct hists *hists, in hists__collapse_insert_entry() argument
1524 return hists__hierarchy_insert_entry(hists, root, he); in hists__collapse_insert_entry()
1557 hists->nr_entries++; in hists__collapse_insert_entry()
1564 struct rb_root_cached *hists__get_rotate_entries_in(struct hists *hists) in hists__get_rotate_entries_in() argument
1568 pthread_mutex_lock(&hists->lock); in hists__get_rotate_entries_in()
1570 root = hists->entries_in; in hists__get_rotate_entries_in()
1571 if (++hists->entries_in > &hists->entries_in_array[1]) in hists__get_rotate_entries_in()
1572 hists->entries_in = &hists->entries_in_array[0]; in hists__get_rotate_entries_in()
1574 pthread_mutex_unlock(&hists->lock); in hists__get_rotate_entries_in()
1579 static void hists__apply_filters(struct hists *hists, struct hist_entry *he) in hists__apply_filters() argument
1581 hists__filter_entry_by_dso(hists, he); in hists__apply_filters()
1582 hists__filter_entry_by_thread(hists, he); in hists__apply_filters()
1583 hists__filter_entry_by_symbol(hists, he); in hists__apply_filters()
1584 hists__filter_entry_by_socket(hists, he); in hists__apply_filters()
1587 int hists__collapse_resort(struct hists *hists, struct ui_progress *prog) in hists__collapse_resort() argument
1594 if (!hists__has(hists, need_collapse)) in hists__collapse_resort()
1597 hists->nr_entries = 0; in hists__collapse_resort()
1599 root = hists__get_rotate_entries_in(hists); in hists__collapse_resort()
1610 ret = hists__collapse_insert_entry(hists, &hists->entries_collapsed, n); in hists__collapse_resort()
1620 hists__apply_filters(hists, n); in hists__collapse_resort()
1630 struct hists *hists = a->hists; in hist_entry__sort() local
1634 hists__for_each_sort_list(hists, fmt) { in hist_entry__sort()
1635 if (perf_hpp__should_skip(fmt, a->hists)) in hist_entry__sort()
1646 static void hists__reset_filter_stats(struct hists *hists) in hists__reset_filter_stats() argument
1648 hists->nr_non_filtered_entries = 0; in hists__reset_filter_stats()
1649 hists->stats.total_non_filtered_period = 0; in hists__reset_filter_stats()
1652 void hists__reset_stats(struct hists *hists) in hists__reset_stats() argument
1654 hists->nr_entries = 0; in hists__reset_stats()
1655 hists->stats.total_period = 0; in hists__reset_stats()
1657 hists__reset_filter_stats(hists); in hists__reset_stats()
1660 static void hists__inc_filter_stats(struct hists *hists, struct hist_entry *h) in hists__inc_filter_stats() argument
1662 hists->nr_non_filtered_entries++; in hists__inc_filter_stats()
1663 hists->stats.total_non_filtered_period += h->stat.period; in hists__inc_filter_stats()
1666 void hists__inc_stats(struct hists *hists, struct hist_entry *h) in hists__inc_stats() argument
1669 hists__inc_filter_stats(hists, h); in hists__inc_stats()
1671 hists->nr_entries++; in hists__inc_stats()
1672 hists->stats.total_period += h->stat.period; in hists__inc_stats()
1675 static void hierarchy_recalc_total_periods(struct hists *hists) in hierarchy_recalc_total_periods() argument
1680 node = rb_first_cached(&hists->entries); in hierarchy_recalc_total_periods()
1682 hists->stats.total_period = 0; in hierarchy_recalc_total_periods()
1683 hists->stats.total_non_filtered_period = 0; in hierarchy_recalc_total_periods()
1694 hists->stats.total_period += he->stat.period; in hierarchy_recalc_total_periods()
1696 hists->stats.total_non_filtered_period += he->stat.period; in hierarchy_recalc_total_periods()
1731 static void hists__hierarchy_output_resort(struct hists *hists, in hists__hierarchy_output_resort() argument
1753 hists->nr_entries++; in hists__hierarchy_output_resort()
1755 hists->nr_non_filtered_entries++; in hists__hierarchy_output_resort()
1756 hists__calc_col_len(hists, he); in hists__hierarchy_output_resort()
1760 hists__hierarchy_output_resort(hists, prog, in hists__hierarchy_output_resort()
1826 perf_hpp__defined_dynamic_entry(fmt, he->hists)) in __hists__insert_output_entry()
1831 static void output_resort(struct hists *hists, struct ui_progress *prog, in output_resort() argument
1841 callchain_total = hists->callchain_period; in output_resort()
1843 callchain_total = hists->callchain_non_filtered_period; in output_resort()
1847 hists__reset_stats(hists); in output_resort()
1848 hists__reset_col_len(hists); in output_resort()
1851 hists__hierarchy_output_resort(hists, prog, in output_resort()
1852 &hists->entries_collapsed, in output_resort()
1853 &hists->entries, in output_resort()
1856 hierarchy_recalc_total_periods(hists); in output_resort()
1860 if (hists__has(hists, need_collapse)) in output_resort()
1861 root = &hists->entries_collapsed; in output_resort()
1863 root = hists->entries_in; in output_resort()
1866 hists->entries = RB_ROOT_CACHED; in output_resort()
1875 __hists__insert_output_entry(&hists->entries, n, min_callchain_hits, use_callchain); in output_resort()
1876 hists__inc_stats(hists, n); in output_resort()
1879 hists__calc_col_len(hists, n); in output_resort()
1906 void hists__output_resort(struct hists *hists, struct ui_progress *prog) in hists__output_resort() argument
1908 output_resort(hists, prog, symbol_conf.use_callchain, NULL, NULL); in hists__output_resort()
1911 void hists__output_resort_cb(struct hists *hists, struct ui_progress *prog, in hists__output_resort_cb() argument
1914 output_resort(hists, prog, symbol_conf.use_callchain, cb, NULL); in hists__output_resort_cb()
1998 static void hists__remove_entry_filter(struct hists *hists, struct hist_entry *h, in hists__remove_entry_filter() argument
2033 hists->stats.nr_non_filtered_samples += h->stat.nr_events; in hists__remove_entry_filter()
2035 hists__inc_filter_stats(hists, h); in hists__remove_entry_filter()
2036 hists__calc_col_len(hists, h); in hists__remove_entry_filter()
2040 static bool hists__filter_entry_by_dso(struct hists *hists, in hists__filter_entry_by_dso() argument
2043 if (hists->dso_filter != NULL && in hists__filter_entry_by_dso()
2044 (he->ms.map == NULL || he->ms.map->dso != hists->dso_filter)) { in hists__filter_entry_by_dso()
2052 static bool hists__filter_entry_by_thread(struct hists *hists, in hists__filter_entry_by_thread() argument
2055 if (hists->thread_filter != NULL && in hists__filter_entry_by_thread()
2056 he->thread != hists->thread_filter) { in hists__filter_entry_by_thread()
2064 static bool hists__filter_entry_by_symbol(struct hists *hists, in hists__filter_entry_by_symbol() argument
2067 if (hists->symbol_filter_str != NULL && in hists__filter_entry_by_symbol()
2069 hists->symbol_filter_str) == NULL)) { in hists__filter_entry_by_symbol()
2077 static bool hists__filter_entry_by_socket(struct hists *hists, in hists__filter_entry_by_socket() argument
2080 if ((hists->socket_filter > -1) && in hists__filter_entry_by_socket()
2081 (he->socket != hists->socket_filter)) { in hists__filter_entry_by_socket()
2089 typedef bool (*filter_fn_t)(struct hists *hists, struct hist_entry *he);
2091 static void hists__filter_by_type(struct hists *hists, int type, filter_fn_t filter) in hists__filter_by_type() argument
2095 hists->stats.nr_non_filtered_samples = 0; in hists__filter_by_type()
2097 hists__reset_filter_stats(hists); in hists__filter_by_type()
2098 hists__reset_col_len(hists); in hists__filter_by_type()
2100 for (nd = rb_first_cached(&hists->entries); nd; nd = rb_next(nd)) { in hists__filter_by_type()
2103 if (filter(hists, h)) in hists__filter_by_type()
2106 hists__remove_entry_filter(hists, h, type); in hists__filter_by_type()
2151 static void hists__filter_hierarchy(struct hists *hists, int type, const void *arg) in hists__filter_hierarchy() argument
2156 hists->stats.nr_non_filtered_samples = 0; in hists__filter_hierarchy()
2158 hists__reset_filter_stats(hists); in hists__filter_hierarchy()
2159 hists__reset_col_len(hists); in hists__filter_hierarchy()
2161 nd = rb_first_cached(&hists->entries); in hists__filter_hierarchy()
2193 hists__remove_entry_filter(hists, h, type); in hists__filter_hierarchy()
2199 hierarchy_recalc_total_periods(hists); in hists__filter_hierarchy()
2205 nd = rb_first_cached(&hists->entries); in hists__filter_hierarchy()
2210 rb_erase_cached(&h->rb_node, &hists->entries); in hists__filter_hierarchy()
2215 hists->entries = new_root; in hists__filter_hierarchy()
2218 void hists__filter_by_thread(struct hists *hists) in hists__filter_by_thread() argument
2221 hists__filter_hierarchy(hists, HIST_FILTER__THREAD, in hists__filter_by_thread()
2222 hists->thread_filter); in hists__filter_by_thread()
2224 hists__filter_by_type(hists, HIST_FILTER__THREAD, in hists__filter_by_thread()
2228 void hists__filter_by_dso(struct hists *hists) in hists__filter_by_dso() argument
2231 hists__filter_hierarchy(hists, HIST_FILTER__DSO, in hists__filter_by_dso()
2232 hists->dso_filter); in hists__filter_by_dso()
2234 hists__filter_by_type(hists, HIST_FILTER__DSO, in hists__filter_by_dso()
2238 void hists__filter_by_symbol(struct hists *hists) in hists__filter_by_symbol() argument
2241 hists__filter_hierarchy(hists, HIST_FILTER__SYMBOL, in hists__filter_by_symbol()
2242 hists->symbol_filter_str); in hists__filter_by_symbol()
2244 hists__filter_by_type(hists, HIST_FILTER__SYMBOL, in hists__filter_by_symbol()
2248 void hists__filter_by_socket(struct hists *hists) in hists__filter_by_socket() argument
2251 hists__filter_hierarchy(hists, HIST_FILTER__SOCKET, in hists__filter_by_socket()
2252 &hists->socket_filter); in hists__filter_by_socket()
2254 hists__filter_by_type(hists, HIST_FILTER__SOCKET, in hists__filter_by_socket()
2264 void hists__inc_nr_events(struct hists *hists, u32 type) in hists__inc_nr_events() argument
2266 events_stats__inc(&hists->stats, type); in hists__inc_nr_events()
2269 void hists__inc_nr_samples(struct hists *hists, bool filtered) in hists__inc_nr_samples() argument
2271 events_stats__inc(&hists->stats, PERF_RECORD_SAMPLE); in hists__inc_nr_samples()
2273 hists->stats.nr_non_filtered_samples++; in hists__inc_nr_samples()
2276 static struct hist_entry *hists__add_dummy_entry(struct hists *hists, in hists__add_dummy_entry() argument
2286 if (hists__has(hists, need_collapse)) in hists__add_dummy_entry()
2287 root = &hists->entries_collapsed; in hists__add_dummy_entry()
2289 root = hists->entries_in; in hists__add_dummy_entry()
2313 he->hists = hists; in hists__add_dummy_entry()
2318 hists__inc_stats(hists, he); in hists__add_dummy_entry()
2325 static struct hist_entry *add_dummy_hierarchy_entry(struct hists *hists, in add_dummy_hierarchy_entry() argument
2364 he->hists = hists; in add_dummy_hierarchy_entry()
2366 hists__inc_stats(hists, he); in add_dummy_hierarchy_entry()
2372 static struct hist_entry *hists__find_entry(struct hists *hists, in hists__find_entry() argument
2377 if (hists__has(hists, need_collapse)) in hists__find_entry()
2378 n = hists->entries_collapsed.rb_root.rb_node; in hists__find_entry()
2380 n = hists->entries_in->rb_root.rb_node; in hists__find_entry()
2445 void hists__match(struct hists *leader, struct hists *other) in hists__match()
2471 static int hists__link_hierarchy(struct hists *leader_hists, in hists__link_hierarchy()
2486 if (leader->hists == leader_hists) { in hists__link_hierarchy()
2520 int hists__link(struct hists *leader, struct hists *other) in hists__link()
2552 int hists__unlink(struct hists *hists) in hists__unlink() argument
2558 if (hists__has(hists, need_collapse)) in hists__unlink()
2559 root = &hists->entries_collapsed; in hists__unlink()
2561 root = hists->entries_in; in hists__unlink()
2619 u64 hists__total_period(struct hists *hists) in hists__total_period() argument
2621 return symbol_conf.filter_relative ? hists->stats.total_non_filtered_period : in hists__total_period()
2622 hists->stats.total_period; in hists__total_period()
2625 int __hists__scnprintf_title(struct hists *hists, char *bf, size_t size, bool show_freq) in __hists__scnprintf_title() argument
2629 const struct dso *dso = hists->dso_filter; in __hists__scnprintf_title()
2630 struct thread *thread = hists->thread_filter; in __hists__scnprintf_title()
2631 int socket_id = hists->socket_filter; in __hists__scnprintf_title()
2632 unsigned long nr_samples = hists->stats.nr_events[PERF_RECORD_SAMPLE]; in __hists__scnprintf_title()
2633 u64 nr_events = hists->stats.total_period; in __hists__scnprintf_title()
2634 struct evsel *evsel = hists_to_evsel(hists); in __hists__scnprintf_title()
2642 nr_samples = hists->stats.nr_non_filtered_samples; in __hists__scnprintf_title()
2643 nr_events = hists->stats.total_non_filtered_period; in __hists__scnprintf_title()
2653 struct hists *pos_hists = evsel__hists(pos); in __hists__scnprintf_title()
2679 if (hists->uid_filter_str) in __hists__scnprintf_title()
2681 ", UID: %s", hists->uid_filter_str); in __hists__scnprintf_title()
2683 if (hists__has(hists, thread)) { in __hists__scnprintf_title()
2727 int __hists__init(struct hists *hists, struct perf_hpp_list *hpp_list) in __hists__init() argument
2729 memset(hists, 0, sizeof(*hists)); in __hists__init()
2730 hists->entries_in_array[0] = hists->entries_in_array[1] = RB_ROOT_CACHED; in __hists__init()
2731 hists->entries_in = &hists->entries_in_array[0]; in __hists__init()
2732 hists->entries_collapsed = RB_ROOT_CACHED; in __hists__init()
2733 hists->entries = RB_ROOT_CACHED; in __hists__init()
2734 pthread_mutex_init(&hists->lock, NULL); in __hists__init()
2735 hists->socket_filter = -1; in __hists__init()
2736 hists->hpp_list = hpp_list; in __hists__init()
2737 INIT_LIST_HEAD(&hists->hpp_formats); in __hists__init()
2755 static void hists__delete_all_entries(struct hists *hists) in hists__delete_all_entries() argument
2757 hists__delete_entries(hists); in hists__delete_all_entries()
2758 hists__delete_remaining_entries(&hists->entries_in_array[0]); in hists__delete_all_entries()
2759 hists__delete_remaining_entries(&hists->entries_in_array[1]); in hists__delete_all_entries()
2760 hists__delete_remaining_entries(&hists->entries_collapsed); in hists__delete_all_entries()
2765 struct hists *hists = evsel__hists(evsel); in hists_evsel__exit() local
2769 hists__delete_all_entries(hists); in hists_evsel__exit()
2771 list_for_each_entry_safe(node, tmp, &hists->hpp_formats, list) { in hists_evsel__exit()
2783 struct hists *hists = evsel__hists(evsel); in hists_evsel__init() local
2785 __hists__init(hists, &perf_hpp_list); in hists_evsel__init()