From patchwork Mon Nov 27 07:04:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?S3Vhbi1ZaW5nIExlZSAo5p2O5Yag56mOKQ==?= X-Patchwork-Id: 13469238 Return-Path: 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 33663C07D5A for ; Mon, 27 Nov 2023 07:26:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 988BF6B02E0; Mon, 27 Nov 2023 02:26:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 938376B02E2; Mon, 27 Nov 2023 02:26:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 826FF6B02E3; Mon, 27 Nov 2023 02:26:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 73EC76B02E0 for ; Mon, 27 Nov 2023 02:26:03 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 46B9E12013B for ; Mon, 27 Nov 2023 07:26:03 +0000 (UTC) X-FDA: 81502900206.21.566BF0A Received: from mailgw01.mediatek.com (mailgw01.mediatek.com [216.200.240.184]) by imf03.hostedemail.com (Postfix) with ESMTP id ED45120014 for ; Mon, 27 Nov 2023 07:25:59 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=mediatek.com header.s=dk header.b=Ir7dyl8P; dmarc=pass (policy=quarantine) header.from=mediatek.com; spf=pass (imf03.hostedemail.com: domain of kuan-ying.lee@mediatek.com designates 216.200.240.184 as permitted sender) smtp.mailfrom=kuan-ying.lee@mediatek.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701069960; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=9bckHyNJG5IsDCmEKDwalIObMqsZcNV3+pMVYGOWkZA=; b=ZSCbQq8XjTHMO0qZP4c4N25KCx9SOg7iRFhVD+EGqcI7q5Acpqn4Eu/EX01b29fhH279KA bV5S1zazh9ESERPSR/47OQBg/o8QGKq5MHw7hZKalZlk+DCO9cSO3wEIspKJoYnGZOD7J+ 8YGUlq/39ufvP05wGKk6/0+BsB17RVo= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=mediatek.com header.s=dk header.b=Ir7dyl8P; dmarc=pass (policy=quarantine) header.from=mediatek.com; spf=pass (imf03.hostedemail.com: domain of kuan-ying.lee@mediatek.com designates 216.200.240.184 as permitted sender) smtp.mailfrom=kuan-ying.lee@mediatek.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701069960; a=rsa-sha256; cv=none; b=pA91ZtLN0h+54A3yVcOcNsZFj2PebzyvPT103n+GCT1+wE4PL8KV6s1Vz63qIdKTnMiK+W FqeCiHHLX16PoBnCawltadIAwmL4cVVtB7ahAaQdrPESjrz1JIgLRjHQoPKnjpzTV7G34j fyGPqoWQpJctCdE7Cn8RuSma1FSakuo= X-UUID: 31f8b57a8cf611ee9b7791016c24628a-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.34,REQID:a6da6c24-a2f3-4301-b28e-f6fee4f9b537,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:abefa75,CLOUDID:60011c73-1bd3-4f48-b671-ada88705968c,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: 31f8b57a8cf611ee9b7791016c24628a-20231127 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 2026218972; Mon, 27 Nov 2023 00:25:52 -0700 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 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-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: ED45120014 X-Stat-Signature: pcccy6k9jufcw5tt8dzhaod6tbh1g7zc X-HE-Tag: 1701069959-717650 X-HE-Meta: U2FsdGVkX1/zEJ7Iu41sNKUCZKEzRWZ9QjEsltK86PCUjHCUS5M9xbsXLAjMI0noVRH3j5rAOsSOifePvfeOUuCRiv08Lz++8Q19qmnMke5rCKGIs/ooWMXPlU4Vk2qMAKruL+8VLQWGRxFzzNkfVtKRA8hilDkbOYlaza1bI9cUV0550K7HkZZZ2Px0XI2nKciLsmNiXEFNjS7lIkm3jGjrSTrh3UKDeRV69pRbCc2jgOrIRMa13mPmbgjnNvEpkcasb+GxSQf9k96z1kaAyikQz3KvCzOtBIpM1JomAfpDquo/eix9Ra3bbVb4M1kmKdgTcU5V3M6Ykj5wuIPSrn05fpjQJzNPqLzE/8N/yjAvKv0/DSCeStOJjfsWc3qrSCZIWPjAsJBBUrTUuGQbZaW5BmyI+2doFbP9FF1JAdwLUlNRm1HeDNXbBy+PYA+zprjW4aghNcrY/r+I7K9N9tnTnYGnkV9U2b2NsLI5IDwjEIerqJ1mxmLcvpGFZVtvHACFg8Nr/kljFaiWW6sKwxqcUpO2xOgGr/u86okjfw9SOX9F6fIMCxY134ViEq3aLrdZfHHF9MNcglPC1rwEXPmarWmMgmqYFc9Ylnk0jN7WX50YBvfDkLfYDKDBzpykXIWS4b0aqVuIQhAE/M3faMnMdZGgVEnLBGkFED5iSAI6Cje+jDESWQCvPUT+TToWwesc37+O8GL7HhJEe7pf9g/ECljoIaWzT/8XAYuGQH7MM7vhieCPbWQrWzxvfcHBIkAaBCwPnEu85H0MxwOrkIxZ8M5lMYvU+qA6+zkDfEcXtNFFHe3rVuyJ0suJuObS5jAC2rpX8sc5HTwRB+7Y6ksQEJIcwEg21MSsLgkx548IB2qJhHBzP6hy88HD/niI6tjXMnBI1RBmFBPb17BiCp+FVvzX3Hh5g+O69uzpBeAnZen3HWNhtfS2oPDiq9jUb9FWOMn0ThxMT+WTvWE KdyObvad Z8E52JGvB1CWwbEgDw6Gb/xyenot8KKhZjuK/mNnQlE6hVOqVa9arOzNf1cB4yoIRU3PqDRIKD4hDnK2sP2tMcWDNv7dwCHnZFmZU/Qmai+IWp8JaAfqLlJeuENtetG1ANb2cxb0E2IPy0NDEbBmSZRzgTlx7YjMIrP4rV/yNrGUVO8DyqpKI+CIR1r2YgF5R1oo0dTPPZd8eL0zq5jJwr3prkoWxeBTal5Tvs6W0z/CWI1/R+4Hcm6XvTtVazv0TJ+gQjRoX0w2jMDTZ/+lxlqMFhfahUypOZ8k+ytP5VE6AdMRopAJrpTRYNg== 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: List-Subscribe: List-Unsubscribe: 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") From patchwork Mon Nov 27 07:04:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?S3Vhbi1ZaW5nIExlZSAo5p2O5Yag56mOKQ==?= X-Patchwork-Id: 13469200 Return-Path: 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 139CFC0755A for ; Mon, 27 Nov 2023 07:06:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B76BE6B02D7; Mon, 27 Nov 2023 02:06:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B00F46B02DA; Mon, 27 Nov 2023 02:06:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 867F16B030A; Mon, 27 Nov 2023 02:06:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 697996B02DA for ; Mon, 27 Nov 2023 02:06:35 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 04A9CC012B for ; Mon, 27 Nov 2023 07:06:34 +0000 (UTC) X-FDA: 81502851150.24.97CB378 Received: from mailgw02.mediatek.com (mailgw02.mediatek.com [216.200.240.185]) by imf14.hostedemail.com (Postfix) with ESMTP id 47B93100015 for ; Mon, 27 Nov 2023 07:06:31 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=mediatek.com header.s=dk header.b=OsroDviT; spf=pass (imf14.hostedemail.com: domain of kuan-ying.lee@mediatek.com designates 216.200.240.185 as permitted sender) smtp.mailfrom=kuan-ying.lee@mediatek.com; dmarc=pass (policy=quarantine) header.from=mediatek.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701068791; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=HtK55VLY1NxyNBcORvef+jn+nTQMaITRftKAsWDHxMA=; b=aT677lzZMRCHyb/zbpfU6O5TWZLjtZONQBN8fVcqkqdmoaPk0xGy9dQDu4Xrjbg7OWA5iQ nSVMFVxY971QMw0yBjNQA7f4YFCOhXfVzGcNEcH5bM4Z1JgcG1HpTRSKeow3HCn2qD9ASy BgtjjM9KlWGI6gDU0njbBXoZrSsGJfs= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701068791; a=rsa-sha256; cv=none; b=sQpt5KjL7ZgB1rpqpuA1HU6eQRgL6uTJk8/Gv0jcapbACJzXnvyiQEDrVRXza/4Jn8zt6C IJJi1xAwP5PYE/E175k1BOwMD+L3rIE9noUOHEQYSibedhD0/tze3QhdtoNMaH/79tmV4T lADr6pYxYmKaZ6BlDusFC+kGFp0Yo7I= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=mediatek.com header.s=dk header.b=OsroDviT; spf=pass (imf14.hostedemail.com: domain of kuan-ying.lee@mediatek.com designates 216.200.240.185 as permitted sender) smtp.mailfrom=kuan-ying.lee@mediatek.com; dmarc=pass (policy=quarantine) header.from=mediatek.com X-UUID: 77dedd248cf311ee86758d4a7c00f3a0-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=HtK55VLY1NxyNBcORvef+jn+nTQMaITRftKAsWDHxMA=; b=OsroDviT3f+sXfQHzUzqntbZJSJIpZl3hkXyIl25Oavh1IfrItIqQ8ceP+yzuYgVZ0ooWiRWo+NenwnKH1xQPFiQeb0w2uAn8jJErGh1Oij42ucg5lK+0XyFl2ceQ9PPWvBbZyKA2VLE/VJBbxD5oJPrFOX4GfJt5TJFJ5QiALQ=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.33,REQID:3b8f619f-494e-4a1a-9d82-cc44a82ecad5,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:d655d995-10ce-4e4b-85c2-c9b5229ff92b,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: 77dedd248cf311ee86758d4a7c00f3a0-20231127 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1936018134; Mon, 27 Nov 2023 00:06:21 -0700 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:18 +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:18 +0800 From: Kuan-Ying Lee To: Jan Kiszka , Kieran Bingham , Matthias Brugger , AngeloGioacchino Del Regno CC: , , , , , Kuan-Ying Lee , Andrey Konovalov , , , Subject: [PATCH 2/3] scripts/gdb/stackdepot: Rename pool_index_cached to pools_num Date: Mon, 27 Nov 2023 15:04:02 +0800 Message-ID: <20231127070404.4192-3-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 X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--0.010000-8.000000 X-TMASE-MatchedRID: v+sphrBU45Fo3s9tP0IpFpA6S0SjvcYU+KgiyLtJrSBh2fnHe1cil/vO +ii1kEU9/pKwAK6MbUrbCHv011Gy9Z8H7IRkmk143fn7n/ZHGqZ9LQinZ4QefPcjNeVeWlqY+gt Hj7OwNO22utO5qEfOUVc0Kd0RiPLSKIZsPfXtYDI2ZAMv1y9yYuiku9X3rg3DYrC60dTQ6lwgkV TLdeBsisRw65kGgQa5HA8v7nBpXwZAmtKtYco7Lkma3zYT97IFAYfQIAUhBayZvmCbKVb49sZL6 x5U/HriPpCuffGH9zI= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--0.010000-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: 3B0E1DE16128D260FD1688E220366A70E47761E071E403750C9EB17B147451602000:8 X-MTK: N X-Rspamd-Queue-Id: 47B93100015 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: akhs69uajwhpq8s9ggocnbaj18mu916m X-HE-Tag: 1701068791-638979 X-HE-Meta: U2FsdGVkX19OVu3Qlp6eLK/zYcu/4YfxsoRb5mDufA7AQ7qOZpJgB0KQ0zLU1Av/WjEQsC849dTOOEczR2X5f2JqeHqzFPD/Gzm2CMsw6rAEP8qFYmRUxZ4lLUciDUB7gLpZlvKTWUsv0ELjMhO8cBmQ+6WDMKU2hOut6jWQBV5ObZHpDlFNE3I2955eOQqGik4eoXnQgvlpMu4XguFSnwc61ZY4BghXnTHoU3paTTcGJCOm4bFjnCEnoyEv4F0RWjVjjUKbBmUFwtc5FYrOCfKl0VtMz7FORLyaTZ+VeOqK5c8ArWZH0/BSVBL7bmpf4M3R4DUzoMVhA+puAwgploVzmN/Nc/rbebMwA9pyEE4IIEJ5nZeebjYmzbyPMBCvlJVwJRPAfbNHGbOu26Eop3hrlA9YEiQ93B/H+/EcBzDTB9XRvuZE7b/1AQScWskNlVCe9km3uAmejsS565eA3kq+NxuFRqD01UL/p09EgQbPv5MVbaOkUHbtByQhgpDJPZNMcxmf4rHEhdtLvv3QffLM3QCzdbVzHoWjhUUmhniZrtYBjJDOvv/0PdzO+DxpflSwifmPJirD5+SkKxaL79FjaeOr7OSjeY73r/As+Mff1R7zhNppKIQ9jZHh2aQpC2BImjOW9CRrCaUIFyvmolXkSPX/ka6kKdxYAfzScQ4/nylMlxCFjBoCoIBvrYldTufh5YN0A0lnR9OCBDaBvZIfQvc5SshXgKwJaJtuWx2+jISj1FcbmZ5SCEwKv5iht0lgPnky/S1LSFuf/oEdzRC3sz0XN1rI4UmC2BkbV4H1Oo0n215qyaMZfBh/klIGhTtj7gjYfEi9BRtp40WNq6o8+uxFzrP3/EpWckzRD8YGu12lbeskJ0+1il+pLES4Z7L2onzxOx83/02J21Pdu02tgj4fdWHd1k0/RQo7iVFM1Xvd1LUFRFdXK3kicXSYoc3ZSIiVOgxawfvW9EQ 7a9OcEB4 q4GYWqYbpFNeUA9MGP409RnxE9Df/xwINs6SmI0mKILY/xS8ZR7vGrfHm1ur4fDtIKJriVVLFHmGYPGVTP/EsGPH9zXUZwOzRQdR1m+dADBSxDuc/lbeFKpuu7Yy6K8QArx7J4AMZegXJCDPV78GUY9O7Pg5C+rCe9Qj9a99dOmdYlYLqh7HX6IcCbS7Cuf5kLwFP+bYgqjn2X8yBaeiNb9eUwwjSfhVM0BKly8fgeRZFkxRxLyqf4ve8xtkbBqZgS7+YMCuKiOBJgv9Z/wSPfWYPcetj5VW03JJkMcVbCLoV85zDDvJW079zA81Xfi5MPtCzIUwNDbs10k76uJNVz0qFdd/yp1TuQ6sDT99n/Skvelm3Ntf0O37Ukw== 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: List-Subscribe: List-Unsubscribe: After stackdepot evicting support patchset[1], we rename pool_index_cached to pools_num. [1] https://lore.kernel.org/linux-mm/cover.1700502145.git.andreyknvl@google.com/ Cc: Andrey Konovalov Signed-off-by: Kuan-Ying Lee --- scripts/gdb/linux/stackdepot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/gdb/linux/stackdepot.py b/scripts/gdb/linux/stackdepot.py index 047d329a6a12..0281d9de4b7c 100644 --- a/scripts/gdb/linux/stackdepot.py +++ b/scripts/gdb/linux/stackdepot.py @@ -25,10 +25,10 @@ def stack_depot_fetch(handle): handle_parts_t = gdb.lookup_type("union handle_parts") parts = handle.cast(handle_parts_t) offset = parts['offset'] << DEPOT_STACK_ALIGN - pool_index_cached = gdb.parse_and_eval('pool_index') + pools_num = gdb.parse_and_eval('pools_num') - if parts['pool_index'] > pool_index_cached: - gdb.write("pool index %d out of bounds (%d) for stack id 0x%08x\n" % (parts['pool_index'], pool_index_cached, handle)) + if parts['pool_index'] > pools_num: + gdb.write("pool index %d out of bounds (%d) for stack id 0x%08x\n" % (parts['pool_index'], pools_num, handle)) return gdb.Value(0), 0 stack_pools = gdb.parse_and_eval('stack_pools') From patchwork Mon Nov 27 07:04:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?S3Vhbi1ZaW5nIExlZSAo5p2O5Yag56mOKQ==?= X-Patchwork-Id: 13469199 Return-Path: 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 44CCCC07D5A for ; Mon, 27 Nov 2023 07:06:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 731E56B02D6; Mon, 27 Nov 2023 02:06:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 66B2A6B02D7; Mon, 27 Nov 2023 02:06:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4E65D6B02DA; Mon, 27 Nov 2023 02:06:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 3E8126B02D6 for ; Mon, 27 Nov 2023 02:06:35 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 15FDC1CA761 for ; Mon, 27 Nov 2023 07:06:35 +0000 (UTC) X-FDA: 81502851150.11.02D822C Received: from mailgw02.mediatek.com (mailgw02.mediatek.com [216.200.240.185]) by imf23.hostedemail.com (Postfix) with ESMTP id 695C014001B for ; Mon, 27 Nov 2023 07:06:32 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=mediatek.com header.s=dk header.b=ng3Bo+YQ; dmarc=pass (policy=quarantine) header.from=mediatek.com; spf=pass (imf23.hostedemail.com: domain of kuan-ying.lee@mediatek.com designates 216.200.240.185 as permitted sender) smtp.mailfrom=kuan-ying.lee@mediatek.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701068792; a=rsa-sha256; cv=none; b=6dzPIIb9nixqRDSAPgcQ1Ilp762LLWz7xzlMj6b6Z0RkmaJqo816YabnQ+vEV2LMTFfhmd FczqKrx9zPVWHlvj0VNrSX+zPfridQgyFmg5EdERkj3RaGcI/JeaRg60zT/BryBCL+OmEg LHquWkKE9jzPST5anE0K+vmK/WrvRwg= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=mediatek.com header.s=dk header.b=ng3Bo+YQ; dmarc=pass (policy=quarantine) header.from=mediatek.com; spf=pass (imf23.hostedemail.com: domain of kuan-ying.lee@mediatek.com designates 216.200.240.185 as permitted sender) smtp.mailfrom=kuan-ying.lee@mediatek.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701068792; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=FfM/LFHjkcBsRth/jK9IUe/5rqKeTocfopTS7wMKfnY=; b=l1MUMF1W8qWV7um5JyAtckbN52+srq0YYB1E4h3wqNmDa997md+eTv0MB9NBcoPVwySC85 gJQFuz2/n7qT2bSiVCyO4TSi9kCDg50J6Isaa3Lt6COiAc7ftqoRkrLh6mASzdt0JzkJlE 4+yj5KZj0ZStKBr3mvhxyU7l8iwomwA= X-UUID: 786c5c768cf311ee86758d4a7c00f3a0-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=FfM/LFHjkcBsRth/jK9IUe/5rqKeTocfopTS7wMKfnY=; b=ng3Bo+YQnERGOnT7ztC4R8StCtj6WolnTE4LvIKZ7dQT1JRUJWO2rFGHgENgExbBCUxQjeahPu+IECoaC/rWwRT5tf/rFt8mTxlerbQsluTRymZdmQRtIAiqb7+02OPzctgqTUc5B3PIcv9hVCxU+mZs7nUXIQ0S+1/xQ6f9llI=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.33,REQID:5033c5c9-5aab-445a-b1f8-051a7e271e15,IP:0,U RL:0,TC:0,Content:42,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:42 X-CID-META: VersionHash:364b77b,CLOUDID:44c41b73-1bd3-4f48-b671-ada88705968c,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:4,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 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_ULN X-UUID: 786c5c768cf311ee86758d4a7c00f3a0-20231127 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 2028640867; Mon, 27 Nov 2023 00:06:22 -0700 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:19 +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:19 +0800 From: Kuan-Ying Lee To: Jan Kiszka , Kieran Bingham , Matthias Brugger , AngeloGioacchino Del Regno CC: , , , , , Kuan-Ying Lee , , , Subject: [PATCH 3/3] scripts/gdb: Remove exception handling and refine print format Date: Mon, 27 Nov 2023 15:04:03 +0800 Message-ID: <20231127070404.4192-4-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 X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--0.929400-8.000000 X-TMASE-MatchedRID: Av/pE9tNfKGWHmpvkeKJB0hwlOfYeSqx3xlpFMX5MCCQ2TbICkFOdk69 FgKoS/097PSkEF73uYd7VWtw6SMI5Kawq2pdPD7UA9lly13c/gGb/LTS0T1K1k4K0IMk2m3GwVB JSJ8GjJw3fJWouRpjSXrw5BSR88yeSoBVPxvX5SSQOktEo73GFOTWKSbLQnNI0w5IABkoK4ejxY yRBa/qJcFwgTvxipFa9xS3mVzWUuAojN1lLei7RYYOtKqE9TMltcW9OiWFpt72ZzE2SrN70Z+eC VfOOV58l0THHo7ATW+guLN8VZYRFDky1wRoSxJfiCCOl1JcKQZai0D30EU35nmVKZusLp922v9O jYWA2uMMswg45VMfPXY3pGDmoik6 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--0.929400-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: 847D7A48C3336C1D5104C7B296990B2AD0769F6D258E074659F3A149850583532000:8 X-MTK: N X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 695C014001B X-Stat-Signature: byostaoz9qoby8rdpatq3hyskoykf1ri X-HE-Tag: 1701068792-674482 X-HE-Meta: U2FsdGVkX192kb+WUGbqYbeAk186Ag5ijbCjVZGwvB9S82YedUkSREiojBEsOSm3kBnGiqeLl6zOhgy/2nks2fkJ9uyTtMjMZ553uprxp14o1O7pfo9YOpg+FfiUqKtCIuM/H1TLjisIly/kMUJRifDOycblUfHpv3kg5nLi24M0OcONKL/gmhggL1JDKtxBL/ZJHALa1yhagDZwSt/4ttbN8MCbudnzjkP+JAr33tEj7tLcAXlQmKiomB+AFewfX52IKnG3tmDSQtjAyJmQzqTLWs66nmMNzMyG0Ho6VCsN8o5y9y0FD8KyjR91WKeHhBM6OJ6BNZpePfx/ntfn7UXsjIoYFQ/vOaYPbNkHqt7TufNnfM0rZYwTNq4d6D2D+jBXzdTubYVck7SwTgLbTkE0Ir2/Og5hCh0HX4pOo8oABvghhXU6vwt53qmh/erXCWWvhAFnPDrlwqTd28zauyx4Wa6oS6LiKTw2opffJlOpBNGEQm1Qu687KNYf9O1tKwgeOlQauJt2tVg7wFON6LLfFFCjsHw1RTuWQ0my36Wf23rHong9jFW8iUP8mrl5Ido6syhaCH5d0HY2XmQ4NpR7oA9sOiILF8sn0dP393lEH12OHPbD90MgLNdLadALqGsjq71CaxAXhKlWwPNiS6V60/QptCQytwe5KM6/JjkW6a8J5eYv2vB8zWpNaXaV013Lzb/Ycwqy5ZIXgUzaPFitDCSp5iTc9AHPr4OhZAklfD0e4JrC17JijLjmsmpt1kNrEMlnx9m8mCF4Aj0SDtEBC7FJ+FxTGH1d90qK5m8zTgSPqTdC0q0+c936SuaN26ytfFn5+CzC5c1cZQ06KTUWWOwzfSCg6lZ7Pzo5PBFp3yuxeWMsqIbMvTrUuc4PfWoewqWH3/kAZPpVRMlj6Tte3iiFiiUdn/AwUWbB+ObEvYssd8eFsvH/HzdEP+3iHwjT2rcyZgky+95xzry oh/ZDrLJ vopGW3c/0UZiXOZj6lQrLg+1udPMsVBJwlj8d66Y2hu63rWZ4zpHmqpZku8nuKwYQ3LDqOREL6fDQCWh84j6Ri9DDASTbUO5ON9VSi/rh2ISkLsegSqzPaVcRrr8s82vgwNttPPJ2jS7vf90UEHrHHpirGQIAFOPetRDhAJv1Axln0rh9WzSLF9Phwb+wIAJX+KGYMMKdGfyN875XtwUfJthXLO3PVGJ3rJ6Afzd/BWbPWG3on0i8MvzFow== 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: List-Subscribe: List-Unsubscribe: 1. When we crash on a page, we want to check what happened on this page instead of skipping this page by try-except block. Thus, removing the try-except block. 2. Remove redundant comma and print the task name properly. Signed-off-by: Kuan-Ying Lee --- scripts/gdb/linux/page_owner.py | 58 ++++++++++++++------------------- scripts/gdb/linux/slab.py | 3 +- 2 files changed, 26 insertions(+), 35 deletions(-) diff --git a/scripts/gdb/linux/page_owner.py b/scripts/gdb/linux/page_owner.py index 844fd5d0c912..8e713a09cfe7 100644 --- a/scripts/gdb/linux/page_owner.py +++ b/scripts/gdb/linux/page_owner.py @@ -122,27 +122,24 @@ class DumpPageOwner(gdb.Command): if not (page_ext['flags'] & (1 << PAGE_EXT_OWNER_ALLOCATED)): gdb.write("page_owner is not allocated\n") - try: - page_owner = self.get_page_owner(page_ext) - gdb.write("Page last allocated via order %d, gfp_mask: 0x%x, pid: %d, tgid: %d (%s), ts %u ns, free_ts %u ns\n" %\ - (page_owner["order"], page_owner["gfp_mask"],\ - page_owner["pid"], page_owner["tgid"], page_owner["comm"],\ - page_owner["ts_nsec"], page_owner["free_ts_nsec"])) - gdb.write("PFN: %d, Flags: 0x%x\n" % (pfn, page['flags'])) - if page_owner["handle"] == 0: - gdb.write('page_owner allocation stack trace missing\n') - else: - stackdepot.stack_depot_print(page_owner["handle"]) + page_owner = self.get_page_owner(page_ext) + gdb.write("Page last allocated via order %d, gfp_mask: 0x%x, pid: %d, tgid: %d (%s), ts %u ns, free_ts %u ns\n" %\ + (page_owner["order"], page_owner["gfp_mask"],\ + page_owner["pid"], page_owner["tgid"], page_owner["comm"].string(),\ + page_owner["ts_nsec"], page_owner["free_ts_nsec"])) + gdb.write("PFN: %d, Flags: 0x%x\n" % (pfn, page['flags'])) + if page_owner["handle"] == 0: + gdb.write('page_owner allocation stack trace missing\n') + else: + stackdepot.stack_depot_print(page_owner["handle"]) - if page_owner["free_handle"] == 0: - gdb.write('page_owner free stack trace missing\n') - else: - gdb.write('page last free stack trace:\n') - stackdepot.stack_depot_print(page_owner["free_handle"]) - if page_owner['last_migrate_reason'] != -1: - gdb.write('page has been migrated, last migrate reason: %s\n' % self.migrate_reason_names[page_owner['last_migrate_reason']]) - except: - gdb.write("\n") + if page_owner["free_handle"] == 0: + gdb.write('page_owner free stack trace missing\n') + else: + gdb.write('page last free stack trace:\n') + stackdepot.stack_depot_print(page_owner["free_handle"]) + if page_owner['last_migrate_reason'] != -1: + gdb.write('page has been migrated, last migrate reason: %s\n' % self.migrate_reason_names[page_owner['last_migrate_reason']]) def read_page_owner(self): pfn = self.min_pfn @@ -173,18 +170,13 @@ class DumpPageOwner(gdb.Command): pfn += 1 continue - try: - page_owner = self.get_page_owner(page_ext) - gdb.write("Page allocated via order %d, gfp_mask: 0x%x, pid: %d, tgid: %d (%s), ts %u ns, free_ts %u ns\n" %\ - (page_owner["order"], page_owner["gfp_mask"],\ - page_owner["pid"], page_owner["tgid"], page_owner["comm"],\ - page_owner["ts_nsec"], page_owner["free_ts_nsec"])) - gdb.write("PFN: %d, Flags: 0x%x\n" % (pfn, page['flags'])) - stackdepot.stack_depot_print(page_owner["handle"]) - pfn += (1 << page_owner["order"]) - continue - except: - gdb.write("\n") - pfn += 1 + page_owner = self.get_page_owner(page_ext) + gdb.write("Page allocated via order %d, gfp_mask: 0x%x, pid: %d, tgid: %d (%s), ts %u ns, free_ts %u ns\n" %\ + (page_owner["order"], page_owner["gfp_mask"],\ + page_owner["pid"], page_owner["tgid"], page_owner["comm"].string(),\ + page_owner["ts_nsec"], page_owner["free_ts_nsec"])) + gdb.write("PFN: %d, Flags: 0x%x\n" % (pfn, page['flags'])) + stackdepot.stack_depot_print(page_owner["handle"]) + pfn += (1 << page_owner["order"]) DumpPageOwner() diff --git a/scripts/gdb/linux/slab.py b/scripts/gdb/linux/slab.py index f012ba38c7d9..0e2d93867fe2 100644 --- a/scripts/gdb/linux/slab.py +++ b/scripts/gdb/linux/slab.py @@ -228,8 +228,7 @@ def slabtrace(alloc, cache_name): nr_cpu = gdb.parse_and_eval('__num_online_cpus')['counter'] if nr_cpu > 1: gdb.write(" cpus=") - for i in loc['cpus']: - gdb.write("%d," % i) + gdb.write(','.join(str(cpu) for cpu in loc['cpus'])) gdb.write("\n") if constants.LX_CONFIG_STACKDEPOT: if loc['handle']: