Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1457159rdg; Sat, 12 Aug 2023 01:54:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEgXH0ocxDzcXq5syviC6eWDH5EOJrw3orqHDwhvRC8c0ZyYLQ8+ZjYoDssfRvmwHbr6Xol X-Received: by 2002:a05:6a21:6d98:b0:143:c453:814c with SMTP id wl24-20020a056a216d9800b00143c453814cmr614110pzb.18.1691830469802; Sat, 12 Aug 2023 01:54:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691830469; cv=none; d=google.com; s=arc-20160816; b=ofoa8KDq/bHLQEb+1Ud8QZ/l1uW+zdCoUirsz0ThMSWzmMLTuvpY8rtvR+AKLJi5BN xLltoY6p486ogUMR6r2ova+hS35C+iJTZuVyUEfYAF0TizT+fuekDVkduqp76d3Nwq+r siwTVdBS9WucdxZQyvDKbp8r9eLElAQA2O2uuTbrODRrYAfT0xSMtR6t307OuZmNLD7V 9yPwW6J3GaeST6mI7ZXe286GgoMnISORywHP5zOzOINv9smuc3nPLknKPjjtQRqe55ab U5KbOUtakqtCuB1DSXOUUsCdk0GrJeV15+fPM7cYE4EI7H6/mqbIw6HppegNT+V/iutc C0ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Wm6q+g3l9ssiz+RB/yg9MkdW7DGoZwpl32LMZPdE2UU=; fh=yJzUIAXk3G9GFZhd7AEi53Yh6JaeRXiXWLsFmPRnLKo=; b=HJLVn9DSAkOHugvrtI/PZN1T8Xu4A+FxwfV0VyRTyGDgdT3TGmRKqMLJ62/PVf0Qbg jGZaTXh0Fhtas2Qluxa+I+ifbcfasa0dvTpUjNIO6hv6sMu32GT+WldSeM3bYfhxqjDb zpQwc6yxMy0P7PIvsKKCIlpaUMeuL89XrY3SgGRM4y9RHfc5GFb5s6a7K2Ai8QzLq3cf 3JuAwtaApJXtwBA5NW65o21GZNICs3IhTHdMkp3QkpN8N8mvQ/aSmMQcS6HnaG+35qD1 aH3A5SbtP/AAEs7CD2ZiWPpDj0we6OHjp1OZhmvrSfY3B6kQoCZ3vVfwD5Gv6FmZpYM8 N5ig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n7-20020a6543c7000000b00563e7aa7e3asi4548425pgp.873.2023.08.12.01.54.17; Sat, 12 Aug 2023 01:54:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235501AbjHLIwl (ORCPT + 99 others); Sat, 12 Aug 2023 04:52:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbjHLIwE (ORCPT ); Sat, 12 Aug 2023 04:52:04 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB976268C; Sat, 12 Aug 2023 01:52:07 -0700 (PDT) Received: from kwepemm600003.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RNDpX04yWzNmSx; Sat, 12 Aug 2023 16:48:35 +0800 (CST) Received: from localhost.localdomain (10.67.174.95) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Sat, 12 Aug 2023 16:52:05 +0800 From: Yang Jihong To: , , , , , , , , , , , , , CC: Subject: [RFC v1 08/16] perf kwork: Add `root` parameter to work_sort() Date: Sat, 12 Aug 2023 08:49:09 +0000 Message-ID: <20230812084917.169338-9-yangjihong1@huawei.com> X-Mailer: git-send-email 2.30.GIT In-Reply-To: <20230812084917.169338-1-yangjihong1@huawei.com> References: <20230812084917.169338-1-yangjihong1@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.174.95] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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