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 4F138A0487 for ; Mon, 1 Jul 2019 13:26:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2378D5680; Mon, 1 Jul 2019 13:26:41 +0200 (CEST) Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) by dpdk.org (Postfix) with ESMTP id CFFA231FC for ; Mon, 1 Jul 2019 13:26:37 +0200 (CEST) Received: by mail-lf1-f66.google.com with SMTP id 136so8517466lfa.8 for ; Mon, 01 Jul 2019 04:26:37 -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=JpocQbU459tIiG0W8TV3xZU8qZhBqtpcDsx1My2x0D7+AExmAIEor1qVZhJoc2nLpF 71mYwpO3T+T5X6fRDciBpF35pv8meniHovvN2JC5W8pbdqaMRCb2RQnCp2GZ4ktdxaUV CfpVlENcVieoJZwSsMsbGYBJTY9QliYVqylYEbI7QqGbq2hOoTc3JQlKU63a19b55lML ApgM7ZvYV2SG7j23N6WWv2D+pX435cLEWclYURSI0QS+Wikrdas1FGtIKya+3GO2F59z n4r4+F8LAmtcAs4621kuboIIUcyitwxTdQ3fmHkRECYdpEz8/YRZWN2Z2I1n91N+TFQD qQDg== 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=HJ3PlyehdvalNqDpGVqGV8YgUNm2D0uL8mhpb2m0uPirUAoC6jiEnqLTEea0cVJkyQ qPA6iPRLiAbOrnk/yZfge6bxLFH9ahSPj3q6jfm0TREWtKpRYliwLqqhp9fbBsvivJBK elXDqmJ4hHu/6MtwZs7kWUKkit9pbaWRyGYk06rqSAwuNde+FQQbL7C0089GxFpsmW4f rkIVm+V2wOT+JhFGNahu0gSb9Tru3l3oFf6VZzV1M0Vpe5Wj2Qanvhf+BMcG/RdYPcKk 6vLA/Xofxu644LGcfsGDIO2o18gHFw1BHTwDuLUYnGZ6irrZypSL38bS8mesGLA/ojES hUjQ== X-Gm-Message-State: APjAAAWqzY6TstFHzaXdnNHI+dkGNknGYpjnerd7wo1mWJwI54oAOLVP HtPPSyuoemPjwr/fPCe4cDNegkVncjo= X-Google-Smtp-Source: APXvYqy34bS+G/y+Cx4knq29tnLDPNWTFLVPmvQzhquIPk7HtkvyFEsgtExFBg183h6SlkhYq+wnTA== X-Received: by 2002:a05:6512:30a:: with SMTP id t10mr11327681lfp.22.1561980397255; Mon, 01 Jul 2019 04:26:37 -0700 (PDT) Received: from tj-idea-500s.lan (user-94-254-233-31.play-internet.pl. [94.254.233.31]) by smtp.gmail.com with ESMTPSA id h3sm3211640lja.93.2019.07.01.04.26.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Jul 2019 04:26:36 -0700 (PDT) From: Tomasz Jozwiak To: dev@dpdk.org, fiona.trahe@intel.com, tjozwiakgm@gmail.com, shallyv@marvell.com, arturx.trybula@intel.com Date: Mon, 1 Jul 2019 13:26:21 +0200 Message-Id: <1561980385-3223-3-git-send-email-tjozwiakgm@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561980385-3223-1-git-send-email-tjozwiakgm@gmail.com> References: <1561674337-22086-1-git-send-email-tjozwiakgm@gmail.com> <1561980385-3223-1-git-send-email-tjozwiakgm@gmail.com> Subject: [dpdk-dev] [PATCH v5 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