From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0988CA046B for ; Fri, 28 Jun 2019 00:26:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5265B2BE5; Fri, 28 Jun 2019 00:26:05 +0200 (CEST) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by dpdk.org (Postfix) with ESMTP id 8E91C2956 for ; Fri, 28 Jun 2019 00:25:56 +0200 (CEST) Received: by mail-wm1-f68.google.com with SMTP id g135so7177406wme.4 for ; Thu, 27 Jun 2019 15:25:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=OUlnXD5O0akuCYU09OtW1++1378IaRTy+SbIWcFwExk=; b=hQfwsUC9Ywj1WW25QJPiRq+h9gLu3vt4JF9bqT0PfmOGUcCJRJvs79mfXNy7TSUqR8 2cojgM/1z1+BG7l9Xr7qeyzO5CuDkW562h8zXlRbvpVWnBUGGZpC/btNisvLxxpr3MeM 8NRjJ5RZK2WZewesXe6pv9OWmco3JrxSzCXC695rbSERT1OfKSvbcJn++/3+IL7njRq/ NSUyx+7Vh803Lw/8pXPFhYNvYBgwE7aZWm/37nFSa60vx81zujMXhxD/qCeuwqh+VvZy TRw1yWkJSNimsjl3yf36Qe1D22Nne3j5hThq30508PQzMF5OOxAST+ojkqWE9Rf1pKVp iwRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=OUlnXD5O0akuCYU09OtW1++1378IaRTy+SbIWcFwExk=; b=CQHVjlyaZmmfI2uS+G1OPxZ0VpXmItaA+lTdKaEW5cWd/voOU5JPsSXEHmFBpM+eQW GfUxyTAN/xzEk4D9Lfa4EAwFc9MmPztBXph8KngeAYYZIN7TC2qzFNlHbWPjYTDiQnEM 1AF1dpGBwoQxgRbMt2M7HHmwcwdme4H+5ZxE0TRn7UicdwJeQitwOopeE/Un0zJqRClU TdnresuAFNz8dn7PZWGePUvDoHCaQMhgd9mpY/MvcUN4GHAAXZFxZIcvPt/jJy6+jqlC XGzU9T06XyQS6D8tzMjCoIvZ8A96vF2fRWruksLqZUbvpaVzHx58fqqVeDwyHbbQE2w6 +k8g== X-Gm-Message-State: APjAAAUCvsQRvxDwtzgQGDPylDVwMeISIrLk8oilmVOfPqADEKQAtrps 7vrqExc66hlyZwHwHwQGdrgHs23l1D5ppA== X-Google-Smtp-Source: APXvYqyS2PoLzzLFKRAB/nbbOwLBZ5EmJsYxazAbV4xjsgthplQbm817Tjo/tBYw6gvgcgvivIMxDA== X-Received: by 2002:a1c:4987:: with SMTP id w129mr4505263wma.41.1561674356040; Thu, 27 Jun 2019 15:25:56 -0700 (PDT) Received: from localhost.localdomain (178.43.130.103.ipv4.supernova.orange.pl. [178.43.130.103]) by smtp.gmail.com with ESMTPSA id t14sm428236wrr.33.2019.06.27.15.25.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 27 Jun 2019 15:25:55 -0700 (PDT) From: Tomasz Jozwiak To: dev@dpdk.org, fiona.trahe@intel.com, tjozwiakgm@gmail.com, shallyv@marvell.com, arturx.trybula@intel.com Date: Fri, 28 Jun 2019 00:25:33 +0200 Message-Id: <1561674337-22086-3-git-send-email-tjozwiakgm@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561674337-22086-1-git-send-email-tjozwiakgm@gmail.com> References: <1561566633-12329-1-git-send-email-tjozwiakgm@gmail.com> <1561674337-22086-1-git-send-email-tjozwiakgm@gmail.com> Subject: [dpdk-dev] [PATCH v4 2/6] app/test-compress-perf: add ptest command line option X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Tomasz Jozwiak This patch adds --ptest option to make possible a choose of test case from command line. Signed-off-by: Tomasz Jozwiak Signed-off-by: Tomasz Jozwiak --- app/test-compress-perf/comp_perf_options_parse.c | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/app/test-compress-perf/comp_perf_options_parse.c b/app/test-compress-perf/comp_perf_options_parse.c index bc4b98a..7888ab6 100644 --- a/app/test-compress-perf/comp_perf_options_parse.c +++ b/app/test-compress-perf/comp_perf_options_parse.c @@ -15,6 +15,7 @@ #include "comp_perf_options.h" +#define CPERF_PTEST_TYPE ("ptest") #define CPERF_DRIVER_NAME ("driver-name") #define CPERF_TEST_FILE ("input-file") #define CPERF_SEG_SIZE ("seg-sz") @@ -37,6 +38,7 @@ static void usage(char *progname) { printf("%s [EAL options] --\n" + " --ptest benchmark / verify :" " --driver-name NAME: compress driver to use\n" " --input-file NAME: file to compress and decompress\n" " --extended-input-sz N: extend file data up to this size (default: no extension)\n" @@ -76,6 +78,33 @@ get_str_key_id_mapping(struct name_id_map *map, unsigned int map_len, } static int +parse_cperf_test_type(struct comp_test_data *test_data, const char *arg) +{ + struct name_id_map cperftest_namemap[] = { + { + cperf_test_type_strs[CPERF_TEST_TYPE_BENCHMARK], + CPERF_TEST_TYPE_BENCHMARK + }, + { + cperf_test_type_strs[CPERF_TEST_TYPE_VERIFY], + CPERF_TEST_TYPE_VERIFY + } + }; + + int id = get_str_key_id_mapping( + (struct name_id_map *)cperftest_namemap, + RTE_DIM(cperftest_namemap), arg); + if (id < 0) { + RTE_LOG(ERR, USER1, "failed to parse test type"); + return -1; + } + + test_data->test = (enum cperf_perf_test_type)id; + + return 0; +} + +static int parse_uint32_t(uint32_t *value, const char *arg) { char *end = NULL; @@ -499,6 +528,8 @@ struct long_opt_parser { }; static struct option lgopts[] = { + + { CPERF_PTEST_TYPE, required_argument, 0, 0 }, { CPERF_DRIVER_NAME, required_argument, 0, 0 }, { CPERF_TEST_FILE, required_argument, 0, 0 }, { CPERF_SEG_SIZE, required_argument, 0, 0 }, @@ -517,6 +548,7 @@ static int comp_perf_opts_parse_long(int opt_idx, struct comp_test_data *test_data) { struct long_opt_parser parsermap[] = { + { CPERF_PTEST_TYPE, parse_cperf_test_type }, { CPERF_DRIVER_NAME, parse_driver_name }, { CPERF_TEST_FILE, parse_test_file }, { CPERF_SEG_SIZE, parse_seg_sz }, -- 2.7.4