hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/tools/perf/tests/hists_common.c
....@@ -1,15 +1,17 @@
11 // SPDX-License-Identifier: GPL-2.0
22 #include <inttypes.h>
3
-#include "perf.h"
43 #include "util/debug.h"
4
+#include "util/dso.h"
5
+#include "util/event.h" // struct perf_sample
6
+#include "util/map.h"
57 #include "util/symbol.h"
68 #include "util/sort.h"
79 #include "util/evsel.h"
8
-#include "util/evlist.h"
910 #include "util/machine.h"
1011 #include "util/thread.h"
1112 #include "tests/hists_common.h"
1213 #include <linux/kernel.h>
14
+#include <linux/perf_event.h>
1315
1416 static struct {
1517 u32 pid;
....@@ -161,7 +163,7 @@
161163 void print_hists_in(struct hists *hists)
162164 {
163165 int i = 0;
164
- struct rb_root *root;
166
+ struct rb_root_cached *root;
165167 struct rb_node *node;
166168
167169 if (hists__has(hists, need_collapse))
....@@ -170,7 +172,7 @@
170172 root = hists->entries_in;
171173
172174 pr_info("----- %s --------\n", __func__);
173
- node = rb_first(root);
175
+ node = rb_first_cached(root);
174176 while (node) {
175177 struct hist_entry *he;
176178
....@@ -191,13 +193,13 @@
191193 void print_hists_out(struct hists *hists)
192194 {
193195 int i = 0;
194
- struct rb_root *root;
196
+ struct rb_root_cached *root;
195197 struct rb_node *node;
196198
197199 root = &hists->entries;
198200
199201 pr_info("----- %s --------\n", __func__);
200
- node = rb_first(root);
202
+ node = rb_first_cached(root);
201203 while (node) {
202204 struct hist_entry *he;
203205