summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-kwork.c
diff options
context:
space:
mode:
authorYang Jihong <yangjihong1@huawei.com>2023-08-12 10:49:09 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2023-09-12 22:31:59 +0200
commitb83b5071c018c74e53833d2fe7011d6ce583957d (patch)
treefd6f04b0ac66c61e092b19a46485ff86d20c3e76 /tools/perf/builtin-kwork.c
parentperf kwork: Add sched record support (diff)
downloadlinux-b83b5071c018c74e53833d2fe7011d6ce583957d.tar.xz
linux-b83b5071c018c74e53833d2fe7011d6ce583957d.zip
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>
Diffstat (limited to 'tools/perf/builtin-kwork.c')
-rw-r--r--tools/perf/builtin-kwork.c6
1 files 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,