Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934148AbdGTF5G (ORCPT ); Thu, 20 Jul 2017 01:57:06 -0400 Received: from mail-bn3nam01on0071.outbound.protection.outlook.com ([104.47.33.71]:2848 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932306AbdGTF47 (ORCPT ); Thu, 20 Jul 2017 01:56:59 -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 2/4] perf tools arm64: Add support for get_cpuid_str function. Date: Thu, 20 Jul 2017 11:26:06 +0530 Message-Id: <20170720055608.5333-3-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: 9bae8fc6-91ee-42ce-14d6-08d4cf342186 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);SRVR:C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DoGBYNYhkis0GKDSpK2sdGjF3Uk2cCOvSiTZUVufKq2Wg8R/cUYN3Ppd1dB8LuK4n32rMtZVyk3MyAF5YAJQNe5usLUjWxwO67TlX2d2O0iGnJjRqyW7xxFnaybQDzF7K6Mr43bt/qrQXmt+dkjpBuk8NI2KqClmOAbWiJYCHvkQ6QTxRMKjMkBGn0XxjGKqfNRXfpccuKLNeAbqOEiU6aEL4xvstPk2I5z7Pj99by+WlBkVSanbS9dlpFLcLTuAdiz+Si7Klj6Jys6diqBnMkez13ysH0uKbGpWr/g4JrQyoctBb3s4pX9yFZkCyceIjBzWG5OtQ0fYjytM9Gahe4UK96VTLU2eJx/eclWLWi/cvFmiq96Sghda8= X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2571;20:uJxHAHtYy2Efw5gZT+tgUJ4WWGO8Sx3qrY9qlZukrKoKuIfQhjLLebI9MEvV6ZsdHSRqM5EiTnVxqg24xmpij9NLYFwOeuDysaV/3dt3zM8tsyHboBxNuhkQSPlFjbW6eSatFzz+akAzAvdbngkg9QE1/JFu36ZlgRcxvF+3z+CqYoEGJv14G3IzmgA2MuKNnOdAPju5td1EqsYvRqGl+DHarBqAvyWi0J1nW82T+dnuT7ahJ1CF2rht4WVH42OGIrA5coY0Gb/qpwXcqIExe2GcoyIua7KYC4jGruuKZNF7A0h+/u0B6F3dlC89fjvY5ZgjA0qHsHoeozi+jpGiF+xWNewv93Un+VJq1UCxupKliN0YZLYSc1NRKc+04KEVxAVqlBK4Rg3KAOqXrXd+iQWTxKw8/O3uZrVPvAvvKMB5LcysN4eTasyYOlv3A6HpQBKzxZa/XkZFVmS1v59w8eSXfYdmkwdJzVr8UboilGA6kHJ050m/rAoZxRT7xWCL X-Exchange-Antispam-Report-Test: UriScan:(133145235818549)(209352067349851)(236129657087228)(148574349560750); 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:jCdFzz5JeUwVIi/JqQ7N+n/3gVpJPWsWr8VLKaV/DV?= =?us-ascii?Q?Ri1Lq2atFmebqwau2AOOYfsnTZbvJYDYlBd94MS6InYObS/1tI/YyBojlhKh?= =?us-ascii?Q?pabydrN0Bt7JOewoWw31Tzdx35feYDajGRMZl/3+U6G6+hv+FDh8WISJSIsJ?= =?us-ascii?Q?g69li9fdIqWRP2im9qi8jJss6kZmdXffnJtc1HbIdgz7fsgUqBSqcPJMgaNM?= =?us-ascii?Q?71UzUgP2apYAkcWhHUjxi5V9AmFyG4uS1e4M8HMzUVUghq1aLlCRJ8Kf+6ok?= =?us-ascii?Q?Is84fW5cfkml6mz3aOueRlV0tSBImZUZ0Ts7oBlw5tcz04zMgKcJ1gZ/n/fk?= =?us-ascii?Q?z/qOVQ4VrWSKWiCLcCZiaWxs4edMcqkzfoufm3FuLgTpqmdj4IoJcXgkXj8p?= =?us-ascii?Q?rV42iPFMcFQ+qu4xtK7dy+arsXB3mxAwh0PKCfDjeK/E7V98FxvgGsekIQFA?= =?us-ascii?Q?tnWZ1mznllrbLNIlsHSU797WwjUJSaRamRwkiKQ870QIOCYcXWMMf9E1eTep?= =?us-ascii?Q?nXUMv410vwLppW9neFOzWc7pOV3xTu0iTIkT9DXb979oG9E/7YrgHBSUhV8p?= =?us-ascii?Q?zj6ViBeDoHLEoMWDnds0XQnkJe5K8srF0LbbLNvEtOVwiT8ffIi1Q5vbtfSa?= =?us-ascii?Q?48ArZfUa3LmbYzRYSJTq5fMffxjnT14qef4LUZGD9MH4hPTZ+ia9eB+dBykV?= =?us-ascii?Q?F722O1e4VwcwdGfAmcNA5SB2HlfLkfNSF42GUjBdgCkCl+OD67+ah8TAMN/y?= =?us-ascii?Q?l5sE8ajik4Yh/TYpHJ99gYu44NOdrs4onZBd/fAGcV0jFd+4SHQ6sUM45joD?= =?us-ascii?Q?zMengU3uJ+y7xh0ekP8lAxgAW7X2D3wh2+Np8KaL+E745VNmhA0EWT8leFIn?= =?us-ascii?Q?rhWaF3yYscA5O9ToN0Pfq3YaertH8ok/YFJiKZxY0vR7wM9E5dYK2xuf89ZY?= =?us-ascii?Q?jjgqD34FVLVeA7iiviK186+sr9PFQQqoTdoxG0sWmI/feS+HgxVndM1jEaQT?= =?us-ascii?Q?8nXLVcX9sIkxsfd9nuOK/Rgh3Gfdjh1al/QBH9M/QI7T6IvedGeq5ep57NT+?= =?us-ascii?Q?QwR61U9DgKErnrXHnKLbCbOomXlqJgNClKhUXOz6vCxMuRJYRzkP9uRpxT++?= =?us-ascii?Q?rbmfB/Jg8YOpA0dWQ1Ij4Y+D1qyQ0x5PZ4JGQwd6RAxlEDgLboRdtBE8vcM2?= =?us-ascii?Q?v1Gi2QYzEg3uMoCu6THFcu9aAyxaEESs7CeBlhIJYGvUuOCHGQEyge4UFu7N?= =?us-ascii?Q?HJD89F1Dn97pTMqhBvNYZC8UkLHyZH6EESl0pqYdUgIZMhl5yZdeAMLtTLpJ?= =?us-ascii?Q?4L+J8TExsZICoTyOkzDq9ZKG+YkSzcp8E2HKgEgVWD?= 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);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:vrQ1NAIu0Dm4C7BC84jykagfuwjVyPnCFDS3u+3jB?= =?us-ascii?Q?0YexRjrVqfiYGJlRZ0pi5oYiNQ9CsnQH8RAPOKE5ttEQXQFbOAFd3hLwO3Pu?= =?us-ascii?Q?Sbx+FxIFpT169jAHGEb4mLTFtbiuJvU1QT7fFu1oqoIGD16Nacb62kRyODHU?= =?us-ascii?Q?2JMRRC5nVzNg2xwYwkGJ3YtzKus2NsifkP67nkd7x3A7MSF3daMMOUcUtcXP?= =?us-ascii?Q?BqJytPKxP51RfJ28RP1rmdzEWrN8kJBv6i7kh04VJwC55y7XzB/qMj7lefkG?= =?us-ascii?Q?+Tq/kNwMtjaKsU556LdtnNlg20FcuWW3aatKRkSmAdEJQ2PmztZUKCrbMXLm?= =?us-ascii?Q?oBQxWUFZ8+UVz7/pYc8AAM1B9gN72fplLZ9c9dfkM3UwRA74yly6b5kNM0B8?= =?us-ascii?Q?m1R/1NbC78bN1JCznOrcF53InulUXHcc1TCMeISglJccyBaRk/YI4a0jM86k?= =?us-ascii?Q?dGT4oh3RNj64Cn16I6N5lZ3frVmoVVNMTyQiuvcSndT+YHyhJ0XPm57vFvyP?= =?us-ascii?Q?gtRidjZctb9UPyXX/ot/HFKMVZ6hcXnSvmeRVY+gCqG4DFLl4qv4rwYg08fT?= =?us-ascii?Q?G49VQer0mYAhpYz6vpRVTen652acIeODSB4W4NSjh2mnyZuuCq7f2PvQOmal?= =?us-asc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xpNIKSYeKnXVdgm?= =?us-ascii?Q?P1zDvizidcuEhIPB/vKjt8Q9E4Fgw65iDttUtGkiCBIt/Qafvrpu+awHfTMK?= =?us-ascii?Q?jWqhPsYQCbu0p+PjfxQV4KLIIQeMymopADrLjCMh46Z9kXwe+DkQdeqeXLSw?= =?us-ascii?Q?ybyGUEh4MUUOaU6f85C2waI0r/AwUP9qYPmhD6aaa9xRefHjrUKHBRKFov/c?= =?us-ascii?Q?oJi8fFgKdagVNHze58knNDPH7ivllE3MMW7SzC0iF1pFC2VDv7YdTibqBP79?= =?us-ascii?Q?55ACOmAba5M+NK8tgobXdwZ72ZNMFsrB/+wcGOKKIy/jdZUwmBDolO2W3X/d?= =?us-ascii?Q?EJrc4onbk74HTI5PtZWKPJHcW0vJjyYH1FAoprrzE722LnIBmJZvK0aWvyuH?= =?us-ascii?Q?TpsqCaWCHEFPybltc1qc/PLWTFodn7emsCY/5C2y9/dXPUreV2qrToau9vpU?= =?us-ascii?Q?Seu9b+0cU6cJ25Erkqme1+oGrPWbmM1fYolg4WZ2lYjWQfP4tXrf7KLXqnV5?= =?us-ascii?Q?gm3iz5X0KTjRMXaHsgPYwlWS9SPfh7N3B3p4edtoL4YVV4fbo+wH02m5HcqU?= =?us-ascii?Q?IgimMmReyfaj3kuvIm7GzSy41RQ2q3dmunD6WofHHrLuDgHbqEPW2jgT/2Pq?= =?us-ascii?Q?jUFk5vpVwtstGKwBnWAAuBEZbV25+NEvccAjcVNNzEpkBFuhf9BSxEA4wG0f?= =?us-ascii?Q?S+XQ9cRjWFIuqTh5ehQepx7CqHvULFlPbPwWfU+85tAxk0x6Oyqztn7FgXnW?= =?us-ascii?Q?4=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2571;5:7JUkLpVvCqWtiGBiybZBm3egJDIASCRXBxyqVOjpwuVUEx5d6ltKgX/chItKsSuu9foeDf5GtMixMABr0xe0ATTLPB8vFYdvWZ+kwE+DBsm/2GEm+L48Jtb4ZtYGcqj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UoUADTLJ5BG5AN+ebil0zOEFRI4FQ2KwuRDDULdEsJVgbLTxyjSBAOJbiTONquUIGIMT7YEGjTMCRRZsPjK5Z0EUGkfS4gnLSLCaU6mfHN8RCEia4Ks7a3lrAgPeXId0rmbQFUgpyQcT1YrwUtKoFe+62EasWa+AEclwMloDYykJVPrZ7Jw66c25r1z2QACTLdtx/xK81TvNeSY1+vjaG/m04Ri3Ybf+9fHHNYHqSgkMvym8OWpADKuWow8Sr6Vn7LuRl+hjstDnY+js4SjRKQ2FqlN1o2BhvPZ1RIiqxk= X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2017 05:56:53.2047 (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: 2215 Lines: 86 function get_cpuid_str returns MIDR string of the first online cpu from the range of cpus associated with the pmu core device. Signed-off-by: Ganapatrao Kulkarni --- tools/perf/arch/arm64/util/Build | 1 + tools/perf/arch/arm64/util/header.c | 59 +++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 tools/perf/arch/arm64/util/header.c diff --git a/tools/perf/arch/arm64/util/Build b/tools/perf/arch/arm64/util/Build index cef6fb3..b1ab72d 100644 --- a/tools/perf/arch/arm64/util/Build +++ b/tools/perf/arch/arm64/util/Build @@ -1,3 +1,4 @@ +libperf-y += header.o libperf-$(CONFIG_DWARF) += dwarf-regs.o libperf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o diff --git a/tools/perf/arch/arm64/util/header.c b/tools/perf/arch/arm64/util/header.c new file mode 100644 index 0000000..4e25498 --- /dev/null +++ b/tools/perf/arch/arm64/util/header.c @@ -0,0 +1,59 @@ +#include +#include +#include +#include "header.h" + +#define MIDR "/regs/identification/midr_el1" +#define MIDR_SIZE 128 + +char *get_cpuid_str(struct perf_pmu *pmu) +{ + char *buf = malloc(MIDR_SIZE); + char *temp = NULL; + char path[PATH_MAX]; + const char *sysfs = sysfs__mountpoint(); + int cpu, ret; + unsigned long long midr; + struct cpu_map *cpus; + FILE *file; + + if (!pmu->cpus) + return NULL; + + if (!sysfs) + return NULL; + + /* read midr from list of cpus mapped to this pmu */ + cpus = cpu_map__get(pmu->cpus); + for (cpu = 0; cpu < cpus->nr; cpu++) { + ret = snprintf(path, PATH_MAX, + "%s/devices/system/cpu/cpu%d"MIDR, + sysfs, cpus->map[cpu]); + if (ret == PATH_MAX) { + pr_err("sysfs path crossed PATH_MAX(%d) size\n", PATH_MAX); + goto err; + } + + file = fopen(path, "r"); + if (!file) + continue; + + temp = fgets(buf, MIDR_SIZE, file); + fclose(file); + if (!temp) + continue; + + /* Ignore/clear Variant[23:20] and + * Revision[3:0] of MIDR + */ + midr = strtoll(buf, NULL, 16); + midr &= (~(0xf << 20 | 0xf)); + snprintf(buf, MIDR_SIZE, "0x%016llx", midr); + cpu_map__put(cpus); + return buf; + } + +err: cpu_map__put(cpus); + free(buf); + return NULL; +} -- 2.9.4