2023-08-12 08:54:30

by Yang Jihong

[permalink] [raw]
Subject: [RFC v1 08/16] perf kwork: Add `root` parameter to work_sort()

Add a `struct rb_root_cached *root` parameter to work_sort() to sort the
specified rb tree elements.

No functional change.

Signed-off-by: Yang Jihong <[email protected]>
---
tools/perf/builtin-kwork.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/builtin-kwork.c b/tools/perf/builtin-kwork.c
index 4e2b9103b9e0..7d93951c2ed2 100644
--- a/tools/perf/builtin-kwork.c
+++ b/tools/perf/builtin-kwork.c
@@ -1378,11 +1378,11 @@ static void print_bad_events(struct perf_kwork *kwork)
}
}

-static void work_sort(struct perf_kwork *kwork, struct kwork_class *class)
+static void work_sort(struct perf_kwork *kwork,
+ struct kwork_class *class, struct rb_root_cached *root)
{
struct rb_node *node;
struct kwork_work *data;
- struct rb_root_cached *root = &class->work_root;

pr_debug("Sorting %s ...\n", class->name);
for (;;) {
@@ -1402,7 +1402,7 @@ static void perf_kwork__sort(struct perf_kwork *kwork)
struct kwork_class *class;

list_for_each_entry(class, &kwork->class_list, list)
- work_sort(kwork, class);
+ work_sort(kwork, class, &class->work_root);
}

static int perf_kwork__check_config(struct perf_kwork *kwork,
--
2.30.GIT