Message ID | 20240723064902.124154-3-kuan-ying.lee@canonical.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C015C3DA63 for <linux-mm@archiver.kernel.org>; Tue, 23 Jul 2024 06:49:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DD8296B00C1; Tue, 23 Jul 2024 02:49:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D886B6B00C2; Tue, 23 Jul 2024 02:49:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BB48A6B00C3; Tue, 23 Jul 2024 02:49:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 9B4C76B00C1 for <linux-mm@kvack.org>; Tue, 23 Jul 2024 02:49:39 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 580C5A1C69 for <linux-mm@kvack.org>; Tue, 23 Jul 2024 06:49:39 +0000 (UTC) X-FDA: 82370091678.05.8F84E8F Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by imf04.hostedemail.com (Postfix) with ESMTP id 4FFDB4000A for <linux-mm@kvack.org>; Tue, 23 Jul 2024 06:49:37 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=canonical.com header.s=20210705 header.b=j69J5RcG; spf=pass (imf04.hostedemail.com: domain of kuan-ying.lee@canonical.com designates 185.125.188.123 as permitted sender) smtp.mailfrom=kuan-ying.lee@canonical.com; dmarc=pass (policy=none) header.from=canonical.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721717330; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=FZLjJAcXmHbLrd6SXPvE5R1r1QmGlvoXd3SP54bkBhg=; b=JXlIoxfsYOsErCbIJeZq4kmvJ1tJSPiH6/ROl0sF8KxmZn1LH3oqwVqDE5Ug6L3ZgiF6bR KyOb0cw7lsymcgs76DsCIY8WZmxtSttaHaJZM/hUjWG0tSsNij3e8zhefi0JlFnx5T67w4 o+FKlU+37jdbuqUkSNLorPVaqg9HsoI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721717330; a=rsa-sha256; cv=none; b=afgTwyCPXfRaosumSxAewmbVHa4I3f8W/3LWnW/QvcdIlBNVOyj9fXahOsbfGo9wy+l9Fu lKmrQYRAoOxYh5UoJhDeQmUctJnNADVEGaSDZuwMUAQM0g4em5+KcM6puJH5v37o1gtCH1 /knhKwsj/TgX09NAvJBb9nARbNvgy18= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=canonical.com header.s=20210705 header.b=j69J5RcG; spf=pass (imf04.hostedemail.com: domain of kuan-ying.lee@canonical.com designates 185.125.188.123 as permitted sender) smtp.mailfrom=kuan-ying.lee@canonical.com; dmarc=pass (policy=none) header.from=canonical.com Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 1936A400E1 for <linux-mm@kvack.org>; Tue, 23 Jul 2024 06:49:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1721717376; bh=FZLjJAcXmHbLrd6SXPvE5R1r1QmGlvoXd3SP54bkBhg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=j69J5RcGCzLUn5UlZ/qkrBR1Ps94MbfOkcZ5rtUQ5gQWBH9Gr+fVIia2RB7KYjZsg bALczu06VN9yjkRlqhCNpx6DlX61YnDYeRz2UvO8xVl0CF5bd0aYG3oR4zCXIFlh+Z aL1mbnh//8Lr2/s9RZ9RU/5SOoft5TZam0TF05hxSsT+E6g9L6yiVCFbLv/I/PzzKf 7fgXigCqXefQX47ITElK9prElTe60AU2alN80mbvY/x/buN6zk2E+YbLcP0kFn42cY 8IGQGjFmn2YRCCPFc0naJ2m7/wtdBU2TqYjF/Im3C+v2WgG41osL89/r72eSIDHhnv QkfTrMEuqHbXQ== Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-2cd4e722d82so1917765a91.3 for <linux-mm@kvack.org>; Mon, 22 Jul 2024 23:49:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721717375; x=1722322175; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FZLjJAcXmHbLrd6SXPvE5R1r1QmGlvoXd3SP54bkBhg=; b=wOIyfkDYXPhhGweZSq+JX98xK/OS7eYyom/paoQIGlyILl0a24UO/p+XDVX+gHZDcy 87919VuoLtoKyFrtMTODGFMyI5nvK5cEEpIM5ZnTh0uWVwRLrAy3jY8strBLTUoD2U0d 5J+sChzDVoPItFaOjSQ7Zm0uwhWUKSgnk8vTZuatOFdeqr6je6AZi6nRJ+v6e0GgkoGy Py31H368tmezuFHAiMwYVQCmT8IN4OeclojBkz87xe/XU59zNiK7GglJK3tNhJkj5uQM zmuDPOxkfqH66wXdPZyvRD5urCS6ttQUkAjEQmFEUPZncGYvxzYrULNTr8gwxKFC7UpJ mW8g== X-Gm-Message-State: AOJu0YzK4AJBWqc4ir8OqEmzcX1w86Z7OvGCYUThg4DKwheYSoX3L8RI qZ8VXUEmLgiwLyWShfCaBcQ+EphUcv/YBiiiCB9Kk+1QYnvu4nvbETCMoJ/SgAgbuX0VEckYePo tlGzhek0yyx1NfdUITx8qPti2dVrVzTMjEY5VG+/vNkM6CNWSujnr0t0bDEbEa4Tx X-Received: by 2002:a17:90b:1b01:b0:2c9:860c:7802 with SMTP id 98e67ed59e1d1-2cd274adcc9mr4794634a91.28.1721717374744; Mon, 22 Jul 2024 23:49:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEyHMUKv6gR8JgkHmVIVGpYTx4tb8B3QCJ9HWDbWwLfpovncTtZcuCPQHfoJdvHkml9CbbRnA== X-Received: by 2002:a17:90b:1b01:b0:2c9:860c:7802 with SMTP id 98e67ed59e1d1-2cd274adcc9mr4794620a91.28.1721717374355; Mon, 22 Jul 2024 23:49:34 -0700 (PDT) Received: from kylee-ThinkPad-E16-Gen-1.. ([122.147.171.160]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ccf7c5391bsm8354749a91.24.2024.07.22.23.49.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 23:49:34 -0700 (PDT) From: Kuan-Ying Lee <kuan-ying.lee@canonical.com> To: kuan-ying.lee@canonical.com, Andrew Morton <akpm@linux-foundation.org>, Jan Kiszka <jan.kiszka@siemens.com>, Kieran Bingham <kbingham@kernel.org>, Miklos Szeredi <mszeredi@redhat.com>, Christian Brauner <brauner@kernel.org>, Ian Kent <raven@themaw.net> Cc: linux-mm@kvack.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/5] scripts/gdb: add iteration function for rbtree Date: Tue, 23 Jul 2024 14:48:58 +0800 Message-Id: <20240723064902.124154-3-kuan-ying.lee@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240723064902.124154-1-kuan-ying.lee@canonical.com> References: <20240723064902.124154-1-kuan-ying.lee@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Stat-Signature: tnmrss6bimxu7ah61uomfwnhmtaz1aap X-Rspamd-Queue-Id: 4FFDB4000A X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1721717377-85667 X-HE-Meta: U2FsdGVkX1+0yADuclpwYLGJdRTwfXaszbLHW1rmuN26Ue00NVhhE5pWgXZAgknx8ScjuUCBqTJI3eEKFS4vOy282xs9UYzThVZdQZlxm5IPQP8slOGcTrEN7+sLS2dcIsv3Tl6EjvxDrNiYExvhcZCKuyxWnYi4+iaS37QzPr7xvkvCZOakkQELsF4ueDAgJo6eFRRDYxUeY+GBImHHJNIR31eI+Z5manlc+ZK5AB8mZj3b2ED4sQ/VC+MMflmIcuepB8AVQLjpodz9B7oyuU7QmIa0ITiWli3RIaFi9P+hq1OYRWcufxRQNZ1W+gPQ4mQY1CLILj9UPNmUc7l42Ndt0Ym6jyekfbV7ASbJFSPBNGNhZTQuP6hvZt/hb5Yr9Y9gdJLFke27XNsHEtLfTXoITw9bR3bxOUY5nTz26JnAUaK9MHVEqVAUHhS2WnONPLMoFVqxmWlHaZGJqZ1mgD/XGeRp8X8Id5SstuYDBnDdO4PLJlCK/Ywof9OtOv1HTc/Fvnfeli90yogKaiE/Nwq2dcONoNx5NvjYwGCpfRJE6kL2LMN5wAFCQTykGpDmRvq/zp/MRauZwNnrGDgOJ646hSEq9r4yKr9tE7FVuErDEL6rKF6d7x9Y/+qTWiErPT4W598GSBuhzvSJYKX+BrYW2lT4wTwOyAGlwWu6RG00mNMpXfpFEsdb9V1XIFlt/PBzchUIv0JCnqELKGCmqR1KEnaowWClIRTm5kSejLJqPHZXxh1ERHWk8y0ZWpX0g0tT3wt7g2rM9x5yxCUN22LG5gmQYQ6uCvFCcDvZDVRu7ASDHmFmqs9E1uTKWLr30UyOYlrq3/mXqSFZduThOv2vJK3Ljks5qjY+QbDFsCtba/96KkIgr6UGhqjGpTRJPlv9d3y+cufg96kZ3itrIvXlmS4OIQyG862d7bqqxojheUqUcvWRJPnXilrYubGrMl2uKOfYxuWhPi4m1ka R3gN8fNh 2F0/JpHHL4YzBuk+dFnMy54t5J6hH7BeAwLmKNbou6yiHlC+cKcfntEey6jzoFNAPygfgfIgb69NufB7UX6luspbEcWp15gYJhoHhyf76UjSeQeEX70UKPRPP60Gw8OYs7Hka7HmpsV+AwZLzHmfMN2aY2GfNZxjkntio5cjZqUSJokYxZqXn70Qb+hV69uaJDvb/B/WmIG0QntpVJWrvIK6Zwcs7YJvLSSh68ZowG2h9fVgziirQs28o+3pZEwaKbyOgixjqsuAYVBybWUPWA+5mlZB1cIC+t/T6TgXE775tqc8Vj9N0Mno324gj4CH3myusmZMTAC22FaAAZ31liyXbaoyjQXFlMQm0pFoq/OlQY9c9BoPq02BxfYZr2cnDEPhM X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
Fix some GDB command error and add some GDB commands
|
expand
|
diff --git a/scripts/gdb/linux/rbtree.py b/scripts/gdb/linux/rbtree.py index fe462855eefd..fcbcc5f4153c 100644 --- a/scripts/gdb/linux/rbtree.py +++ b/scripts/gdb/linux/rbtree.py @@ -9,6 +9,18 @@ from linux import utils rb_root_type = utils.CachedType("struct rb_root") rb_node_type = utils.CachedType("struct rb_node") +def rb_inorder_for_each(root): + def inorder(node): + if node: + yield from inorder(node['rb_left']) + yield node + yield from inorder(node['rb_right']) + + yield from inorder(root['rb_node']) + +def rb_inorder_for_each_entry(root, gdbtype, member): + for node in rb_inorder_for_each(root): + yield utils.container_of(node, gdbtype, member) def rb_first(root): if root.type == rb_root_type.get_type():
Add inorder iteration function for rbtree usage. This is a preparation patch for the next patch to fix the gdb mounts issue. Fixes: 2eea9ce4310d ("mounts: keep list of mounts in an rbtree") Cc: <stable@vger.kernel.org> Signed-off-by: Kuan-Ying Lee <kuan-ying.lee@canonical.com> --- scripts/gdb/linux/rbtree.py | 12 ++++++++++++ 1 file changed, 12 insertions(+)