Received: by 10.192.165.148 with SMTP id m20csp1615666imm; Wed, 25 Apr 2018 22:54:06 -0700 (PDT) X-Google-Smtp-Source: AIpwx49fQrpkTzRJvgr5tFYilrkJKjJy5eONJv73VXPETdwIuomgd1eL84ey2QXz1Xqe8Kf060ER X-Received: by 10.99.49.205 with SMTP id x196mr23926544pgx.397.1524722046058; Wed, 25 Apr 2018 22:54:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524722045; cv=none; d=google.com; s=arc-20160816; b=YEiFqtZx8H3+lSzdYBxwGToy2thvc9WeNbOXm6Hux8/2amFkz5NkEMGI6iYAVE4Ewl HgT9eK8dEj3Z6/DIPxwPpp8cDdiSs62josCXoIhaf7wDVgrZtrTDNG7mkGVCzRo2kRkm hwcyhi8GISYxXKIs1VwPlbrD7KE3l9vsBDe8LHQKFAuD+pFrJ7pmSiXVKCfzUWpTIcGc 5rpTltXaY+IEAmJZ104+Ajg5nLesKzigqZDfFWj+/BRb79RmF5ARsHnJTw5GTfrwbtRk Fh7o7/IVnffg6kEBVxBsXs/CU6C3EqLnlc1MEbCKyWVlZku8/p0iEEFGEzv7gtnQxagq F0Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=oS42BVblM5iBKiebHX0AZmTvq5230u9OXQLtiCHB+dc=; b=db4NH0CfJztkn7SvuNdpMbJL5sphc60vJxxJtlwsrRSOpLTNHafqYaFXTOmc67R7LH AnH3WARSZe+6a/O4ZkNG5AwauDXft7QF2UADkd4IX9zhQotqHKxPHtQnTrG8JK0TZaxB BLlarmLktrQH+kz0kI+KBn2QUJScOkb8+/EB7Ym65fHxPOe6QCOyxyfglHy6fRZkpWW0 rhfId3RgM/1ehhNePbw+YNWBvcmd+MyeH1F/0Weeow7HBM4pxclX6fy6oOhXezbIuU+T Uzf/C27ty0m7FlUCV0YAXyp58jRWK3UQtGjq9JE4jh7992VGk3cmO7UcfD/Lk3ma6Bf8 2zVQ== ARC-Authentication-Results: i=1; mx.google.com; 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 j67si4820377pgc.509.2018.04.25.22.53.52; Wed, 25 Apr 2018 22:54:05 -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; 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 S1753219AbeDZFwl (ORCPT + 99 others); Thu, 26 Apr 2018 01:52:41 -0400 Received: from terminus.zytor.com ([198.137.202.136]:43959 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752566AbeDZFwe (ORCPT ); Thu, 26 Apr 2018 01:52:34 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w3Q5qR7A1777005; Wed, 25 Apr 2018 22:52:27 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w3Q5qRms1777002; Wed, 25 Apr 2018 22:52:27 -0700 Date: Wed, 25 Apr 2018 22:52:27 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Thomas Richter Message-ID: Cc: tmricht@linux.ibm.com, brueckner@linux.ibm.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, acme@redhat.com, hpa@zytor.com, mingo@kernel.org, heiko.carstens@de.ibm.com, schwidefsky@de.ibm.com Reply-To: brueckner@linux.ibm.com, linux-kernel@vger.kernel.org, tmricht@linux.ibm.com, mingo@kernel.org, hpa@zytor.com, heiko.carstens@de.ibm.com, schwidefsky@de.ibm.com, tglx@linutronix.de, acme@redhat.com In-Reply-To: <20180423081745.3672-1-tmricht@linux.ibm.com> References: <20180423081745.3672-1-tmricht@linux.ibm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf list: Remove s390 specific strcmp_cpuid_cmp function Git-Commit-ID: ce04abfbd3ea545a8eb38a8b6a48fb6e7d139dcb X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: ce04abfbd3ea545a8eb38a8b6a48fb6e7d139dcb Gitweb: https://git.kernel.org/tip/ce04abfbd3ea545a8eb38a8b6a48fb6e7d139dcb Author: Thomas Richter AuthorDate: Mon, 23 Apr 2018 10:17:45 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 23 Apr 2018 11:03:13 -0300 perf list: Remove s390 specific strcmp_cpuid_cmp function Make the type field in pmu-events/arch/s390/mapfile.cvs more generic to match the created cpuid string for s390. The pattern also checks for the counter first version number and counter second version number ([13]\.[1-5]) and the authorization field which follows. These numbers do not exist in the cpuid identification string when perf commands are executed on a z/VM environment (which does not support CPU counter measurement facility). CPUID string for LPAR: cpuid : IBM,3906,704,M03,3.5,002f CPUID string for z/VM: cpuid : IBM,2964,702,N96 This allows the removal of s390 specific cpuid compare code and uses the common compare function with its regular expression matching algorithm. Signed-off-by: Thomas Richter Reviewed-by: Hendrik Brueckner Cc: Heiko Carstens Cc: Martin Schwidefsky Link: http://lkml.kernel.org/r/20180423081745.3672-1-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/arch/s390/util/header.c | 18 ------------------ tools/perf/pmu-events/arch/s390/mapfile.csv | 10 +++++----- tools/perf/util/pmu.c | 2 +- 3 files changed, 6 insertions(+), 24 deletions(-) diff --git a/tools/perf/arch/s390/util/header.c b/tools/perf/arch/s390/util/header.c index a4c30f1c70be..163b92f33998 100644 --- a/tools/perf/arch/s390/util/header.c +++ b/tools/perf/arch/s390/util/header.c @@ -146,21 +146,3 @@ char *get_cpuid_str(struct perf_pmu *pmu __maybe_unused) zfree(&buf); return buf; } - -/* - * Compare the cpuid string returned by get_cpuid() function - * with the name generated by the jevents file read from - * pmu-events/arch/s390/mapfile.csv. - * - * Parameter mapcpuid is the cpuid as stored in the - * pmu-events/arch/s390/mapfile.csv. This is just the type number. - * Parameter cpuid is the cpuid returned by function get_cpuid(). - */ -int strcmp_cpuid_str(const char *mapcpuid, const char *cpuid) -{ - char *cp = strchr(cpuid, ','); - - if (cp == NULL) - return -1; - return strncmp(cp + 1, mapcpuid, strlen(mapcpuid)); -} diff --git a/tools/perf/pmu-events/arch/s390/mapfile.csv b/tools/perf/pmu-events/arch/s390/mapfile.csv index ca7682748a4b..78bcf7f8e206 100644 --- a/tools/perf/pmu-events/arch/s390/mapfile.csv +++ b/tools/perf/pmu-events/arch/s390/mapfile.csv @@ -1,6 +1,6 @@ Family-model,Version,Filename,EventType -209[78],1,cf_z10,core -281[78],1,cf_z196,core -282[78],1,cf_zec12,core -296[45],1,cf_z13,core -3906,3,cf_z14,core +^IBM.209[78].*[13]\.[1-5].[[:xdigit:]]+$,1,cf_z10,core +^IBM.281[78].*[13]\.[1-5].[[:xdigit:]]+$,1,cf_z196,core +^IBM.282[78].*[13]\.[1-5].[[:xdigit:]]+$,1,cf_zec12,core +^IBM.296[45].*[13]\.[1-5].[[:xdigit:]]+$,1,cf_z13,core +^IBM.390[67].*[13]\.[1-5].[[:xdigit:]]+$,3,cf_z14,core diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index 61a5e5027338..af4bedf4cf98 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c @@ -586,7 +586,7 @@ char * __weak get_cpuid_str(struct perf_pmu *pmu __maybe_unused) * cpuid string generated on this platform. * Otherwise return non-zero. */ -int __weak strcmp_cpuid_str(const char *mapcpuid, const char *cpuid) +int strcmp_cpuid_str(const char *mapcpuid, const char *cpuid) { regex_t re; regmatch_t pmatch[1];