From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D2B77EB64DC for ; Thu, 6 Jul 2023 12:48:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QhmThBYe99oap7TbHtTU2OlGrjC503mnnk9LXJfRR80=; b=swa4MQZGqfr5MR zbacm38eHl1S0TaULOiKyKrnq5J36isjMz27T2eYi0JOavxO3fH4laWP8fjJkLFevP4kfSc5RlYPH q53HT/TMlqnq6eqhLEWIxiHMYkswWqhdfCLpNw/XxNo1qyk2sASOVXBheMjtWg3fWbzJ6s+qtCEOt 7XbC7oFrXw0wt4UJlezRUX1SCsmEWjCSggMIQiBHjRr6JnKDwcic6w+vNQHpk49Zi3KEfwPbBx+35 WkjTpnRzxy036qK0nIKP/JrZKgM9C2hQ5u4StKQClsv1WeoNvt7vAlrtmxuE1F9WrC3856HfORxBf el0x+0xLyQqXzobnZG8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qHOOd-001gYH-25; Thu, 06 Jul 2023 12:47:43 +0000 Received: from mail-dm6nam11on20609.outbound.protection.outlook.com ([2a01:111:f400:7eaa::609] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qHOOa-001gVu-0c for linux-arm-kernel@lists.infradead.org; Thu, 06 Jul 2023 12:47:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ro5PpF/vX1LIDc/ADkekdIIeOO5SwgmB6Pzs2Yv4S5qixNeVtveqXr6v0lQMJlDguLo2N52uSpPkbcYrDATdEnhikw4CpPkwmBcdm/zjcYRNnKwRJNzmRGTxNbD0kI/8TM/vMpKyaDCxHt5ScBf8VUTTlgdgMYJOyMjqZ/8UggzXD0kE/xdnHBE1A+pFHmgXODcdbmsj7CwOZxVNfAn2ckioTuRTwODU2DpTCnD75PdUgr9njGLRGAamduVC0w5uvSa2TT29ByG0Xv48BElMB5QiVuWMnsfLyGKWIFoYc9t0Xs4H+vrZiSV7zbAiReUV/YBRC8AiBhrxJji/UQrGuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Va10XMKoeGeZJFTlFhz+nUgRHNghgXulZrXNJiPVmrQ=; b=XOAayUAI/LqR9yHwdgTyN7SiTNOkba3HKDoaVsVrjQgRPLoUqzmErq3jP/pF/BmokpiIefNWDeIKbnI19bfeiKSqukRPJ5pMKiIh71PNPF5zSMapRHNH/UmKxFlixpn+A0GVKhg83e9pmbUvsUlHJldBC7SL6W1/Jc8PI/vAXwxB1SzSVJclmGEqCbIyGa6ERcGNmJh7FzVJmxI5p1BEC9lLtd5Lrb+WCo3ORJOn58JXmBdEQ+CXg8aLHXnz83lL1NhqCRzGvlRDra1vDysttVVQt4Hkaj2jPIy6W812RTBL5vku9TP8jtkoraDCxInehRYwYsDesZhEUKBoo913dw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Va10XMKoeGeZJFTlFhz+nUgRHNghgXulZrXNJiPVmrQ=; b=OcDLB/xOFKri46C/Kw/GqQ8I6p80RR8/59iqEmHzH7d0uvz1D1AUnwGSy8HKwiwt3wssfI/McBoyGwj8nEJZf5hyFJHszj4D+XNenYg1ne4yYkFnz0FXPTxdVj0iUt6P4HuUQE0a4jENEz97JSxdpEJmwRrh2BoPc6803hfcQAM= Received: from MN0PR12MB5953.namprd12.prod.outlook.com (2603:10b6:208:37c::15) by IA0PR12MB8976.namprd12.prod.outlook.com (2603:10b6:208:485::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul 2023 12:47:35 +0000 Received: from MN0PR12MB5953.namprd12.prod.outlook.com ([fe80::8368:23:db50:8f88]) by MN0PR12MB5953.namprd12.prod.outlook.com ([fe80::8368:23:db50:8f88%5]) with mapi id 15.20.6565.016; Thu, 6 Jul 2023 12:47:34 +0000 From: "Pandey, Radhey Shyam" To: James Clark CC: "coresight@lists.linaro.org" , "linux-arm-kernel@lists.infradead.org" , Suzuki K Poulose , "mathieu.poirier@linaro.org" , "mike.leach@linaro.org" , "leo.yan@linaro.org" , "alexander.shishkin@linux.intel.com" , "Sarangi, Anirudha" Subject: RE: Linux coresight arm64 : Incorrect data in cstrace.bin Thread-Topic: Linux coresight arm64 : Incorrect data in cstrace.bin Thread-Index: Admu+Whu+2gK05ZLRQGv+yrfeB/WEwAIQVaAAALy1uAAAlo3AAAA2hRgAAHM94AAMcuKAAABhxIw Date: Thu, 6 Jul 2023 12:47:34 +0000 Message-ID: References: <5c265f56-0ada-b41b-d9c2-677f3c36b1c4@arm.com> <56905d7a-a91e-883a-b707-9d5f686ba5f1@arm.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN0PR12MB5953:EE_|IA0PR12MB8976:EE_ x-ms-office365-filtering-correlation-id: 0be95bea-07c7-4115-ed28-08db7e1f2bd6 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: UhpYRZFQHixuBuqbRwgr6MWDful1CfNJ0GdMFoyaZnqHXVr2FXt0BLRL47/isZ/8uBiLUbi0SNNPdx1t0mFZiTkhOH1BJOf2QHvOVtsckoXvoHHcti2dvxHfa01Fr/l8yWRNwlHe7VBAdCI7vqhCQ81J6D4tf2zEqvwFqHMCIT5Q+144RlXBKCYT6uua/NGfQwlHi8f5rWUMqfP9XfY0FU2iPJGFAC19SLWOziCzWzYyMeCn20/kmZ5nHsKygyKdBPMW3kcn70ZuKFSOIitEVNq+T4mkPvi2q+L4Vrv2aF42f0eUmHNQO1HQzwWAgTj+fzzEaq04mM4X4qYcc+iACXGGS+0B2mjEsOAGo4RcyXN3ZKzpDnUqblsiMrYASvulprrGg/47mEgjD4Pw3bkXOvCtS5zT/f3jl5B+LODFThaJ9Ssu+b5pNw89suZhp58lwsCwIkUf+4RblEDjnVoTY3vgLv52juF4Y8IDkOjNjMU7/gL9TyCNHQcEb8AyjPpl6vc0iKuzARmk3mcZJw0I4nvWOi6YtTmLTtakNjNMefpf/gry+3CAs23gTzdtW+ybJp/evYKZmXHUYNm1rfxgnemJxB1E+C0nSws16gIwTCe6otlRP20HoEfWzxwdurONqRWq4/GgRQXGX5LerrzwEw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR12MB5953.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(396003)(376002)(39860400002)(366004)(451199021)(7696005)(9686003)(478600001)(966005)(2940100002)(54906003)(86362001)(38070700005)(55016003)(83380400001)(2906002)(71200400001)(53546011)(30864003)(186003)(6506007)(76116006)(122000001)(66946007)(316002)(66446008)(5660300002)(38100700002)(41300700001)(64756008)(66476007)(33656002)(4326008)(6916009)(8936002)(52536014)(8676002)(66556008);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?elRjNWJWWVRJa3F0ZUh3a3VtWTVwcmUrbGxxWnVVZkEvQVdBdmROTDRxSmtw?= =?utf-8?B?WFgxU2g1M2VOaUNSME90NjVZMUl3T1FkcUxOaXhpdkRrMnVNSGlKaFlnZGQ4?= =?utf-8?B?MWMxdVpxOGdhY01BMm9YRGgxanpmbWp3WVE3NHJpSnFUKzl3d2Job2hBWFhE?= =?utf-8?B?ZHY5VGlWdVlxT1Z0WStDUVJoSHA0QmdrVGY5VU00ajVicU1oaTZia2dINlJC?= =?utf-8?B?VjJES2xUM1Fxc2JGMEw2eUE1ZDFoUlRxWTZnRUFtNStQY3R3bTd0WTBMVm8w?= =?utf-8?B?QTFsMHk4Rkh1UXU3R3IzT1FEU3ZEYXZrUFFIeHg1d3orOXJqd3ZocTl2U21H?= =?utf-8?B?MWhKbnhya0VEcS9jUWNqYmE5dTdxUTFVdzhHN0lPblJzdFNHT3BIVi8wQUlP?= =?utf-8?B?c0oxK0RiNTdOZEltMnRiaDlrbVJuNklJZVd3Wnk1MkRpbmpaY0p0NzBvNnlh?= =?utf-8?B?WU5nKyswWmYwSDNDK0FGSENqcWtFV1hCWXhyU2JhVjB5Y3VySkpTSXBmV3I1?= =?utf-8?B?Z2ZwTjhadjFtMVM1UkhUb05UZ1V3M0Z0OWNWVlE4cExlWkVwRm5INnNYYmhW?= =?utf-8?B?RU1sWWhKNHRCWW9PMkhpNDZFME0rSVpLUGVDVEZsNytxREhiaWxlNWR6T0lY?= =?utf-8?B?akFnZ25oNVJzSFBjRC9LZWVGcXUrSGhoWWhYOFk2T2ZzRG9oQUJIaFpmOU9v?= =?utf-8?B?N214Q2xXcmkreXBaZTNKMGdLNXpvTXF4U1RDMnBEUWltbVY5U0NBRXpLbG9J?= =?utf-8?B?TnFuZ3pLQVVPeGllcWIrWUp6eDZQM0l5MlptbW9BY3VlWG44TStMN0VwRVMw?= =?utf-8?B?Q2UzZ0pYMGFpQTJJVnNwM2cxSnBXUFZ1WWR0MjFXMkJiOFo2V0E4MzJhUEFN?= =?utf-8?B?YXYybFNQSy9FWUtGSktjZTNNdGJrWHBicU1zZEM1MHdJd1l4b0YvREJoblZw?= =?utf-8?B?enlxR3dibGdrQzMrWXg0c0lSRUxKc2hBeDhha1dxelEvOEt4VlhKR2J1dFJs?= =?utf-8?B?dkw5UGI1cGxLZ2F3SHE1M0VrVFZEMzRVUHQ5L2g1em5aZjZQamFSNGIvZEZC?= =?utf-8?B?SzlWR1V5K2k0c0hualZFZmEwL2xhQlFobXZZc0JzZVpPV053b1E5dlVEdmhy?= =?utf-8?B?L21ma2s5ZzlkbVQxTndxNE9iRnJLYk55eXY2Vm4yZk5FcGhzOVRqTWFJc1hJ?= =?utf-8?B?Qkl4S2RRTFF0Q0RWcUlrbG95ZXBEQm81a3dWZHE2ZHBNbWpzaG41WWJDL2c2?= =?utf-8?B?NVBmTmRwcHJSQ0JwVHRzYmpUOTExS08zWG5COU5XK3dnNFUrZmlnNGJ1V0hx?= =?utf-8?B?aGFoRUpXOUI1VUZMYVpCMkFUbWFtN2NjVXlueXQwbFJSOVk3NXRPUkYvOU1W?= =?utf-8?B?THlJakVIcWorU2hPSUw2VjZvNGNVQitQVnh4MitWTEhhQ0UycDN2MzFiRi9h?= =?utf-8?B?dU41UHhiRFQ1dVpSd0R2enNBdkhOSXNMTFM4ZEVLY0haUFdEdGJpNG1hL082?= =?utf-8?B?U0dCYXRuQXRrMGtzUmVOK3lTZ1R3ZVlJYWM1NTFlRzhFaG0xanlxdExMTFFR?= =?utf-8?B?aEhWRmRLcWUvZHQvYUxORERMQ2ZiZjJ1ZmtIRkVtcXJ2Skx4UGUrQnpnZk5o?= =?utf-8?B?enZ1S1Joa2RXZlp0RTE1Mkk5L3M0eFZyVTVYZmlrZDRhaloyZzlDcEdCOUIv?= =?utf-8?B?Wm96cE44TE1XV2VmYXp3RlVHVFJPQk5JZ3daQkJwYWJsL1l5cHp2S3B0bnhu?= =?utf-8?B?aHpLZFVwaVpTSDVqR2tZdEZZOGExMzh4b2p4U3ByUlpqM2I1N2Z2L2hmM0R0?= =?utf-8?B?NFJySWh1SFpJblNGMFZ3RkJxQnI2bGdhRXFQclVkcGN1bHMzRDFYaUc0SGRZ?= =?utf-8?B?Q3RERS9ucUhqUCt0a1JEMFJSNW83QXpLbTJJZFlqMlRWVXJxRWZ1azBOODh3?= =?utf-8?B?Rkhmc3hQN3JjRGRyUVVkZWpsMngreVMvL0t3UFBoZGJmanVwQ0ZnN2lBT2Uz?= =?utf-8?B?Z29LbTd4WGZFUHcrRURSZDdiS3NOWi93UTFGcHJWNEdtY0hPb1Z5bmFLYlJT?= =?utf-8?B?K2ZaZE9oMXhTS1dJcHBNY3FKTTArZW1sMmFSbTBLSDU4MitXcy9KSnU0Z0hQ?= =?utf-8?B?TXBJS3JyYXI0OXczMUFmeCs3LzBuaXJIekgzNzJzK1htU3YxWVhIRzhmSStD?= =?utf-8?Q?NrhfQLn4+U0moLcZcTgM/lo=3D?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN0PR12MB5953.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0be95bea-07c7-4115-ed28-08db7e1f2bd6 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jul 2023 12:47:34.7176 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: VnlunsBHXE6W+SiIIp1FyxldTTjGC8k+OIWP7zVKfSRyF6dhNIUZ9zXvNF2Gq8ox X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8976 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230706_054740_306485_AD0EFD76 X-CRM114-Status: GOOD ( 18.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org > -----Original Message----- > From: Pandey, Radhey Shyam > Sent: Thursday, July 6, 2023 5:40 PM > To: James Clark > Cc: coresight@lists.linaro.org; linux-arm-kernel@lists.infradead.org; Suzuki K > Poulose ; mathieu.poirier@linaro.org; > mike.leach@linaro.org; leo.yan@linaro.org; > alexander.shishkin@linux.intel.com; Sarangi, Anirudha > > Subject: RE: Linux coresight arm64 : Incorrect data in cstrace.bin > > > -----Original Message----- > > From: James Clark > > Sent: Wednesday, July 5, 2023 5:44 PM > > To: Pandey, Radhey Shyam > > Cc: coresight@lists.linaro.org; linux-arm-kernel@lists.infradead.org; > > Suzuki K Poulose ; mathieu.poirier@linaro.org; > > mike.leach@linaro.org; leo.yan@linaro.org; > > alexander.shishkin@linux.intel.com; Sarangi, Anirudha > > > > Subject: Re: Linux coresight arm64 : Incorrect data in cstrace.bin > > > > > > > > On 05/07/2023 12:48, Pandey, Radhey Shyam wrote: > > >> -----Original Message----- > > >> From: James Clark > > >> Sent: Wednesday, July 5, 2023 4:29 PM > > >> To: Pandey, Radhey Shyam > > >> Cc: coresight@lists.linaro.org; > > >> linux-arm-kernel@lists.infradead.org; > > >> Suzuki K Poulose ; > > >> mathieu.poirier@linaro.org; mike.leach@linaro.org; > > >> leo.yan@linaro.org; alexander.shishkin@linux.intel.com > > >> Subject: Re: Linux coresight arm64 : Incorrect data in cstrace.bin > > >> > > >> > > >> > > >> On 05/07/2023 10:56, Pandey, Radhey Shyam wrote: > > >>>> -----Original Message----- > > >>>> From: Suzuki K Poulose > > >>>> Sent: Wednesday, July 5, 2023 1:57 PM > > >>>> To: Pandey, Radhey Shyam ; > > >>>> mathieu.poirier@linaro.org; mike.leach@linaro.org; > > >>>> leo.yan@linaro.org; alexander.shishkin@linux.intel.com > > >>>> Cc: coresight@lists.linaro.org; > > >>>> linux-arm-kernel@lists.infradead.org > > >>>> Subject: Re: Linux coresight arm64 : Incorrect data in > > >>>> cstrace.bin > > >>>> > > >>>> Hi Radhe Shyam > > >>>> > > >>>> On 05/07/2023 05:38, Pandey, Radhey Shyam wrote: > > >>>>> Hi, > > >>>>> > > >>>>> I am using linux 6.1 kernel coresight framework to capture ETM > trace. > > >>>>> Enabled coresight driver and added coresight component device > > >>>>> node in DTS. With that, we could probe all coresight components. > > >>>>> > > >>>>> But when we do capture using sysfs and then read the trace.bin > > >>>>> using ptm2human we see invalid trace data. Trace content > > >>>>> changes on each capture. Any pointers to help narrow down the > issue? > > >>>>> > > >>>>> Tried: sysfs capture and perf (with OpenCSD enabled) > > >>>>> > > >>>>> Development board: VCK190 : > > >>>>> https://docs.xilinx.com/r/en-US/ug1366-vck190-eval-bd > > >>>>> https://www.xilinx.com/support/documents/architecture- > > >>>> manuals/am011-ve > > >>>>> rsal-acap-trm.pdf > > >>>>> > > >>>>> xilinx-vck190-20231:/home/petalinux# dmesg | grep -i amba > > >>>>> [ 0.301054] Serial: AMBA PL011 UART driver > > >>>>> [ 0.306226] amba f0c20000.funnel: Fixing up cyclic dependency > with > > >>>> f0d70000.etm > > >>>>> [ 0.313624] amba f0c20000.funnel: Fixing up cyclic dependency > with > > >>>> f0d30000.etm > > >>>>> [ 0.321110] amba f0c30000.etf: Fixing up cyclic dependency with > > >>>> f0c20000.funnel > > >>>>> [ 1.470247] Serial: AMBA driver > > >>>>> xilinx-vck190-20231:/home/petalinux# dmesg | grep -i coresight > > >>>>> [ 1.865006] cs_system_cfg: CoreSight Configuration manager > > initialised > > >>>>> [ 1.876858] coresight etm0: CPU0: etm v4.0 initialized > > >>>>> [ 1.885666] coresight etm1: CPU1: etm v4.0 initialized > > >>>>> [ 1.894435] coresight-cpu-debug f0d00000.debug1: Coresight > debug- > > >> CPU0 > > >>>> initialized > > >>>>> [ 1.902072] coresight-cpu-debug f0d40000.debug1: Coresight > debug- > > >> CPU1 > > >>>> initialized > > >>>>> > > >>>>> xilinx-vck190-20231:/home/petalinux# ls > /sys/bus/coresight/devices/ > > >>>>> etm0 etm1 funnel0 tmc_etf0 > > >>>>> > > >>>>> cd /sys/bus/coresight/devices/ echo 1 > tmc_etf0/enable_sink > > >>>>> echo 1 > etm0/enable_source echo 0 > etm0/enable_source echo 0 > > > >>>>> tmc_etf0/enable_sink cd /root/ dd if=/dev/tmc_etf0 > > >>>>> of=cstrace_28Jun.bin > > >>>>> > > >>>>> ./ptm2human/ptm2human -e -i cstrace.bin -d > > >>>> > > >>>> Please note that ptm2human is for PTM trace decoding and > > >>>> ETMv4 uses a different format and thus is not compatible. > > >>>> > > >>>>> > > >>>>> I also tried OpenCSD integration with PERF. > > >>>> > > >>>> Have you made sure the perf is "linked" to the opencsd ? > > >>> > > >>> Earlier I statically linked but after adding CORESIGHT=1. > > >>> > > >>> > > >>> linux-xlnx$ make ARCH=arm64 NO_LIBELF=1 NO_JVMTI=1 VF=1 > > >> CORESIGHT=1 -C > > >>> tools/perf/ > > >>> make: Entering directory 'linux-xlnx/tools/perf' > > >>> BUILD: Doing 'make -j24' parallel build > > >>> > > >>> Makefile.config:520: *** Error: No libopencsd library found or the > > >>> version > > >> is not up-to-date. > > >>> Please install recent libopencsd to build with CORESIGHT=1. Stop. > > >>> > > >>> > > >>> echo $CSINCLUDES > > >>> /scratch/development/coresight/my-opencsd/decoder/include > > >>> radheys@xhdradheys41:/scratch/development/linux-xlnx$ ls > > >>> /scratch/development/coresight/my-opencsd/decoder/include > > >>> common i_dec interfaces mem_acc opencsd opencsd.h > > >>> pkt_printers > > >>> > > >>> echo $CSLIBS > > >>> /scratch/development/coresight/my-opencsd/decoder/lib/builddir > > >>> radheys@xhdradheys41:/scratch/development/linux-xlnx$ ls > > >> /scratch/development/coresight/my-opencsd/decoder/lib/builddir > > >>> libopencsd.a libopencsd_c_api.so libopencsd_c_api.so.1.4.0 > > >> libopencsd.so.1 > > >>> libopencsd_c_api.a libopencsd_c_api.so.1 libopencsd.so > > >> libopencsd.so.1.4.0 > > >>> > > >>> Anything I am missing to fix this opencsd lib not found? > > >> > > >> There is a minimum version of 1.1.1 but it looks like you are using > > >> higher than that so that part should be fine. > > >> > > >> Personally I "make install" OpenCSD to the system path. I had a > > >> play around with $CSLIBS it and maybe there is also some stickyness > > >> to the feature detection so a make clean might help to make sure > > >> the errors you are seeing are real. > > >> > > >> Lastly you can print the output of why the feature test compilation > > >> failed which might help. I see some linking issues in there if I > > >> delete my system installed version of OpenCSD, so there might be a > > >> bug with just using CSINCLUDES and CSLIBS: > > >> > > >> $ cat tools/build/feature/test-libopencsd.make.output > > >> > > >> /usr/bin/ld: warning: libopencsd.so.1, needed by opencsd- > > >> local/decoder/lib/builddir//libopencsd_c_api.so, not found (try > > >> using -rpath or -rpath-link) > > >> /usr/bin/ld: opencsd-local/decoder/lib/builddir//libopencsd_c_api.so: > > >> undefined reference to `vtable for StmTrcPacket' > > >> /usr/bin/ld: opencsd-local/decoder/lib/builddir//libopencsd_c_api.so: > > >> undefined reference to `DecodeTree::getDecoderStats(unsigned char, > > >> _ocsd_decode_stats**)' > > >> /usr/bin/ld: opencsd-local/decoder/lib/builddir//libopencsd_c_api.so: > > >> undefined reference to > > >> `DecodeTree::addRawFramePrinter(RawFramePrinter**, unsigned int)' > > >> > > >> Can you try the make install and see if that works? If that works > > >> but the other way doesn't I can try looking into why its not and make a > fix. > > > > > > I tried make install but still it errors out. Looking at make.output > > > I am seeing multiple undefined references. > > > > > > NOTE I have to still set CSINCLUDES and CSLIBS as we are > > > cross-compiling Perf on a x86 host machine. > > > > This should still work if you make install them to the arch specific > > folder for example /usr/lib/aarch64-linux-gnu/. If do 'apt install > libopencsd-dev:arm64' > > I would get the arm ones in there. > > > > Then if I cross build like this I get openCSD linked: > > > > make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -C tools/perf > > CORESIGHT=1 > > > > So for now you should be able to work around the issue in this way. > > I tried copying opencsd libraries to /usr/lib/aarch64-linux-gnu but still I see > undefined reference. Is it because I am using cross-compiler from server > (toolchain path set to $PATH variable)? > > /proj//Vitis/2023.2/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux- > gnu-gcc > I assume CSLIBS and CSINCLUDES should be sufficient to cross compile perf > with coresight support? FYI, I tried with static linking and could proceed to perf compilation. make LDFLAGS=-static NO_LIBELF=1 NO_JVMTI=1 VF=1 CORESIGHT=1 -C tools/perf/ ... libbfd-liberty-z: [ OFF ] ... libopencsd: [ on ] ... libunwind-x86: [ OFF ] But it ended with compilation failure. Seems like OpenCSD version mismatch. I will try to downgrade opencsd library and see if it fixes. util/cs-etm-decoder/cs-etm-decoder.c: In function 'cs_etm_decoder__gen_trace_elem_printer': util/cs-etm-decoder/cs-etm-decoder.c:567:9: error: enumeration value 'OCSD_GEN_TRC_ELEM_INSTRUMENTATION' not handled in switch [-Werror=switch-enum] 567 | switch (elem->elem_type) { > > > > > > > > > cat tools/build/feature/test-libopencsd.make.output > > paths> > > > > > > aarch64-xilinx-linux-ld.real: warning: libopencsd.so.1, needed by > > > libopencsd_c_api.so, not found (try using -rpath or -rpath-link) > > > aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined > > > reference to > > `vtable for StmTrcPacket' > > > aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined > > > reference to > > `DecodeTree::getDecoderStats(unsigned char, _ocsd_decode_stats**)' > > > aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined > > > reference to > > `DecodeTree::addRawFramePrinter(RawFramePrinter**, unsigned int)' > > > aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined > > > reference to > > `DecodeTree::logMappedRanges()' > > > aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined > > > reference to > > `OcsdLibDcdRegister::deregisterAllDecoders()' > > > aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined > > > reference to > > `PtmTrcPacket::toString(std::__cxx11::basic_string > std::char_traits, std::allocator >&) const' > > > aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined > > > reference to > > `DecodeTree::s_error_logger' > > > aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined > > > reference to > > `DecodeTree::addBinFileRegionMemAcc(_ocsd_file_mem_region const*, > int, > > _ocsd_mem_space_acc_t, std::__cxx11::basic_string > std::char_traits, std::allocator > const&)' > > > aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined > > > reference to > > `EtmV4ITrcPacket::~EtmV4ITrcPacket()' > > > aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined > > > reference to > > `OcsdLibDcdRegister::getDecoderRegister()' > > > aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined > > > reference to > > `typeinfo for TraceComponent' > > > aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined > > > reference to > > `EtmV3TrcPacket::~EtmV3TrcPacket()' > > > aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined > > > reference to > > `OcsdTraceElement::toString(std::__cxx11::basic_string > std::char_traits, std::allocator >&) const' > > > aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined > > > reference to > > `DecodeTree::addGenElemPrinter(TrcGenericElementPrinter**)' > > > aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined > > > reference to > > `DecodeTree::DestroyDecodeTree(DecodeTree*)' > > > aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined > > > reference to > > `ocsdError::getErrorString[abi:cxx11](ocsdError const&)' > > > aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined > > > reference to > > `DecodeTree::setGenTraceElemOutI(ITrcGenElemIn*)' > > > aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined > > > reference to > > `ocsdError::ocsdError(ocsdError const*)' > > > aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined > > > reference to > > `ocsdError::ocsdError(_ocsd_err_severity_t, _ocsd_err_t, unsigned int, > > unsigned char, std::__cxx11::basic_string > std::char_traits, std::allocator > const&)' > > > aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined > > > reference to > > `EtmV4ITrcPacket::toString(std::__cxx11::basic_string > std::char_traits, std::allocator >&) const' > > > aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined > > > reference to > > `DecodeTree::createDecoder(std::__cxx11::basic_string > std::char_traits, std::allocator > const&, int, CSConfig const*)' > > > aarch64-xilinx-linux-ld.real: libopencsd_c_api.so: undefined > > > reference to > > `StmTrcPacket::StmTrcPacket()' > > > > > > > Yes this looks like what I see as well. There is probably some issue > > with CSLIBS not being propagated to all parts of the build. I would > > recommend using the system library path for now and I will look into a fix > next week. > > Unless you are happy to look into it and send a fix that would be great too. > > > > James > > > > > Thanks, > > > Radhey > > > > > >> > > >> Thanks > > >> James > > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel