Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2835757rdh; Sun, 26 Nov 2023 23:05:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IEns8HJQoOdA5ybP99NJk6cyAS1uA0ds/kxfm6l63rfPAGNtV/SodiuvLc55YH5BqLiZ4sY X-Received: by 2002:a05:6830:603:b0:6d7:f66d:b0ae with SMTP id w3-20020a056830060300b006d7f66db0aemr9414911oti.5.1701068753181; Sun, 26 Nov 2023 23:05:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701068753; cv=none; d=google.com; s=arc-20160816; b=m2wO6qLNOuy34hTy1ZocgN5ccAdfO/bBLZJaBfw43uN2t1askcF1qKGM3aECUxGEP+ npuXTW3KNb8xIvEPvJcqRNvvWYuqdBIUZSSt4mY8HKve3Dgll655x4Mt3e6Xqu75a3Tt AriRCS3OliHJ7qNz5aiVqhTzzm4VIluTf8so1j72Ydln5hbwXpN8CFlqW912ERZXvGLt k05D7epyPxY6680I4yYoCBRnWJfEEy51sUylx4n2hpM+D1XnHwg9cf/diH84l3cjjFqd JK1w1GgEFb3nWtfWmsvZTr/swQsjYZ5PnVU0QBrMlmYDyhUwLapEZcEN973MO+KUOuEp b5Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=9bckHyNJG5IsDCmEKDwalIObMqsZcNV3+pMVYGOWkZA=; fh=lJAO/ldCzN6v0Vpswh5nxv/2xf2pfjNEEdhMPRa0ItU=; b=PlQcOrDtmVKCPlHIxOpUGSQlHY9Fut6hunIR/x010Aas17SVeoQXs0dom1jekaMf8F y6svFsX3ZFZQ3npENPye3UERABv00LhFdoFPGjIL+XprntCm4OLehGwdQ5auFAK/UZMV IGySfmV/s0UpnI/5HfeR5KhdOyEx5Iks05sccjOwtlkWVLAW++cWYdpQwO05IXVVD4M2 rvKB4oCYJLx94YfVHDSwsqKRIOPz+Ei8+9KI69XCx8B//9jkYH44187I5C063nxrqATV YU4vW0rvqjbCpsWoWWPqa8othRc8oVo7ZWGp8AxZ77hSsUKbKIa6tNXcCsjuYuedyz62 9xCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Ir7dyl8P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id f23-20020a63f117000000b0059cc8d682dfsi9339071pgi.814.2023.11.26.23.05.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Nov 2023 23:05:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Ir7dyl8P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 1CAA9805F3FF; Sun, 26 Nov 2023 23:05:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229963AbjK0HFV (ORCPT + 99 others); Mon, 27 Nov 2023 02:05:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229947AbjK0HFR (ORCPT ); Mon, 27 Nov 2023 02:05:17 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 867D5134; Sun, 26 Nov 2023 23:05:23 -0800 (PST) X-UUID: 52a7dde48cf311ee8051498923ad61e6-20231127 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=9bckHyNJG5IsDCmEKDwalIObMqsZcNV3+pMVYGOWkZA=; b=Ir7dyl8PjdmMjC+E7j7WJKdu7+hMtFfdIN58H9s//k+s7NSqJSzGhW86Vxfc6zWzeQVyThe33zlJ/oSxxEjzKQ2OFFg2OSgpkYT7+DXd9XHueqj4wspARvc+3LBdMRyIG6JfYuYsPX8AUS7ktTJTrce9aa9tdw9wQCbf/D1+z48=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.33,REQID:141674e6-33b4-4460-8dc4-d6d024cc2d02,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:364b77b,CLOUDID:7cd7fcfc-4a48-46e2-b946-12f04f20af8c,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR: NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_ULN X-UUID: 52a7dde48cf311ee8051498923ad61e6-20231127 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1260820394; Mon, 27 Nov 2023 15:05:18 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Mon, 27 Nov 2023 15:05:16 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Mon, 27 Nov 2023 15:05:16 +0800 From: Kuan-Ying Lee To: Jan Kiszka , Kieran Bingham , Matthias Brugger , AngeloGioacchino Del Regno , Andrew Morton , Oleg Nesterov CC: , , , , Kuan-Ying Lee , , , , Subject: [PATCH 1/3] scripts/gdb/tasks: Fix lx-ps command error Date: Mon, 27 Nov 2023 15:04:01 +0800 Message-ID: <20231127070404.4192-2-Kuan-Ying.Lee@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20231127070404.4192-1-Kuan-Ying.Lee@mediatek.com> References: <20231127070404.4192-1-Kuan-Ying.Lee@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--4.762900-8.000000 X-TMASE-MatchedRID: TCPSmmY0AVNXKLar1IWcqhIRh9wkXSlFBdebOqawiLujC1E/zCEIr8Rk oeJ3OFRc3k+CPiKHMcLBSaBGgOy3GNEdmUPXI8FxWd1vvclMcXUUqWKocoJo6WrVm7PW4m4IaUX s6FguVy2veSUy9VcQXIAy6p60ZV62fJ5/bZ6npdjKayT/BQTiGmKd6TrD/tOxJTyu087Bl/3dU/ 0piiw/KVY8fik7GhBq/WJMB7lBUBeC/0zoitWvtG59So5u9ctjsIj++Y58d/rqkfDrTAOo86CjN WMcfCKKdATQdtPksR+3/JiWOe6GXXSWgQ2GpXdZbxffl9hhCBw= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--4.762900-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: 29868F287BE6268FBBD8E35727CAA5215BC88AFF032D54227874052E0B4452B82000:8 X-MTK: N X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sun, 26 Nov 2023 23:05:50 -0800 (PST) Since commit 8e1f385104ac ("kill task_struct->thread_group") remove the thread_group, we will encounter below issue. (gdb) lx-ps TASK PID COMM 0xffff800086503340 0 swapper/0 Python Exception : There is no member named thread_group. Error occurred in Python: There is no member named thread_group. We use signal->thread_head to iterate all threads instead. Fixes: 8e1f385104ac ("kill task_struct->thread_group") Cc: stable@vger.kernel.org Signed-off-by: Kuan-Ying Lee --- scripts/gdb/linux/tasks.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/scripts/gdb/linux/tasks.py b/scripts/gdb/linux/tasks.py index 17ec19e9b5bf..7c32f4c8284b 100644 --- a/scripts/gdb/linux/tasks.py +++ b/scripts/gdb/linux/tasks.py @@ -13,7 +13,7 @@ import gdb -from linux import utils +from linux import utils, lists task_type = utils.CachedType("struct task_struct") @@ -25,13 +25,9 @@ def task_lists(): t = g = init_task while True: - while True: - yield t - - t = utils.container_of(t['thread_group']['next'], - task_ptr_type, "thread_group") - if t == g: - break + thread_head = t['signal']['thread_head'] + for thread in lists.list_for_each_entry(thread_head, task_ptr_type, 'thread_node'): + yield thread t = g = utils.container_of(g['tasks']['next'], task_ptr_type, "tasks") -- 2.18.0