From patchwork Thu Jul 7 16:06:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Wise X-Patchwork-Id: 9219151 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4FEE960574 for ; Thu, 7 Jul 2016 16:10:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FA0028236 for ; Thu, 7 Jul 2016 16:10:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3391628249; Thu, 7 Jul 2016 16:10:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0A0928236 for ; Thu, 7 Jul 2016 16:10:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751517AbcGGQKe (ORCPT ); Thu, 7 Jul 2016 12:10:34 -0400 Received: from smtp.opengridcomputing.com ([72.48.136.20]:46183 "EHLO smtp.opengridcomputing.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751482AbcGGQKe (ORCPT ); Thu, 7 Jul 2016 12:10:34 -0400 Received: from smtp.ogc.us (build2.ogc.int [10.10.0.32]) by smtp.opengridcomputing.com (Postfix) with ESMTP id 8E6CF29E69; Thu, 7 Jul 2016 11:10:28 -0500 (CDT) Received: by smtp.ogc.us (Postfix, from userid 503) id 6EEEEE08C7; Thu, 7 Jul 2016 11:10:28 -0500 (CDT) Message-Id: <4257b3f1d2c22af577a5e584d2a34013342fb0ca.1467907759.git.root@stevo1.asicdesigners.com> From: Steve Wise Date: Thu, 7 Jul 2016 09:06:34 -0700 Subject: [PATCH] Add transactions per second to latency tests To: gilr@mellanox.com Cc: linux-rdma@vger.kernel.org Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For duration (-D) latency tests, it is useful to have the average transactions per second (tps) output. So ib_*_lat now shows average tps: --------------------------------------------------------------------------------------- #bytes #iterations t_avg[usec] tps average 2 1008430 2.97 168068.16 --------------------------------------------------------------------------------------- Signed-off-by: Steve Wise --- src/perftest_parameters.c | 5 +++-- src/perftest_parameters.h | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/perftest_parameters.c b/src/perftest_parameters.c index 1cf4985..55d894b 100755 --- a/src/perftest_parameters.c +++ b/src/perftest_parameters.c @@ -2443,13 +2443,14 @@ void print_report_lat_duration (struct perftest_parameters *user_param) int rtt_factor; double cycles_to_units; cycles_t test_sample_time; - double latency; + double latency, tps; rtt_factor = (user_param->verb == READ || user_param->verb == ATOMIC) ? 1 : 2; cycles_to_units = get_cpu_mhz(user_param->cpu_freq_f); test_sample_time = (user_param->tcompleted[0] - user_param->tposted[0]); latency = (((test_sample_time / cycles_to_units) / rtt_factor) / user_param->iters); + tps = user_param->iters / (test_sample_time / (cycles_to_units * 1000000)); if (user_param->output == OUTPUT_LAT) { printf("%lf\n",latency); @@ -2458,7 +2459,7 @@ void print_report_lat_duration (struct perftest_parameters *user_param) printf(REPORT_FMT_LAT_DUR, user_param->size, user_param->iters, - latency); + latency, tps); printf( user_param->cpu_util_data.enable ? REPORT_EXT_CPU_UTIL : REPORT_EXT , calc_cpu_util(user_param)); } } diff --git a/src/perftest_parameters.h b/src/perftest_parameters.h index 07c539c..7c1c871 100755 --- a/src/perftest_parameters.h +++ b/src/perftest_parameters.h @@ -180,7 +180,7 @@ #define RESULT_FMT_LAT " #bytes #iterations t_min[usec] t_max[usec] t_typical[usec]" -#define RESULT_FMT_LAT_DUR " #bytes #iterations t_avg[usec] " +#define RESULT_FMT_LAT_DUR " #bytes #iterations t_avg[usec] tps average" #define RESULT_EXT "\n" @@ -202,7 +202,7 @@ /* Result print format for latency tests. */ #define REPORT_FMT_LAT " %-7lu %d %-7.2f %-7.2f %-7.2f" -#define REPORT_FMT_LAT_DUR " %-7lu %d %-7.2f" +#define REPORT_FMT_LAT_DUR " %-7lu %d %-7.2f %-7.2f" #define CHECK_VALUE(arg,type,minv,maxv,name) \ { arg = (type)strtol(optarg, NULL, 0); if ((arg < minv) || (arg > maxv)) \