get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/120230/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 120230,
    "url": "https://patches.dpdk.org/api/patches/120230/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20221129065040.5875-12-syalavarthi@marvell.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20221129065040.5875-12-syalavarthi@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20221129065040.5875-12-syalavarthi@marvell.com",
    "date": "2022-11-29T06:50:39",
    "name": "[v1,11/12] app/mldev: enable reporting stats in mldev app",
    "commit_ref": null,
    "pull_url": null,
    "state": "rejected",
    "archived": true,
    "hash": "79019c93f89a22a4e292620bcd3096a86634e03f",
    "submitter": {
        "id": 2480,
        "url": "https://patches.dpdk.org/api/people/2480/?format=api",
        "name": "Srikanth Yalavarthi",
        "email": "syalavarthi@marvell.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20221129065040.5875-12-syalavarthi@marvell.com/mbox/",
    "series": [
        {
            "id": 25912,
            "url": "https://patches.dpdk.org/api/series/25912/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=25912",
            "date": "2022-11-29T06:50:28",
            "name": "*** implement mldev test application ***",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/25912/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/120230/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/120230/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 2BDBFA0093;\n\tTue, 29 Nov 2022 07:52:09 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id BDF0B42D4F;\n\tTue, 29 Nov 2022 07:51:08 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id B490642D4F\n for <dev@dpdk.org>; Tue, 29 Nov 2022 07:51:06 +0100 (CET)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 2ASNXEAQ020462; Mon, 28 Nov 2022 22:51:06 -0800",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3m3k6wa1nh-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Mon, 28 Nov 2022 22:51:06 -0800",
            "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18;\n Mon, 28 Nov 2022 22:51:03 -0800",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Mon, 28 Nov 2022 22:51:03 -0800",
            "from ml-host-33.caveonetworks.com (unknown [10.110.143.233])\n by maili.marvell.com (Postfix) with ESMTP id 76C333F707A;\n Mon, 28 Nov 2022 22:51:03 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-type; s=pfpt0220; bh=Fp4GeYFPK7uLhRXtvq9brMbYgpLiMLluex6fKNsefRU=;\n b=GjFTd9288zGHES/tgFuipPJ+0q4WYToqtxLNCg7lu8KrrF/JCEUI+c+J9B2cWlFRCO3b\n 0mXTPEqkjQbRAv8Da9u1Gg5TW9CnrQA9gMzwd33IYG2iTZYnP9nIOlXvFsrA57QZ1sin\n 0nQyDAuT+5O4Sv9mTdGiQq9XcHAZg1UMCWtZ5Ni8hjWJnZwsm8ZPmyjlmbFU+exA1azE\n RL9981XIHhomxoWUG4I0F+XVcwK0uDUWBsAJXPDSkHXTGzuWx+mimABssYY4wh3z1tQy\n wYGeya9mI9V0Y5hTcAQd8D77zPWNvUo7DwAGqWLbpJWY7hs3UxmIhOXqTcuJsCAqLQmv Cg==",
        "From": "Srikanth Yalavarthi <syalavarthi@marvell.com>",
        "To": "Srikanth Yalavarthi <syalavarthi@marvell.com>",
        "CC": "<dev@dpdk.org>, <sshankarnara@marell.com>, <jerinj@marvell.com>",
        "Subject": "[PATCH v1 11/12] app/mldev: enable reporting stats in mldev app",
        "Date": "Mon, 28 Nov 2022 22:50:39 -0800",
        "Message-ID": "<20221129065040.5875-12-syalavarthi@marvell.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20221129065040.5875-1-syalavarthi@marvell.com>",
        "References": "<20221129065040.5875-1-syalavarthi@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "iy0mWZCkjn4RZDkM0Az-bhaSGX8ZJVwr",
        "X-Proofpoint-ORIG-GUID": "iy0mWZCkjn4RZDkM0Az-bhaSGX8ZJVwr",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1\n definitions=2022-11-29_05,2022-11-28_02,2022-06-22_01",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "Enable reporting driver xstats and inference end-to-end\nlatency and throughput in mldev inference tests. Reporting\nof stats can be enabled using \"--stats\" option.\n\nSigned-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>\nChange-Id: I1af73ce1e361e88d2ccf2a4ff9916f0d5d8ca6f2\n---\n app/test-mldev/ml_options.c                |  22 ++--\n app/test-mldev/ml_options.h                |   2 +\n app/test-mldev/test_inference_common.c     | 139 +++++++++++++++++++++\n app/test-mldev/test_inference_common.h     |   8 ++\n app/test-mldev/test_inference_interleave.c |   4 +\n app/test-mldev/test_inference_ordered.c    |   1 +\n 6 files changed, 168 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/app/test-mldev/ml_options.c b/app/test-mldev/ml_options.c\nindex 4087ab52db..91052d4593 100644\n--- a/app/test-mldev/ml_options.c\n+++ b/app/test-mldev/ml_options.c\n@@ -36,6 +36,7 @@ ml_options_default(struct ml_options *opt)\n \topt->queue_size = 1;\n \topt->batches = 0;\n \topt->tolerance = 0.0;\n+\topt->stats = false;\n \topt->debug = false;\n }\n \n@@ -222,7 +223,8 @@ ml_dump_test_options(const char *testname)\n \t\t       \"\\t\\t--queue_pairs      : number of queue pairs to create\\n\"\n \t\t       \"\\t\\t--queue_size       : size fo queue-pair\\n\"\n \t\t       \"\\t\\t--batches          : number of batches of input\\n\"\n-\t\t       \"\\t\\t--tolerance        : maximum tolerance (%%) for output validation\\n\");\n+\t\t       \"\\t\\t--tolerance        : maximum tolerance (%%) for output validation\\n\"\n+\t\t       \"\\t\\t--stats            : enable reporting performance statistics\\n\");\n \t\tprintf(\"\\n\");\n \t}\n }\n@@ -242,13 +244,12 @@ print_usage(char *program)\n \tml_test_dump_names(ml_dump_test_options);\n }\n \n-static struct option lgopts[] = {{ML_TEST, 1, 0, 0},\t   {ML_DEVICE_ID, 1, 0, 0},\n-\t\t\t\t {ML_SOCKET_ID, 1, 0, 0},  {ML_MODELS, 1, 0, 0},\n-\t\t\t\t {ML_FILELIST, 1, 0, 0},   {ML_REPETITIONS, 1, 0, 0},\n-\t\t\t\t {ML_BURST_SIZE, 1, 0, 0}, {ML_QUEUE_PAIRS, 1, 0, 0},\n-\t\t\t\t {ML_QUEUE_SIZE, 1, 0, 0}, {ML_BATCHES, 1, 0, 0},\n-\t\t\t\t {ML_TOLERANCE, 1, 0, 0},  {ML_DEBUG, 0, 0, 0},\n-\t\t\t\t {ML_HELP, 0, 0, 0},\t   {NULL, 0, 0, 0}};\n+static struct option lgopts[] = {\n+\t{ML_TEST, 1, 0, 0},\t  {ML_DEVICE_ID, 1, 0, 0},   {ML_SOCKET_ID, 1, 0, 0},\n+\t{ML_MODELS, 1, 0, 0},\t  {ML_FILELIST, 1, 0, 0},    {ML_REPETITIONS, 1, 0, 0},\n+\t{ML_BURST_SIZE, 1, 0, 0}, {ML_QUEUE_PAIRS, 1, 0, 0}, {ML_QUEUE_SIZE, 1, 0, 0},\n+\t{ML_BATCHES, 1, 0, 0},\t  {ML_TOLERANCE, 1, 0, 0},   {ML_STATS, 0, 0, 0},\n+\t{ML_DEBUG, 0, 0, 0},\t  {ML_HELP, 0, 0, 0},\t     {NULL, 0, 0, 0}};\n \n static int\n ml_opts_parse_long(int opt_idx, struct ml_options *opt)\n@@ -283,6 +284,11 @@ ml_options_parse(struct ml_options *opt, int argc, char **argv)\n \twhile ((opts = getopt_long(argc, argv, \"\", lgopts, &opt_idx)) != EOF) {\n \t\tswitch (opts) {\n \t\tcase 0: /* parse long options */\n+\t\t\tif (!strcmp(lgopts[opt_idx].name, \"stats\")) {\n+\t\t\t\topt->stats = true;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\n \t\t\tif (!strcmp(lgopts[opt_idx].name, \"debug\")) {\n \t\t\t\topt->debug = true;\n \t\t\t\tbreak;\ndiff --git a/app/test-mldev/ml_options.h b/app/test-mldev/ml_options.h\nindex 79ac54de98..a375ae6750 100644\n--- a/app/test-mldev/ml_options.h\n+++ b/app/test-mldev/ml_options.h\n@@ -24,6 +24,7 @@\n #define ML_QUEUE_SIZE  (\"queue_size\")\n #define ML_BATCHES     (\"batches\")\n #define ML_TOLERANCE   (\"tolerance\")\n+#define ML_STATS       (\"stats\")\n #define ML_DEBUG       (\"debug\")\n #define ML_HELP\t       (\"help\")\n \n@@ -46,6 +47,7 @@ struct ml_options {\n \tuint16_t queue_size;\n \tuint16_t batches;\n \tfloat tolerance;\n+\tbool stats;\n \tbool debug;\n };\n \ndiff --git a/app/test-mldev/test_inference_common.c b/app/test-mldev/test_inference_common.c\nindex cdd1667c71..d3f0211852 100644\n--- a/app/test-mldev/test_inference_common.c\n+++ b/app/test-mldev/test_inference_common.c\n@@ -11,6 +11,7 @@\n #include <unistd.h>\n \n #include <rte_common.h>\n+#include <rte_cycles.h>\n #include <rte_hash_crc.h>\n #include <rte_launch.h>\n #include <rte_lcore.h>\n@@ -45,6 +46,17 @@\n \t\t}                                                                                  \\\n \t} while (0)\n \n+static void\n+print_line(uint16_t len)\n+{\n+\tuint16_t i;\n+\n+\tfor (i = 0; i < len; i++)\n+\t\tprintf(\"-\");\n+\n+\tprintf(\"\\n\");\n+}\n+\n /* Enqueue inference requests with burst size equal to 1 */\n static int\n ml_enqueue_single(void *arg)\n@@ -54,6 +66,7 @@ ml_enqueue_single(void *arg)\n \tstruct rte_ml_op *op = NULL;\n \tstruct ml_core_args *args;\n \tuint64_t model_enq = 0;\n+\tuint64_t start_cycle;\n \tuint32_t burst_enq;\n \tuint32_t lcore_id;\n \tint16_t fid;\n@@ -61,6 +74,7 @@ ml_enqueue_single(void *arg)\n \n \tlcore_id = rte_lcore_id();\n \targs = &t->args[lcore_id];\n+\targs->start_cycles = 0;\n \tmodel_enq = 0;\n \n \tif (args->nb_reqs == 0)\n@@ -96,10 +110,12 @@ ml_enqueue_single(void *arg)\n \treq->fid = fid;\n \n enqueue_req:\n+\tstart_cycle = rte_get_tsc_cycles();\n \tburst_enq = rte_ml_enqueue_burst(t->cmn.opt->dev_id, args->qp_id, &op, 1);\n \tif (burst_enq == 0)\n \t\tgoto enqueue_req;\n \n+\targs->start_cycles += start_cycle;\n \tfid++;\n \tif (likely(fid <= args->end_fid))\n \t\tgoto next_model;\n@@ -123,10 +139,12 @@ ml_dequeue_single(void *arg)\n \tuint64_t total_deq = 0;\n \tuint8_t nb_filelist;\n \tuint32_t burst_deq;\n+\tuint64_t end_cycle;\n \tuint32_t lcore_id;\n \n \tlcore_id = rte_lcore_id();\n \targs = &t->args[lcore_id];\n+\targs->end_cycles = 0;\n \tnb_filelist = args->end_fid - args->start_fid + 1;\n \n \tif (args->nb_reqs == 0)\n@@ -134,9 +152,11 @@ ml_dequeue_single(void *arg)\n \n dequeue_req:\n \tburst_deq = rte_ml_dequeue_burst(t->cmn.opt->dev_id, args->qp_id, &op, 1);\n+\tend_cycle = rte_get_tsc_cycles();\n \n \tif (likely(burst_deq == 1)) {\n \t\ttotal_deq += burst_deq;\n+\t\targs->end_cycles += end_cycle;\n \t\tif (unlikely(op->status == RTE_ML_OP_STATUS_ERROR)) {\n \t\t\trte_ml_op_error_get(t->cmn.opt->dev_id, op, &error);\n \t\t\tml_err(\"error_code = 0x%\" PRIx64 \", error_message = %s\\n\", error.errcode,\n@@ -159,6 +179,7 @@ ml_enqueue_burst(void *arg)\n {\n \tstruct test_inference *t = ml_test_priv((struct ml_test *)arg);\n \tstruct ml_core_args *args;\n+\tuint64_t start_cycle;\n \tuint16_t ops_count;\n \tuint64_t model_enq;\n \tuint16_t burst_enq;\n@@ -171,6 +192,7 @@ ml_enqueue_burst(void *arg)\n \n \tlcore_id = rte_lcore_id();\n \targs = &t->args[lcore_id];\n+\targs->start_cycles = 0;\n \tmodel_enq = 0;\n \n \tif (args->nb_reqs == 0)\n@@ -212,8 +234,10 @@ ml_enqueue_burst(void *arg)\n \tpending = ops_count;\n \n enqueue_reqs:\n+\tstart_cycle = rte_get_tsc_cycles();\n \tburst_enq =\n \t\trte_ml_enqueue_burst(t->cmn.opt->dev_id, args->qp_id, &args->enq_ops[idx], pending);\n+\targs->start_cycles += burst_enq * start_cycle;\n \tpending = pending - burst_enq;\n \n \tif (pending > 0) {\n@@ -243,11 +267,13 @@ ml_dequeue_burst(void *arg)\n \tuint64_t total_deq = 0;\n \tuint16_t burst_deq = 0;\n \tuint8_t nb_filelist;\n+\tuint64_t end_cycle;\n \tuint32_t lcore_id;\n \tuint32_t i;\n \n \tlcore_id = rte_lcore_id();\n \targs = &t->args[lcore_id];\n+\targs->end_cycles = 0;\n \tnb_filelist = args->end_fid - args->start_fid + 1;\n \n \tif (args->nb_reqs == 0)\n@@ -256,9 +282,11 @@ ml_dequeue_burst(void *arg)\n dequeue_burst:\n \tburst_deq = rte_ml_dequeue_burst(t->cmn.opt->dev_id, args->qp_id, args->deq_ops,\n \t\t\t\t\t t->cmn.opt->burst_size);\n+\tend_cycle = rte_get_tsc_cycles();\n \n \tif (likely(burst_deq > 0)) {\n \t\ttotal_deq += burst_deq;\n+\t\targs->end_cycles += burst_deq * end_cycle;\n \n \t\tfor (i = 0; i < burst_deq; i++) {\n \t\t\tif (unlikely(args->deq_ops[i]->status == RTE_ML_OP_STATUS_ERROR)) {\n@@ -387,6 +415,7 @@ test_inference_opt_dump(struct ml_options *opt)\n \tml_dump(\"queue_pairs\", \"%u\", opt->queue_pairs);\n \tml_dump(\"queue_size\", \"%u\", opt->queue_size);\n \tml_dump(\"tolerance\", \"%-7.3f\", opt->tolerance);\n+\tml_dump(\"stats\", \"%s\", (opt->stats ? \"true\" : \"false\"));\n \n \tif (opt->batches == 0)\n \t\tml_dump(\"batches\", \"%u (default)\", opt->batches);\n@@ -459,6 +488,11 @@ test_inference_setup(struct ml_test *test, struct ml_options *opt)\n \t\t\tRTE_CACHE_LINE_SIZE, opt->socket_id);\n \t}\n \n+\tfor (i = 0; i < RTE_MAX_LCORE; i++) {\n+\t\tt->args[i].start_cycles = 0;\n+\t\tt->args[i].end_cycles = 0;\n+\t}\n+\n \treturn 0;\n \n error:\n@@ -985,3 +1019,108 @@ ml_inference_launch_cores(struct ml_test *test, struct ml_options *opt, int16_t\n \n \treturn 0;\n }\n+\n+int\n+ml_inference_stats_get(struct ml_test *test, struct ml_options *opt)\n+{\n+\tstruct test_inference *t = ml_test_priv(test);\n+\tuint64_t total_cycles = 0;\n+\tuint32_t nb_filelist;\n+\tuint64_t throughput;\n+\tuint64_t avg_e2e;\n+\tuint32_t qp_id;\n+\tuint64_t freq;\n+\tint ret;\n+\tint i;\n+\n+\tif (!opt->stats)\n+\t\treturn 0;\n+\n+\t/* get xstats size */\n+\tt->xstats_size = rte_ml_dev_xstats_names_get(opt->dev_id, NULL, 0);\n+\tif (t->xstats_size >= 0) {\n+\t\t/* allocate for xstats_map and values */\n+\t\tt->xstats_map = rte_malloc(\n+\t\t\t\"ml_xstats_map\", t->xstats_size * sizeof(struct rte_ml_dev_xstats_map), 0);\n+\t\tif (t->xstats_map == NULL) {\n+\t\t\tret = -ENOMEM;\n+\t\t\tgoto error;\n+\t\t}\n+\n+\t\tt->xstats_values =\n+\t\t\trte_malloc(\"ml_xstats_values\", t->xstats_size * sizeof(uint64_t), 0);\n+\t\tif (t->xstats_values == NULL) {\n+\t\t\tret = -ENOMEM;\n+\t\t\tgoto error;\n+\t\t}\n+\n+\t\tret = rte_ml_dev_xstats_names_get(opt->dev_id, t->xstats_map, t->xstats_size);\n+\t\tif (ret != t->xstats_size) {\n+\t\t\tprintf(\"Unable to get xstats names, ret = %d\\n\", ret);\n+\t\t\tret = -1;\n+\t\t\tgoto error;\n+\t\t}\n+\n+\t\tfor (i = 0; i < t->xstats_size; i++)\n+\t\t\trte_ml_dev_xstats_get(opt->dev_id, &t->xstats_map[i].id,\n+\t\t\t\t\t      &t->xstats_values[i], 1);\n+\t}\n+\n+\t/* print xstats*/\n+\tprintf(\"\\n\");\n+\tprint_line(80);\n+\tprintf(\" ML Device Extended Statistics\\n\");\n+\tprint_line(80);\n+\tfor (i = 0; i < t->xstats_size; i++)\n+\t\tprintf(\" %-64s = %\" PRIu64 \"\\n\", t->xstats_map[i].name, t->xstats_values[i]);\n+\tprint_line(80);\n+\n+\t/* release buffers */\n+\tif (t->xstats_map)\n+\t\trte_free(t->xstats_map);\n+\n+\tif (t->xstats_values)\n+\t\trte_free(t->xstats_values);\n+\n+\t/* print end-to-end stats */\n+\tfreq = rte_get_tsc_hz();\n+\tfor (qp_id = 0; qp_id < RTE_MAX_LCORE; qp_id++)\n+\t\ttotal_cycles += t->args[qp_id].end_cycles - t->args[qp_id].start_cycles;\n+\tavg_e2e = total_cycles / opt->repetitions;\n+\n+\tif (freq == 0) {\n+\t\tavg_e2e = total_cycles / opt->repetitions;\n+\t\tprintf(\" %-64s = %\" PRIu64 \"\\n\", \"Average End-to-End Latency (cycles)\", avg_e2e);\n+\t} else {\n+\t\tavg_e2e = (total_cycles * NS_PER_S) / (opt->repetitions * freq);\n+\t\tprintf(\" %-64s = %\" PRIu64 \"\\n\", \"Average End-to-End Latency (ns)\", avg_e2e);\n+\t}\n+\n+\tif (strcmp(opt->test_name, \"inference_ordered\") == 0)\n+\t\tnb_filelist = 1;\n+\telse\n+\t\tnb_filelist = t->cmn.opt->nb_filelist;\n+\n+\tif (freq == 0) {\n+\t\tthroughput = (nb_filelist * t->cmn.opt->repetitions * 1000000) / total_cycles;\n+\t\tprintf(\" %-64s = %\" PRIu64 \"\\n\", \"Average Throughput (inferences / million cycles)\",\n+\t\t       throughput);\n+\t} else {\n+\t\tthroughput = (nb_filelist * t->cmn.opt->repetitions * freq) / total_cycles;\n+\t\tprintf(\" %-64s = %\" PRIu64 \"\\n\", \"Average Throughput (inferences / second)\",\n+\t\t       throughput);\n+\t}\n+\n+\tprint_line(80);\n+\n+\treturn 0;\n+\n+error:\n+\tif (t->xstats_map)\n+\t\trte_free(t->xstats_map);\n+\n+\tif (t->xstats_values)\n+\t\trte_free(t->xstats_values);\n+\n+\treturn ret;\n+}\ndiff --git a/app/test-mldev/test_inference_common.h b/app/test-mldev/test_inference_common.h\nindex 3f2b042360..bb2920cc30 100644\n--- a/app/test-mldev/test_inference_common.h\n+++ b/app/test-mldev/test_inference_common.h\n@@ -32,6 +32,9 @@ struct ml_core_args {\n \tstruct rte_ml_op **enq_ops;\n \tstruct rte_ml_op **deq_ops;\n \tstruct ml_request **reqs;\n+\n+\tuint64_t start_cycles;\n+\tuint64_t end_cycles;\n };\n \n struct test_inference {\n@@ -50,6 +53,10 @@ struct test_inference {\n \tint (*dequeue)(void *arg);\n \n \tstruct ml_core_args args[RTE_MAX_LCORE];\n+\n+\tstruct rte_ml_dev_xstats_map *xstats_map;\n+\tuint64_t *xstats_values;\n+\tint xstats_size;\n } __rte_cache_aligned;\n \n bool test_inference_cap_check(struct ml_options *opt);\n@@ -67,5 +74,6 @@ void ml_inference_mem_destroy(struct ml_test *test, struct ml_options *opt);\n int ml_inference_result(struct ml_test *test, struct ml_options *opt, int16_t fid);\n int ml_inference_launch_cores(struct ml_test *test, struct ml_options *opt, int16_t start_fid,\n \t\t\t      int16_t end_fid);\n+int ml_inference_stats_get(struct ml_test *test, struct ml_options *opt);\n \n #endif /* _ML_TEST_INFERENCE_COMMON_ */\ndiff --git a/app/test-mldev/test_inference_interleave.c b/app/test-mldev/test_inference_interleave.c\nindex 74ad0c597f..d86838c3fa 100644\n--- a/app/test-mldev/test_inference_interleave.c\n+++ b/app/test-mldev/test_inference_interleave.c\n@@ -60,7 +60,11 @@ test_inference_interleave_driver(struct ml_test *test, struct ml_options *opt)\n \t\t\tgoto error;\n \n \t\tml_inference_iomem_destroy(test, opt, fid);\n+\t}\n+\n+\tml_inference_stats_get(test, opt);\n \n+\tfor (fid = 0; fid < opt->nb_filelist; fid++) {\n \t\tret = ml_model_stop(test, opt, &t->model[fid], fid);\n \t\tif (ret != 0)\n \t\t\tgoto error;\ndiff --git a/app/test-mldev/test_inference_ordered.c b/app/test-mldev/test_inference_ordered.c\nindex 84e6bf9109..3826121a65 100644\n--- a/app/test-mldev/test_inference_ordered.c\n+++ b/app/test-mldev/test_inference_ordered.c\n@@ -58,6 +58,7 @@ test_inference_ordered_driver(struct ml_test *test, struct ml_options *opt)\n \t\tgoto error;\n \n \tml_inference_iomem_destroy(test, opt, fid);\n+\tml_inference_stats_get(test, opt);\n \n \t/* stop model */\n \tret = ml_model_stop(test, opt, &t->model[fid], fid);\n",
    "prefixes": [
        "v1",
        "11/12"
    ]
}