From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 4C0ACA0487 for ; Sun, 9 Jun 2019 00:23:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 702E21BD3C; Sun, 9 Jun 2019 00:22:48 +0200 (CEST) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) by dpdk.org (Postfix) with ESMTP id 566341BD27 for ; Sun, 9 Jun 2019 00:22:45 +0200 (CEST) Received: by mail-lf1-f44.google.com with SMTP id y13so4107087lfh.9 for ; Sat, 08 Jun 2019 15:22:45 -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=D5FTds8avO6WVDSpYxa1BF2bvdHtSrloemTondWdSIWgvmezk00r7Rx0fNXJ7jXmEL 5lN1FG3Ca/fiCowiurhK8SHh8ETpPl3EyHqb7UHKBDdl2Rb9hj5WYdjXrPGRpS4Jcux6 CRXnw028P3yFhZOuGQo+l+kDE00z0+dSdKfk3t/e/wJrWE4HkO8a27nAAzmsu2VyljnQ GwKd5e4+9iAKDa2JcS1ODVEit3tOs3UgSDNzhD1nKmSMwOwz9GrY9pkOADJW5/aTPS6E 0dwCVgWCHwau4fllfcDhOVyjW64tSegZUAbTrVbo1KZhho/m5+UfqcbNKUquinMJjjfL lBBw== 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=kKmdmO6hx0Lt2GAkMGeVHiXB6qpJCr0aHDbY4yfR0MrngZTSL5JrEUhGOvfKEtnyCq T7T0SSVAblDRe33Ym6dF6tR+AgnozZ7aVGl9ZWrdkoVSMwLRXpgrNwkYgxHs98O3WF14 TIuZE70xtVGIrVyzLfHTzA4umGh1hCJtO6DcLfGB6h9PJOOEusik2xIdxx5aOPGhMNcG jsBZpT1CwIiEWDrbruNaP8VeDojLQiWl0DL/uObAUjO6mSyppgQ5lwcwsycOlmmEb4/Q XLyeJbc5VQu9CzouFK5EcxnUQkyZMx68p1HLCOcgddBrsjz1AM9PGW3Qh57DbuspeQaI DSyg== X-Gm-Message-State: APjAAAVpZUyjutuv44vtV6ATyO2LvffvY3YnPTorh/kNaIU9paeK3vCt VJ8YuCsFICTDwRjh1M2gd6giIIbuMKk= X-Google-Smtp-Source: APXvYqztGlFf3IpeJvOwllJP4cQ5J1SeSdguSOnxk3cO93+vZs9y+jXbyoS8BrsHXoNa8JcARS/rRA== X-Received: by 2002:a19:a20a:: with SMTP id l10mr25567995lfe.81.1560032564703; Sat, 08 Jun 2019 15:22:44 -0700 (PDT) Received: from tj-idea-500s.lan (user-5-173-144-53.play-internet.pl. [5.173.144.53]) by smtp.gmail.com with ESMTPSA id w28sm1060597ljd.12.2019.06.08.15.22.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 08 Jun 2019 15:22:44 -0700 (PDT) From: Tomasz Jozwiak To: dev@dpdk.org, fiona.trahe@intel.com, tjozwiakgm@gmail.com, shallyv@marvell.com Date: Sun, 9 Jun 2019 00:22:28 +0200 Message-Id: <1560032553-15528-3-git-send-email-tjozwiakgm@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1560032553-15528-1-git-send-email-tjozwiakgm@gmail.com> References: <1559203588-24046-1-git-send-email-tomaszx.jozwiak@intel.com> <1560032553-15528-1-git-send-email-tjozwiakgm@gmail.com> Subject: [dpdk-dev] [PATCH v2 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