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 72D34A046B for ; Wed, 26 Jun 2019 18:31:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 62A5E2BE5; Wed, 26 Jun 2019 18:30:54 +0200 (CEST) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by dpdk.org (Postfix) with ESMTP id E286E2B98 for ; Wed, 26 Jun 2019 18:30:46 +0200 (CEST) Received: by mail-wm1-f65.google.com with SMTP id a15so2767549wmj.5 for ; Wed, 26 Jun 2019 09:30:46 -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=7tgU6qs64B716E7hP1GF5n2LLyCLNfi02XQLdiW5qxI=; b=ShVDJXnFqofKee/QjUF6cBEhYPWo1tb64hkQHZ1ZQyPPs61+EBxAPPwD80Du96gsCN +F6Bgbt0svqDNardR70g8MHWM3kV9QIMmUGJ2yisSgr2yEGmdj1hNecpGpcPLpVMmo3m 9GLY9bkIEHkYC5+9KC/2qjya6Nn2fyOzAs0aQp77RUvCf6b2fp4xMD47RZG4TILV60Ly VoaqWWNpVJRGQMew6Sxy5NBO5XuNfkhPici55dn1dSx5q31+ae+rdebSLBBNzag36YhR aiq9m/+2UavkEGaKdDOEDlc223KwPCnjiITxdElRQJGYvlcrJn5yXfagslqfwyCdF/+J Vfjw== 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=7tgU6qs64B716E7hP1GF5n2LLyCLNfi02XQLdiW5qxI=; b=W21YKESmDxGeEVfUSSPC55lhz3SBZG1N3rvH+4Fa4GX6Rhwy39BQk2kpPMY6ULechd zr4IRwXN0AWAf1Io5w7/I34M2+EDirvDiTPJ/wVp21XhK9aKBhMMeCOcpcadyGXO3h+D ja2N8s9fjZi5sc+JxGrRCkq2FQ9qOmsn7wBpfITHR/gRJaR09d+8CzgqVbxNdyAY/h0/ BA13h8Y7miPPdlZZwHiQE4QOMttd/YmviQ/Rh/iIulrehUaXAaBngRT4txdKD5FW/jaB pBvWdUuNl2X8Z31y91WiXZBtQuogg2AUAmQJt9q80XLNkwXSREeHP4VJR3bHE7pJ7WVh HVHA== X-Gm-Message-State: APjAAAUBhAPN8ohJOtst/Z+pN3i4zlkM4Uw3bXfHx0nV8BUdqXPhL/Vd 5L0wiv57z7qxWJOatUNU1eOsBsKFZTGT4Q== X-Google-Smtp-Source: APXvYqzVfvOW0Tz8xI1iLeyH8khSOhPI78CrjHQrZgEShuPqgxEGHLDcqggj0XBUwdDzZRAc7sTr7w== X-Received: by 2002:a1c:ef10:: with SMTP id n16mr3084005wmh.134.1561566646457; Wed, 26 Jun 2019 09:30:46 -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 n10sm16989663wrw.83.2019.06.26.09.30.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Jun 2019 09:30:45 -0700 (PDT) From: Tomasz Jozwiak To: dev@dpdk.org, fiona.trahe@intel.com, tjozwiakgm@gmail.com, shallyv@marvell.com, arturx.trybula@intel.com Date: Wed, 26 Jun 2019 18:30:28 +0200 Message-Id: <1561566633-12329-3-git-send-email-tjozwiakgm@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561566633-12329-1-git-send-email-tjozwiakgm@gmail.com> References: <1560032553-15528-1-git-send-email-tjozwiakgm@gmail.com> <1561566633-12329-1-git-send-email-tjozwiakgm@gmail.com> Subject: [dpdk-dev] [PATCH v3 2/7] 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 --- app/test-compress-perf/comp_perf_options_parse.c | 36 ++++++++++++++++++++++++ 1 file changed, 36 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..07672b2 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,37 @@ 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 + }, + { + cperf_test_type_strs[CPERF_TEST_TYPE_PMDCC], + CPERF_TEST_TYPE_PMDCC + } + }; + + 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 +532,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 +552,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