From patchwork Wed Aug 27 10:24:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Ishchuk X-Patchwork-Id: 4787391 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 19DA9C0338 for ; Wed, 27 Aug 2014 10:25:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5801020123 for ; Wed, 27 Aug 2014 10:25:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 62F932015E for ; Wed, 27 Aug 2014 10:25:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933385AbaH0KZo (ORCPT ); Wed, 27 Aug 2014 06:25:44 -0400 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:50083 "EHLO e06smtp15.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933393AbaH0KZn (ORCPT ); Wed, 27 Aug 2014 06:25:43 -0400 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 27 Aug 2014 11:25:42 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 27 Aug 2014 11:25:39 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id A2372219004D; Wed, 27 Aug 2014 11:25:20 +0100 (BST) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s7RAPcMq31719636; Wed, 27 Aug 2014 10:25:38 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s7RAPbJ9003248; Wed, 27 Aug 2014 04:25:38 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s7RAP1jn001480; Wed, 27 Aug 2014 04:25:36 -0600 From: Alexey Ishchuk To: linux-rdma@vger.kernel.org Cc: arlin.r.davis@intel.com, gilr@dev.mellanox.co.il, roland@kernel.org, linux-s390@vger.kernel.org, gmuelas@de.ibm.com, utz.bacher@de.ibm.com, martin.schwidefsky@de.ibm.com, frank.blaschka@de.ibm.com, Alexey Ishchuk Subject: [PATCH 5/5] perftest: support for the s390x platform Date: Wed, 27 Aug 2014 12:24:40 +0200 Message-Id: <1409135080-44991-6-git-send-email-aishchuk@linux.vnet.ibm.com> X-Mailer: git-send-email 1.8.5.5 In-Reply-To: <1409135080-44991-1-git-send-email-aishchuk@linux.vnet.ibm.com> References: <1409135080-44991-1-git-send-email-aishchuk@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14082710-0342-0000-0000-000000DD0209 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds the required platform specific code to allow execution of the perftest package applications on the s390x platform. Signed-off-by: Alexey Ishchuk --- README | 2 ++ src/get_clock.c | 6 ++++++ src/get_clock.h | 8 ++++++++ 3 files changed, 16 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/README +++ b/README @@ -234,3 +234,5 @@ Special feature detailed explanation in Please use the same perftest version on both sides to ensure consistency of benchmark results. 6. This version (5.0) won't work with previous versions of perftest. + + 7. In the s390x platform virtualized environment the results shown by package test applications can be incorrect. --- a/src/get_clock.c +++ b/src/get_clock.c @@ -132,6 +132,7 @@ static double sample_get_cpu_mhz(void) return b; } +#ifndef __s390x__ static double proc_get_cpu_mhz(int no_cpu_freq_fail) { FILE* f; @@ -181,9 +182,13 @@ static double proc_get_cpu_mhz(int no_cp return mhz; } +#endif double get_cpu_mhz(int no_cpu_freq_fail) { +#ifdef __s390x__ + return sample_get_cpu_mhz(); +#else double sample, proc, delta; sample = sample_get_cpu_mhz(); proc = proc_get_cpu_mhz(no_cpu_freq_fail); @@ -199,4 +204,5 @@ double get_cpu_mhz(int no_cpu_freq_fail) return sample; } return proc; +#endif } --- a/src/get_clock.h +++ b/src/get_clock.h @@ -70,7 +70,15 @@ static inline cycles_t get_cycles() asm volatile ("mov %0=ar.itc" : "=r" (ret)); return ret; } +#elif defined(__s390x__) +typedef unsigned long long cycles_t; +static inline cycles_t get_cycles(void) +{ + cycles_t clk; + asm volatile("stck %0" : "=Q" (clk) : : "cc"); + return clk >> 2; +} #else #warning get_cycles not implemented for this architecture: attempt asm/timex.h #include