Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934215AbdGTF6F (ORCPT ); Thu, 20 Jul 2017 01:58:05 -0400 Received: from mail-bn3nam01on0061.outbound.protection.outlook.com ([104.47.33.61]:19799 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934120AbdGTF5D (ORCPT ); Thu, 20 Jul 2017 01:57:03 -0400 Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=cavium.com; 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, Robert.Richter@cavium.com, gpkulkarni@gmail.com Subject: [PATCH v4 3/4] perf utils: Add helper function is_pmu_core to detect PMU CORE devices Date: Thu, 20 Jul 2017 11:26:07 +0530 Message-Id: <20170720055608.5333-4-ganapatrao.kulkarni@cavium.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170720055608.5333-1-ganapatrao.kulkarni@cavium.com> References: <20170720055608.5333-1-ganapatrao.kulkarni@cavium.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BMXPR01CA0044.INDPRD01.PROD.OUTLOOK.COM (10.174.214.30) To CY1PR07MB2571.namprd07.prod.outlook.com (10.167.16.26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: baa4e862-7dca-45f2-f57b-08d4cf34244e X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRV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Xm/f+EantugaR5innFB+5c5yOkQsdompGSt6wIzPZPqPvBoeVZaU3rezbnhBMWGVtq+JwvF3fVB53HT448CWYcbhyF8LYgj9lOile911r/UX94h6Zh9qGKacuh7oNzmwy1umAmWsOzhTkZKzHrxteS9J3QiAZUPQco09xWdM5W58B2qEr7zVjDlkQsN8koMXI7Hu6bN/+NDa7c/a5GrdjAXyZjck5gZqaWF0nct45Tyg7K3xN48J0Ao56kzwHz30z+/WmYyA0bkni0d8lDTwTJVcUx8BuBvQ4Ex1C7e+0AjVKwC3gWiPwwwe1N5DHCHD5Fjam9+v62sxoZ8EnIpZwj8AXRoy6MJzGL0aaHZ3w8PnYU9aGIUH1jad+U2q4kM= X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2571;20:I6ng6hHV6H9WCXyUcMPsL+HkFPmgRxvVhoBN/BKpr24c6kT+jxKPq/3pdc/tIK647zHJ3qJc0l/QMwg8Qv8gu27QiGgPh2H2mgxoysnq5wYGYDKj/f5te3bWS2IzmrXfaJYQRJRXXuMUj8ZKKD1DyTacDoxii8yCUCmEieeBpc/eqzePhyqykZXDyrWHnqe3d92gptl5mXotW0wzacku5VqABzaSKP7omiXnbi7IP+L2QkSSeXkQyL2GzX6tZxu6DddPJM9+fw8fCwVgPdbw6+KwYja1sqTAOxWz8BJeGf4gF/MG8+1SR1ziVRSL+nQMRY6p5puoNcpKCjFUEKzbBuieUshKl7ERqolGFuPR+jnB9ZcOzpAUovlcwgTebE3BAdJ2Lzcz6AdvjljOABeC0PCi9Xv6o5N/hDVGtyhuz+RHywPeKEdtD+5UeUA2SlLSxVjdDik5l2TCttw38OXaMmWywmgY469mkrW8HW6A9dp2bZhHfG7GoBoEsHsWVuGW X-Exchange-Antispam-Report-Test: UriScan:(236129657087228); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(2017060910075)(5005006)(8121501046)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6041248)(20161123564025)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123558100)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY1PR07MB2571;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY1PR07MB2571; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR07MB2571;4:a85eapqQt1uaVnFsvZkoLXbFUjMaVaWAjhumL4OVNZ?= =?us-ascii?Q?1g6N9u3mOmBH54aVUmdcGOTfgOIrsrJhOUp12HAQAoYhZW3SrpH9WatZPGOU?= =?us-ascii?Q?ndy+BD5AdsXMzNnVDbOrOyf7JoUxDFhBw8WZRzPmz/QCaCE8YGZ4YDvNr6X9?= =?us-ascii?Q?jPRiNfXX7NDSuBlI+1jDEsuRTEwxWQKyytCCnV67cPEMJvhTuW1A33+hbhpj?= =?us-ascii?Q?wlSr8DZk5I9Vzi+h3NYdTETWR6w1DZ+QPQ8W2Qg6BEx31Bk60MsiAtiHkyIV?= =?us-ascii?Q?GWiLphMS5eUIp0rimrVVp/HoDAP36BGXAH6fNJdpDLsuiDwHjwNQgQwT3Q9J?= =?us-ascii?Q?WeKpVljSVnC0WoUSxCG4B3RXs0+u+HOv2afgFwSCV9L3eWdEuIjO6Kxhqt09?= =?us-ascii?Q?BS1sm5Ck0KpFPR8QlLtiHTtUUasMYbrGs0t3ILuYjzHszmrPo4wqXC9sYmxa?= =?us-ascii?Q?Qt6D6eNbwZORmdbpHNM68Pv+uFQEDy9lY12o2Rdi6mKhDlvWFw4IEJzF++Ll?= =?us-ascii?Q?mEghNRQ2tVZ2xOJRVU8VB0lbSJZdb5xz7tGNClLQmnun++R8oAmkILygh7Ww?= =?us-ascii?Q?GIxkLcsjh57AwYMtoe17TJITHivPcFVsAPj7mvXga2P+9o1ehHkWMgaoVAC3?= =?us-ascii?Q?rUO8LuVNd4wFondsykCy5QPZFDXb0DhFOQkHuu9JFdpZt/D5eQlQx+879rTx?= =?us-ascii?Q?fq71sNb7AgE0KSiP8FqwbcNOI93wvzDIbF6VazoR9X3cuj+UPx2WgQPug8hT?= =?us-ascii?Q?TgvYFc0fOA/QyZldm3ReLnGnfy5Eb2cr7ttXaIKrfbWsjzIspNe9qbdNZtbX?= =?us-ascii?Q?j3aTL6GzaZLBhSXguI+E8/rfkp9dVxrmHMxtbThzdPP3Pd3MazD0gC12GlOu?= =?us-ascii?Q?wzoIdF0qb2f2Dv2xuQm9ajduPQQK+mosiVWbsHbFC0gdmowdn1oMGGRN0nVn?= =?us-ascii?Q?0bUfzVh19ii5C+9YkV50vhEaB/r9KxpN+RVid2A86RkIHy+UzGvmbE7TYVu2?= =?us-ascii?Q?gM9KURiLwft7paezMTQpM0p9OGVV+saTQ5I5XRNrg9zY46NaERUxix3JgMmf?= =?us-ascii?Q?Q8IGnv7r7rzRFJ/Gda5gwCTIvYUH/RHeHQ0JQtnFoXn04DJr98m7aLIRZ7CV?= =?us-ascii?Q?1hqLpD0qkGyptphAFpIcaxOLAI0MPtxCkFv3r/ff/SQ4JsQgMh7NeTV67NBE?= =?us-ascii?Q?AeO3BZRxraH6kNCQSwDxFVk5Xnc2Zsc2WkgX2lBaGgt3T5A5aybPWsNg=3D?= =?us-ascii?Q?=3D?= X-Forefront-PRVS: 0374433C81 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(7370300001)(4630300001)(6009001)(39450400003)(39840400002)(39860400002)(39400400002)(39410400002)(39850400002)(8676002)(53416004)(478600001)(72206003)(189998001)(7736002)(4326008)(50466002)(53936002)(48376002)(305945005)(6506006)(2906002)(5003940100001)(6666003)(6486002)(76176999)(50986999)(66066001)(5009440100003)(50226002)(25786009)(1076002)(110136004)(2950100002)(81166006)(38730400002)(47776003)(42186005)(36756003)(6512007)(86362001)(3846002)(7416002)(33646002)(7350300001)(5660300001)(6116002)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR07MB2571;H:mypc.caveonetworks.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR07MB2571;23:mkT8ZonTtiFWfhsjcBXZu3HmWdrdXqBzm8CCgzuol?= =?us-ascii?Q?4OcAdN1t0dy7ZePt4/p8WNWdc/upB6IUFqTatQbMFdd6wtu9ZXFcC0wBttJB?= =?us-ascii?Q?0+xgHwaq1vs8v90YUFpWxQSi8d3Va1u798f4pHXvoL4BxMlonGFvB0UJNaGO?= =?us-ascii?Q?KTDdpSLwTf3b3G1HmaH/hbkQ9i3B3AiUI99fnchRSEXRdkX8TijQKywzFZru?= =?us-ascii?Q?Ug9E4wxJ94ww1hQ+mNn6q5GCG+HqTNoAVRQzhHM1VXriqmFxyRm298DsGpVP?= =?us-ascii?Q?7MDHrqFthlO8CUgr+ukO6KRRo+ppLi5nO16QqboHGJMQFk9FqsFdkhY4CaQV?= =?us-ascii?Q?xHotKKizKehvWhB2aAMwA6thtlMrz6lSnT6aGljnKTOr37ght9zNghOvP5TG?= =?us-ascii?Q?SiH4mufTjsHAhVzaqh1YuXrdAA0lavUl7gFEITAgCGKscp/P0IE6tg21h0cj?= =?us-ascii?Q?a3wAQq6U5YjDEFnhX/K9FxW8whMSDBqXQ+kIfg3TjZ/LAzMFsrqfyOl5lAIH?= =?us-ascii?Q?9ghyQnJONrDePRJHNiH6KJQovWd2HYYmeAmuKLsuAE3EQpg5dbouY1A/Oy0K?= =?us-ascii?Q?XGwA8zrObn1lEwr2WIDnkr7/DVgn786UuLBOqR0jEHZMjc1RNerzWIzH01Zq?= =?us-ascii?Q?tJHuiz1RknYVG4Ws7b74fn1xZKwJQDwwHXt+irnW225aTiptSaIuBsoxg7K3?= =?us-ascii?Q?ypjL8SRJiumw0rweBYZzmFagow1TJZgqBgALRAkIPJb8n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+QUijwzCREFhl/kFKoJ9MPWNpbEMnJW/r549UfL1TDloowGvXq3VxW53xjtfDpVY7rw3FmAOT+rdvn+mm+1+6b3tG4WDnIBnUvlkR5oNd6+TuVxNYRQfyJ/wl2vevyzhm/1LWDN7MISlEZ5LoeWUSvHiTkUNCrkKvnwnjC6OFY9Wmed5ZL5CU1gbAPJxihgWpkpYr1DGbOJkZ9yaaCRUFIjqDAs65w+UXzvd/1R93q/RmX8j0lHTZ5Q= X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2017 05:56:57.8610 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2571 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2140 Lines: 80 On some platforms, PMU core devices sysfs name is not cpu. Adding function is_pmu_core to detect as core device using core device specific hints in sysfs. For arm64 platforms, all core devices have file "cpus" in sysfs. Signed-off-by: Ganapatrao Kulkarni --- tools/perf/util/pmu.c | 44 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index aefdbd1..0057d1c 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c @@ -506,6 +506,39 @@ static struct cpu_map *pmu_cpumask(const char *name) } /* + * PMU CORE devices have different name other than cpu in sysfs on some + * platforms. looking for possible sysfs files to identify as core device. + */ +static int is_pmu_core(const char *name) +{ + struct stat st; + char path[PATH_MAX]; + const char *sysfs = sysfs__mountpoint(); + const char **template; + const char *templates[] = { + "%s/bus/event_source/devices/%s/cpus", + NULL + }; + + if (!sysfs) + return 0; + + /* Look for cpu sysfs */ + snprintf(path, PATH_MAX, "%s/bus/event_source/devices/cpu", sysfs); + if ((stat(path, &st) == 0) && + (strncmp(name, "cpu", strlen("cpu")) == 0)) + return 1; + + for (template = templates; *template; template++) { + snprintf(path, PATH_MAX, *template, sysfs, name); + if (stat(path, &st) == 0) + return 1; + } + + return 0; +} + +/* * Return the CPU id as a raw string. * * Each architecture should provide a more precise id string that @@ -558,15 +591,18 @@ static void pmu_add_cpu_aliases(struct list_head *head, const char *name, */ i = 0; while (1) { - const char *pname; pe = &map->table[i++]; if (!pe->name) break; - pname = pe->pmu ? pe->pmu : "cpu"; - if (strncmp(pname, name, strlen(pname))) - continue; + if (!is_pmu_core(name)) { + /* 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