From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9093A431DE; Mon, 23 Oct 2023 09:06:31 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7FDF040A79; Mon, 23 Oct 2023 09:06:31 +0200 (CEST) Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) by mails.dpdk.org (Postfix) with ESMTP id AEF5640270 for ; Mon, 23 Oct 2023 09:06:29 +0200 (CEST) Received: by mail-qt1-f180.google.com with SMTP id d75a77b69052e-41cd7a3e8f8so19775671cf.0 for ; Mon, 23 Oct 2023 00:06:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698044789; x=1698649589; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=qnEp7k80NZbrNl9IXpCr82QDwxqON9pabS1hH8+5+yA=; b=VUaNNoX1OvFaYOX7rw+1mw9fzwtoe1GGjomxXBr3Viz88X9SHoaHY+Ww7gKWC/4TXg yiv8fJof+cMQA9iD9ZIAvOM/nMibIHe2EhxSRSuzWMD3dHT8SagDNRrkT+ZH50Ns0xxx QZ02pt8QDcNB4aDIFFANo5L4HR4s+zxc8COxsLHS1w2XcU+wC/u44JsTtx+2+nfCkZhg EIZE69MBkoWYLxIaRyJx/S4QA7BBClHgs4C7L1DuOmPX8D9QG6wyZiNomdSgmaPOmy5k aUePMgzq64nkojzaY/BKqErIgS4pMkuWQvQaRJVeUkImYgyMG2mjuTJeXBamzYkEELq3 OpqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698044789; x=1698649589; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qnEp7k80NZbrNl9IXpCr82QDwxqON9pabS1hH8+5+yA=; b=n94Tbmratq7VQE10c32cuCfg5t2zESdVotn881jwL0b/Fgrd6+FW1tC1cj9YQ4ayYD bULJVIN9i2Zx/avuO0Km+/DjGCKEVkWGI4wDs91pFgrKw9EIGIJQNbyJ4vOhk6hfvc1r NZEP9oVdZ2HtesrDntCUylstWsfTOUoKg6X7vt4BE4p7COz70LKnf30GpKwmuD/4FBT6 zyiBQlkPEEdXkbRnJsKEKIHn6QDygrxHv+/X2z9BOwKaZDcZZpuI7WEu0savn7myHo2W WBuyrBynPxznikgmTIbN5evtc7JMMwmr24D+Ja+DuAYu7Pw99Oa62WFMrfqmWfQF8ZZ1 VZ4Q== X-Gm-Message-State: AOJu0Yz0/xbNhdMPey5oowk9Ms52nTKnEBHlLwgfR4HVxX1Nv3TwGtn7 sJ3whsEo8eRBFRlHQXtaInWL2BC8qKQIm6ahftIw3l3affM= X-Google-Smtp-Source: AGHT+IFjyUR/9FqEDGQCLqQ9BlckjqWaUuLuk2CN7QoBErVojRn3FkYJWCDfJ73I9XZyl8GUIe+DA/sIrRG1NPOsqg4= X-Received: by 2002:ac8:5946:0:b0:41c:e009:6ad7 with SMTP id 6-20020ac85946000000b0041ce0096ad7mr9701114qtz.52.1698044789026; Mon, 23 Oct 2023 00:06:29 -0700 (PDT) MIME-Version: 1.0 References: <20231019105000.520914-13-skori@marvell.com> <20231019173011.1186656-1-skori@marvell.com> <20231019173011.1186656-12-skori@marvell.com> In-Reply-To: <20231019173011.1186656-12-skori@marvell.com> From: Nithin Dabilpuram Date: Mon, 23 Oct 2023 12:36:16 +0530 Message-ID: Subject: Re: [PATCH v11 11/12] app/graph: support CLI option to enable graph stats To: skori@marvell.com Cc: Rakesh Kudurumalla , dev@dpdk.org, Jerin Jacob Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Acked-By: Nithin Dabilpuram On Fri, Oct 20, 2023 at 2:07=E2=80=AFAM wrote: > > From: Sunil Kumar Kori > > Adds application's command line parameter "--enable-graph-stats" > to enable dumping graph stats on console. > > By default, no graph stats will be printed on console but same can > be dumped via telnet session using "graph stats show" command. > > Signed-off-by: Sunil Kumar Kori > Signed-off-by: Rakesh Kudurumalla > Acked-by: Jerin Jacob > --- > app/graph/main.c | 17 ++++++++++++++++- > app/graph/module_api.h | 2 ++ > doc/guides/tools/graph.rst | 4 ++++ > 3 files changed, 22 insertions(+), 1 deletion(-) > > diff --git a/app/graph/main.c b/app/graph/main.c > index c1cb435588..465376425c 100644 > --- a/app/graph/main.c > +++ b/app/graph/main.c > @@ -21,12 +21,13 @@ > volatile bool force_quit; > struct conn *conn; > > -static const char usage[] =3D "%s EAL_ARGS -- -s SCRIPT [-h HOST] [-p PO= RT] " > +static const char usage[] =3D "%s EAL_ARGS -- -s SCRIPT [-h HOST] [-p PO= RT] [--enable-graph-stats] " > "[--help]\n"; > > static struct app_params { > struct conn_params conn; > char *script_name; > + bool enable_graph_stats; > } app =3D { > .conn =3D { > .welcome =3D "\nWelcome!\n\n", > @@ -40,6 +41,7 @@ static struct app_params { > .msg_handle_arg =3D NULL, /* set later. */ > }, > .script_name =3D NULL, > + .enable_graph_stats =3D false, > }; > > static void > @@ -56,6 +58,7 @@ app_args_parse(int argc, char **argv) > { > struct option lgopts[] =3D { > {"help", 0, 0, 'H'}, > + {"enable-graph-stats", 0, 0, 'g'}, > }; > int h_present, p_present, s_present, n_args, i; > char *app_name =3D argv[0]; > @@ -133,6 +136,12 @@ app_args_parse(int argc, char **argv) > } > break; > > + case 'g': > + app.enable_graph_stats =3D true; > + printf("WARNING! Telnet session can not be access= ed with" > + "--enable-graph-stats"); > + break; > + > case 'H': > default: > printf(usage, app_name); > @@ -144,6 +153,12 @@ app_args_parse(int argc, char **argv) > return 0; > } > > +bool > +app_graph_stats_enabled(void) > +{ > + return app.enable_graph_stats; > +} > + > bool > app_graph_exit(void) > { > diff --git a/app/graph/module_api.h b/app/graph/module_api.h > index 392dcfb222..a7d287f5c8 100644 > --- a/app/graph/module_api.h > +++ b/app/graph/module_api.h > @@ -24,5 +24,7 @@ > extern volatile bool force_quit; > extern struct conn *conn; > > +bool app_graph_stats_enabled(void); > bool app_graph_exit(void); > + > #endif > diff --git a/doc/guides/tools/graph.rst b/doc/guides/tools/graph.rst > index 08ec57b7f8..bd8611a3d0 100644 > --- a/doc/guides/tools/graph.rst > +++ b/doc/guides/tools/graph.rst > @@ -55,6 +55,10 @@ Following are the application command-line options: > a mandatory parameter which will be used to create desired graph > for a given use case. > > +* ``--enable-graph-stats`` > + > + Enable graph statistics printing on console. By default graph sta= tistics are disabled. > + > * ``--help`` > > Dumps application usage > -- > 2.25.1 >