Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3359741yba; Tue, 23 Apr 2019 02:21:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqyo9ErZ0IBF2Mh9cJOQbj+z5KQzt1Q9MxEeS3ftdWxuRx+xcuvsW3GZB2sH2u6yHLGDlsEl X-Received: by 2002:a63:1058:: with SMTP id 24mr18999429pgq.297.1556011318718; Tue, 23 Apr 2019 02:21:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556011318; cv=none; d=google.com; s=arc-20160816; b=jMVgAd4Ol/mQbgyAzB6OkQ6PXjt4NDH0R6c+7V/E5EzvGh2Muv4aegtG44SmRZbOZ6 gDM6C9y96bsu4zGE1Br6nHPcj5pjNkfZ0U6V40YMWpdBD8lEvYy0WjVbtWowuno8pmj2 Mpa1n9RP4lwVSJ2/HymgKccsyOGiOB5fyqkrXVce5t7eF8XXizEpSLkxDEkyJqUzI4KT 48Bi4P270X0yVJzi2NLzzkWJwQlcOXH/UPXn5ovJ8j8MYo9LTvhYAGvEzuLNEoDI37ig 4NBQCbAndXbjO8vkjmkHx5BKIxuM1sbc6WRmet2fVfSdPixHryrnFTk8ah3YSbSJS1ML 13lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:references:message-id:date :thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=HI+QvS2mxCgQ+V9TP0dMlJkYVt5bZ0kUMQ9d36VXYDg=; b=IPnO4AWiWjCdaPk/n1AfcIOts9g/2OQHpLSDGucVJxYxpAJmLpifSCbETMo4jLDDg0 nOGlH3mLcGbOSYkyOwCRIWS6l66KRkZkwleUOwgWpG+fw+Gi75tpF9vVjaneVJY6r9iS FUPaPycVmEf3Swv0vVSJL/Udzv8z+wjtq0i0/PWUMoSDvciMYnybplN1t6kwS28RgZOk szmmluBBxLQMFZVeFQGV/PYHAz+pNCueZyCK2Um9a4o9bG1pvnP49n3QYH2mCK0V/6JV A2KDhNJlrBdjqPY7AWuOpesmEBx8OlugFIrBBvDjNBvrKCmTfBZvUN1KY8aHYrKPPx41 4RGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=t49uPvWp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si14950309pgm.385.2019.04.23.02.21.43; Tue, 23 Apr 2019 02:21:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=t49uPvWp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726421AbfDWJUv (ORCPT + 99 others); Tue, 23 Apr 2019 05:20:51 -0400 Received: from mail-eopbgr00083.outbound.protection.outlook.com ([40.107.0.83]:7847 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725955AbfDWJUu (ORCPT ); Tue, 23 Apr 2019 05:20:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HI+QvS2mxCgQ+V9TP0dMlJkYVt5bZ0kUMQ9d36VXYDg=; b=t49uPvWp5PSD+AWQU7vbAZAhjJUO9IpNL6MKg/+IvEK4iDKjMd2thIHGuMb6m/YltfrL7jXGWW7NGAmgQthVRyJNuUM1TuVcipTeIQjVvcBUGh6XO3EFDg9IRf9nvSISca7lhJreH289Z9bshJZGwds0G+KVwNPr6QZCkDmeX90= Received: from AM0PR04MB6434.eurprd04.prod.outlook.com (20.179.252.215) by AM0PR04MB5235.eurprd04.prod.outlook.com (20.177.41.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1813.17; Tue, 23 Apr 2019 09:20:47 +0000 Received: from AM0PR04MB6434.eurprd04.prod.outlook.com ([fe80::a1d7:51b5:9893:dcee]) by AM0PR04MB6434.eurprd04.prod.outlook.com ([fe80::a1d7:51b5:9893:dcee%2]) with mapi id 15.20.1813.017; Tue, 23 Apr 2019 09:20:47 +0000 From: Leonard Crestez To: Stephen Boyd , Jan Kiszka , Kieran Bingham CC: Andrew Morton , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 1/3] scripts/gdb: Add hlist utilities Thread-Topic: [PATCH 1/3] scripts/gdb: Add hlist utilities Thread-Index: AQHU+OUlC64SkSXBmEOwbSCd/Y19Cw== Date: Tue, 23 Apr 2019 09:20:47 +0000 Message-ID: References: <155596568158.15276.10057207756258850078@swboyd.mtv.corp.google.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=leonard.crestez@nxp.com; x-originating-ip: [192.88.166.1] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 866f0e80-3d19-44cc-017d-08d6c7ccf877 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020);SRVR:AM0PR04MB5235; x-ms-traffictypediagnostic: AM0PR04MB5235: x-microsoft-antispam-prvs: x-forefront-prvs: 0016DEFF96 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(366004)(396003)(376002)(39860400002)(346002)(199004)(189003)(9686003)(4326008)(4744005)(53936002)(2906002)(55016002)(76176011)(6246003)(25786009)(81156014)(5660300002)(8676002)(478600001)(8936002)(81166006)(229853002)(66476007)(66556008)(76116006)(64756008)(66446008)(68736007)(6436002)(52536014)(91956017)(66946007)(73956011)(71200400001)(71190400001)(14454004)(26005)(316002)(97736004)(99286004)(3846002)(74316002)(6116002)(44832011)(446003)(7736002)(486006)(305945005)(256004)(66066001)(102836004)(186003)(6506007)(110136005)(86362001)(33656002)(476003)(54906003)(7696005)(53546011);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB5235;H:AM0PR04MB6434.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: iPzBM1JkNnuVjWIDqiCCpz96N2JQn1g0PXXKPyvKMoj/wT7JcHtd2jEhysI8R2uGKjpIYDc29PGuFcNfah4ef7I8U6folQHw6L9l5ISmk5B7i6RizxWcyk9/IVO97iTGPvzjJdjJvdD68K4DjbVTcrmDfpzPyqQUHh2ykmIUkj+Dtz5xYgTLcgISq8NF2rv5zZwtUq53diZjXi0bw3ijcQ84V2f27PMdd6583Fnt7xS88FZ4t2drH03MN/9IdQfeBaz71tMHNaDh/NEd0rZKf9ECrUGM3SsX2HwoqnWNmdmZENPqGpdqt7YRkjbCauPlIyF9dkYUijcLEhxbMlzVDH023ntKFKYv3IiOoYkXtavsCqb+7I0U12zO/TWbaJDOVnUGENydj0iVgYFhjQpaA8+PJ7tj8cRao9ARHluURs0= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 866f0e80-3d19-44cc-017d-08d6c7ccf877 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2019 09:20:47.3847 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5235 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/22/2019 11:41 PM, Stephen Boyd wrote:=0A= > Quoting Leonard Crestez (2019-04-22 01:26:56)=0A= >> This allows easily examining kernel hlists in python.=0A= >>=0A= >> Signed-off-by: Leonard Crestez =0A= > =0A= >> +def hlist_for_each_entry(head, gdbtype, member):=0A= >> + for node in hlist_for_each(head):=0A= >> + if node.type !=3D hlist_node.get_type().pointer():=0A= >> + raise TypeError("Type {} found. Expected struct hlist_head = *."=0A= > =0A= > Maybe drop the full-stop? It looks weird to see struct list_head *.=0A= =0A= Makes sense, it was copy/pasted from list_for_each_entry. Since this =0A= iterates over items from hlist_for_each the check is only useful as an=0A= assertion anyway so I'll just drop it.=0A= =0A= The hlist_for_each/list_for_each raise gdb.GdbError on type mismatch; as = =0A= far as I understand the difference is that GdbError won't print a python = =0A= backtrace. However these are internal helpers so TypeError makes more sense= .=0A=