DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Van Haaren, Harry" <harry.van.haaren@intel.com>
To: "Korynkevych, RomanX" <romanx.korynkevych@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "Korynkevych, RomanX" <romanx.korynkevych@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2] proc-info: added collectd-format and host-id	options.
Date: Mon, 27 Feb 2017 15:18:08 +0000	[thread overview]
Message-ID: <E923DB57A917B54B9182A2E928D00FA6129F5FD0@IRSMSX102.ger.corp.intel.com> (raw)
In-Reply-To: <1488204982-32291-1-git-send-email-romanx.korynkevych@intel.com>

Apologies, I reviewed patch v2, but replied to v1 on the mailing list.


For reference, the original reply on v1:
http://dpdk.org/ml/archives/dev/2017-February/058518.html


The same feedback provided here:


> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Roman Korynkevych
> Sent: Monday, February 27, 2017 2:16 PM
> To: dev@dpdk.org
> Cc: Korynkevych, RomanX <romanx.korynkevych@intel.com>
> Subject: [dpdk-dev] [PATCH v2] proc-info: added collectd-format and host-id options.
> 
> Extended proc-info application to send DPDK port statistics to
> STDOUT in the format expected by collectd exec plugin. Added
> HOST ID option to identify the host DPDK process is running on
> when multiple instance of DPDK are running in parallel. This is
> needed for the barometer project in OPNFV.
> 
> Signed-off-by: Roman Korynkevych <romanx.korynkevych@intel.com>


One comment on using hostname retrieval below, but with that fixed in a v3;

Reviewed-by: Harry van Haaren <harry.van.haaren at intel.com>


> ---
>  app/proc_info/main.c | 126 +++++++++++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 121 insertions(+), 5 deletions(-)
> 
> diff --git a/app/proc_info/main.c b/app/proc_info/main.c

<snip>

> 
> +static int
> +proc_info_preparse_args(int argc, char **argv)
> +{
> +	char *prgname = argv[0];
> +	int i;
> +
> +	for (i = 0; i < argc; i++) {
> +		/* Print stats or xstats to STDOUT in collectd format */
> +		if (!strncmp(argv[i], "--collectd-format", MAX_LONG_OPT_SZ)) {
> +			enable_collectd_format = 1;
> +			stdout_fd = dup(STDOUT_FILENO);
> +			close(STDOUT_FILENO);
> +		}
> +		if (!strncmp(argv[i], "--host-id", MAX_LONG_OPT_SZ)) {
> +			if ((i + 1) == argc) {
> +				printf("Invalid host id or not specified\n");
> +				proc_info_usage(prgname);
> +				return -1;
> +			}
> +			strncpy(host_id, argv[i+1], sizeof(host_id));
> +		}
> +	}
> +
> +	if (!strlen(host_id))
> +		strcpy(host_id, "unknown");
> +
> +	return 0;
> +}
> +


We should get the machine hostname as a default, IMO better than "unknown". We can fallback to that if the hostname isn't set at all:

if (!strlen(host_id))
     int err = gethostname(host_id, MAX_LONG_OPT_SZ-1);
     if(err)
          strcpy(host_id, "unknown");

  reply	other threads:[~2017-02-27 15:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-24 16:52 [dpdk-dev] [PATCH] " Roman Korynkevych
2017-02-27 14:16 ` [dpdk-dev] [PATCH v2] " Roman Korynkevych
2017-02-27 15:18   ` Van Haaren, Harry [this message]
2017-03-01 16:27   ` [dpdk-dev] [PATCH v3] " Roman Korynkevych
2017-03-03 13:31     ` Tahhan, Maryam
2017-03-03 14:23       ` Van Haaren, Harry
2017-03-10 14:32         ` Thomas Monjalon
2017-02-27 15:12 ` [dpdk-dev] [PATCH] " Van Haaren, Harry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E923DB57A917B54B9182A2E928D00FA6129F5FD0@IRSMSX102.ger.corp.intel.com \
    --to=harry.van.haaren@intel.com \
    --cc=dev@dpdk.org \
    --cc=romanx.korynkevych@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).