]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - tools/perf/builtin-top.c
perf top: Fix event group with more than two events
[mirror_ubuntu-jammy-kernel.git] / tools / perf / builtin-top.c
index 104dbb1095c511c03f95b3565da481a4e88d0f47..c3f95440e99cd713dfc23c7c157ad807d09bf11e 100644 (file)
@@ -273,6 +273,12 @@ static void perf_top__resort_hists(struct perf_top *t)
        evlist__for_each_entry(evlist, pos) {
                struct hists *hists = evsel__hists(pos);
 
+               /*
+                * unlink existing entries so that they can be linked
+                * in a correct order in hists__match() below.
+                */
+               hists__unlink(hists);
+
                if (evlist->enabled) {
                        if (t->zero) {
                                hists__delete_entries(hists);