Received: by 10.223.164.221 with SMTP id h29csp1041935wrb; Mon, 16 Oct 2017 17:35:39 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBC0nsp1pR6YMvzjWnCTE5x4k2fcqQh/jk5stYBi0aKl8FoTvaEnzBMBx9MMkI6+IgNkXj6 X-Received: by 10.84.217.131 with SMTP id p3mr10638233pli.126.1508200539194; Mon, 16 Oct 2017 17:35:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508200539; cv=none; d=google.com; s=arc-20160816; b=QehqPmVczS6VMHXS4DbtL2x/Wp7uYezdTOUqFE3XkzzZE/+pGyEXHCtCRl4h72Yfaj slGudaAfr97YPRpqa2lHT0snBNhCHOydI0og51Taz31IhmoAFQeh9STRxyOEK7OkA2Lw DwK8RhzFtlxQhii/R2wHytqBCIYeFBperwlw5MOwwgmdk1WALdeFSLwdhUwTSbrl1Ruf xgfgRZHINy/ijg93Zc3PM7JEEIm0LvHQqW7JMEuMVkj+uSL2D1ngMLV7x2+yQbFRSraX 4cTMmnh9GPfdtj7PPh6KwXijysZVa7P6r312RSpppRuRW5DS6rZrOSmuGZfv+eBk6XnG 9x+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:arc-authentication-results; bh=SqhuEZuVF+07eaIXaYcj/JU7H7dF9X8ukvZ8159v0rs=; b=MVnuZSz+CKdzVhf7IiO7CMnyvaYnB5A8EyHU/q+YYbFOljRbYU5iNLYvLj9ssx+qas Y/cCv6r727rlBeuTvMHvohoY61FApMvxd79/vGi6koLCdK6A8DYiFELR0thVOgRpyvgU 1ndMqJwIuRDMWAwy4KeizjJBCKxceZQNlmahjCSPHLLyOXdWy6LTiScmvg8qQpR0bU50 g+uuPJxVthnz2HbOAWpTmIsNHJIJJGy7zwLsticPEoK8HYqsHExD2BZfMc+3iOIHXIEA Dxvua13T1hO5IsoOK/61rQPhZDB5UcyCYRE6z1TrK8HivtNSBldSdWtAs+l7aeIGktMp 9Mcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=L+1qtTAY; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a15si5316947pll.406.2017.10.16.17.35.25; Mon, 16 Oct 2017 17:35:39 -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=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=L+1qtTAY; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756451AbdJPSds (ORCPT + 99 others); Mon, 16 Oct 2017 14:33:48 -0400 Received: from mail-sn1nam01on0045.outbound.protection.outlook.com ([104.47.32.45]:59727 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756671AbdJPSdI (ORCPT ); Mon, 16 Oct 2017 14:33:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=SqhuEZuVF+07eaIXaYcj/JU7H7dF9X8ukvZ8159v0rs=; b=L+1qtTAYdu4wYik49nhLo5sr45SR8naB58AMDovp4g0WRRXeeh2z2u4lSwEgheyhwTaWm/S58xCrwpVoUrQvt0ZsLL8wD//ZyYT5HHXPUTFcC2c02Gd+U5Y1/8UmsMWam56H1LGGzTt+U2cY2DwK2lygAKzsFWQQw5AKFC8oxS4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ganapatrao.Kulkarni@cavium.com; Received: from mypc.caveonetworks.com (111.93.218.67) by CY1PR07MB2570.namprd07.prod.outlook.com (10.167.16.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Mon, 16 Oct 2017 18:33:02 +0000 From: Ganapatrao Kulkarni To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Will.Deacon@arm.com, catalin.marinas@arm.com, mark.rutland@arm.com, acme@kernel.org, alexander.shishkin@linux.intel.com, peterz@infradead.org, mingo@redhat.com, jnair@caviumnetworks.com, zhangshaokun@hisilicon.com, Jonathan.Cameron@huawei.com, Robert.Richter@cavium.com, gklkml16@gmail.com Subject: [PATCH v9 3/5] perf utils: use pmu->is_uncore to detect PMU UNCORE devices Date: Tue, 17 Oct 2017 00:02:20 +0530 Message-Id: <20171016183222.25750-4-ganapatrao.kulkarni@cavium.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20171016183222.25750-1-ganapatrao.kulkarni@cavium.com> References: <20171016183222.25750-1-ganapatrao.kulkarni@cavium.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: DM5PR2201CA0043.namprd22.prod.outlook.com (10.174.180.160) To CY1PR07MB2570.namprd07.prod.outlook.com (10.167.16.25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 61cf79e9-fb3b-4da1-2c51-08d514c45821 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075);SRVR:CY1PR07MB2570; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2570;3:tg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91IGCpR4G7Ni+0A2WOoKGi2A1v3QmcKT2IKNGDONfG3EB9kX5m1UZpoFTgvmS4BGjbiahNM7U19q5oFpHvkj7Syu1Fs60RuJbRoEKixPjq8w36Gg3Rr5sHiQYIzEoFfd+lWXvUJRQzTPsjdckHQN7ojGRIIIsoAr2zbgoW6rydv4vE+qJcTZ/BJ8oI2ulxGdSsRx4RrYCQDQdr5WAiPN3mJ+aAyVpJC5ueZJRqk+9Q0CpPfEcnHWZcb3KiPLv9jD1FGuCYYLxJ79TE0DW5cWm6D6frO2S7zMy8UPqzSEoXOaPGzRcvu3WPPSNQuzA6yk3H1wyX4zzpLGdn1hkvsfX;4:QoJB5tzPdXnrqVrqsCpolbkkGQbujNlNgZL1fiVBTPCW0eVsjb/Po7TD/Xw+MQQ72gM0R6R07cibO+1xaQbiIn0ymagTdPvPHG23wXVgTY+uo5UoCCiNedZ8SeaiY71TT7YgK9NoR/GAWmeYSIQ0UCPMuPsaikJBFJE/Nh9huyAq5v3p4j9bvISd3beRzIVILUXrO4BYQnM8yDee1/4hfjGx0NpmXENl7QgiydxspTyEmR2GDMDfDRxyqJIvWSz4Q0iYXk9a+pybt3vzH/EqkwvSW6utu6ptznpgaoiE/CI= X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123558100)(20161123560025)(20161123564025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY1PR07MB2570;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY1PR07MB2570; X-Forefront-PRVS: 0462918D61 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(376002)(346002)(189002)(199003)(5660300001)(86362001)(33646002)(7416002)(25786009)(2906002)(36756003)(7736002)(16526018)(305945005)(81156014)(81166006)(316002)(69596002)(48376002)(50466002)(97736004)(16586007)(8676002)(6116002)(53416004)(76176999)(5009440100003)(50226002)(8936002)(101416001)(3846002)(50986999)(1076002)(106356001)(72206003)(105586002)(478600001)(5003940100001)(6512007)(189998001)(39060400002)(6666003)(6506006)(68736007)(2950100002)(53936002)(4326008)(6486002)(47776003)(66066001)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR07MB2570;H:mypc.caveonetworks.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR07MB2570;23:/fFa0ZZYrrpJaVIKTQnSanQ9+KC7ciPIZUYOX9IUR?= =?us-ascii?Q?unbwqCn/CyS96etceLr7551zMGPo7tncTdrf/2G9BZXH/fkTqkR4V0RckGUw?= =?us-ascii?Q?jRyDSBdVexD9eLG9jwmlbRVZre77VE9te1ckNDu7HM6cJ2EXCn8/oJLIskem?= =?us-ascii?Q?beu5uEJBh2Tqxt4xQy0IBpUq1muB3x8egjJRVjxzgwpAJxd8b/yGc+mKJYxJ?= =?us-ascii?Q?UNsotnWPb4mOvYekWNG7B8l9ONdjrIJFcc1elzyDvwiN3KiyNquGdiVWTNMy?= =?us-ascii?Q?Z9BQf48JzlQ0DNCzv6swJ/HVoqX/AoBDixLYMiX3TZYXCkrgplHDqnu7i2Nk?= =?us-ascii?Q?HJyKKatZrXMxwOFs5J3mRBuGzQwuu2JXZ1OAE9VNCYQX6L+2EoZ9ToO+S3WM?= =?us-ascii?Q?yd0HbiO79uIZTSByoKca4CMTRIXmElKc9OgC62hkc8nhcz5deAJrWOr4yKYm?=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P9dSunoBzecUBe7eKjW8MaYJNyLH6Ergdy3A230tRzi6JeVQSWTtcI5H3BLdwFi3799WYSR6qvjcgtHyOCarh+S1NoidJ8KP7jvambUeqhBRcbyneQBSnW/G06AJmuDdMf6hCz0nTExrX6DuN6qO9oZjUMeYo7MA5RGyFJ16+h4mc54DyYveQpAOhBTSu29y8UFE/cY6QgkFKmhhZ6bE+ndlG74VLr4BSKxyDt0GG3JC4GSnLfUrusDXfSuTS0R9thQSI4V2ac4xyhLHQN6neyOg==;5:R3XK74xLpSN3sjiiMTuCrXdxILZu2Hb58SxJaZpdULSCVJJApJjaicvExqDATNeD0D4A7C8AyPhPF+cn4J5p/Dt0RUnJcptolIX/fVT2wEXuyT4jK+t9FtHovlgUVB8hOFzr9AupMmutmVurAsex6fcXTBEzUFbXvhUlBt9MQx0=;24:+JrkUw+eCqrQ75Iyx7W3lxdNO7EXdCFJFwJUjbdsZS99OkWpFLgnGW9gm0Gci2MKqjzdpky3ss6qyIJIlU8ewJ7Ee2lCL5wp6+6vOuj4/s0=;7:GFEf2RGtR8JS3oCDFxv/d3av1VrqlnDf+y4PAtXM2+oSZdkDueQ1xl7QgLWH42xIxie2U5WfJ4PFGGPUsKdyyTc8S+9XyddJuSf3Ebuecao6mD5IFsJFtV5vEu7BMeEJIgq2vEFB05+blclGb1ysbAQfDJUqRdWJiSXi4JPVl6YlXXQu0h4buZ0JTmx0xpciTYN2yJSi2fCDyqzHkXNAOYMUNssX+8MGJjGbD3CZEhw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2017 18:33:02.0007 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2570 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org PMU CORE devices are identified using sysfs filename cpu, however on some platforms(like arm/arm64), PMU CORE sysfs name is not cpu. Hence cpu cannot be used to differentiate PMU CORE/UNCORE devices. commit: 66ec1191 ("perf pmu: Unbreak perf record for arm/arm64 with events with explicit PMU") has introduced pmu->is_uncore, which is set to PMU UNCORE devices only. Adding changes to use pmu->is_uncore to identify UNCORE devices. Acked-by: Will Deacon Tested-by: Shaokun Zhang Signed-off-by: Ganapatrao Kulkarni --- tools/perf/util/pmu.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index 8b17db5..9110718 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c @@ -603,7 +603,6 @@ static void pmu_add_cpu_aliases(struct list_head *head, struct perf_pmu *pmu) */ i = 0; while (1) { - const char *pname; pe = &map->table[i++]; if (!pe->name) { @@ -612,9 +611,13 @@ static void pmu_add_cpu_aliases(struct list_head *head, struct perf_pmu *pmu) break; } - pname = pe->pmu ? pe->pmu : "cpu"; - if (strncmp(pname, name, strlen(pname))) - continue; + if (pmu->is_uncore) { + /* check for uncore devices */ + if (pe->pmu == NULL) + continue; + if (strncmp(pe->pmu, name, strlen(pe->pmu))) + continue; + } /* need type casts to override 'const' */ __perf_pmu__new_alias(head, NULL, (char *)pe->name, -- 2.9.4 From 1587377630901823067@xxx Thu Dec 21 07:27:57 +0000 2017 X-GM-THRID: 1585844813410483000 X-Gmail-Labels: Inbox,Category Forums