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.

Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Sandipan Das <sandipan.das@amd.com>
Link: https://lore.kernel.org/r/20230812084917.169338-9-yangjihong1@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Yang Jihong 2023-08-12 08:49:09 +00:00 committed by Arnaldo Carvalho de Melo
parent 38d8d013a5
commit b83b5071c0

View File

@ -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,