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 09C23A04A2; Fri, 22 May 2020 18:35:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C1D1F1D9CE; Fri, 22 May 2020 18:35:03 +0200 (CEST) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by dpdk.org (Postfix) with ESMTP id DC6AD1D9CA for ; Fri, 22 May 2020 18:35:01 +0200 (CEST) Received: by mail-io1-f67.google.com with SMTP id o5so11964144iow.8 for ; Fri, 22 May 2020 09:35:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=70aOSpuxV9c7LMZ0g0qtMUu+NbJB/cEeT4Xv5AhgQTE=; b=JEf1cqFD2BmQHOzdEWcXcbOBymJnvHLhz+ip++xYCrEb5DZ8+7PouduwBd1QlVDGdz z/Aww5Ss3IoZMlr1TKCBblzg2+X9E7Yt8FyfBGdYdrZKMmXDNJO7cPSY1ZosNkXqTMCm 2TYPNPJRAspecxPOBH5GANIvULBYDYW9akfq7FbDrFEME7lLXyMw5NG1zuQ1aG3+9pHn rebAKY1zADrrCqa2xP1zCRxCxusH2AFjz1X2xhCFLlTebd7M8C47mF5UH1zfjcE1taKy x8TyeB0a0KLQs7R0XNtXyo+8isrzvTd/0Ts+ZxWuYYIEoPLGYOtVIyKpYYp3JOuSmcuV orOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=70aOSpuxV9c7LMZ0g0qtMUu+NbJB/cEeT4Xv5AhgQTE=; b=lRNcbdKMK1GFUkoarfGb3Tod1nyPBx6EJGAznvwMjWzbRL2okYyqu4UNK/9SuAEYHM 6pt3FxvvD3Zlvrq6nA5WzmUNIOft6IkOeHBwzB4XMBxZhoRuw9Nq5wwTmHmQdRnrA/qG s5RMCwkNLzy0uQuq2i+ILBy49AmGr8eYJxPnjZGP8AlJoH4BPEi8kT324gZSIKzOj8CI T8mucCxDP/fedIdLjmH4pCUZM74Dh4+TBw4Gd4JbieJpsPak85BI3Xytmm/sO0hEnO6D n2VRBE2D8oB0VqBWuJDPhRgOIcyNtnwE/4QrmCrLcD0VqeVjdgL/9K/+858FTW9d4iVB gOFw== X-Gm-Message-State: AOAM531Z8/RYski+y72XIwhq9J9HMmyoEW0k5cjdKDU+Pr6Il1qQH+uU DkScVjYfGcryZd9hO+Ic9I1mouBGCbFFMC6Q7vE= X-Google-Smtp-Source: ABdhPJxQYgvwIVxCzKVCFRQWnpgpgiVofpC8p5DuEqpVyIA5R1KC9B19yoT6R0KQUZQQa/+4jNOxkERPysXZXQuoup8= X-Received: by 2002:a02:a598:: with SMTP id b24mr9191961jam.104.1590165301001; Fri, 22 May 2020 09:35:01 -0700 (PDT) MIME-Version: 1.0 References: <20200522134839.15911-1-ciara.power@intel.com> In-Reply-To: <20200522134839.15911-1-ciara.power@intel.com> From: Jerin Jacob Date: Fri, 22 May 2020 22:04:44 +0530 Message-ID: To: Ciara Power Cc: "Laatz, Kevin" , dpdk-dev , Jerin Jacob , David Marchand , Thomas Monjalon , "Richardson, Bruce" , "Wiles, Keith" Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] telemetry: fix error and warning printfs 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" On Fri, May 22, 2020 at 7:21 PM Ciara Power wrote: > > Initially, printf was used to indicate and error/warning resulting from > telemetry initialisation. This is now fixed to use EAL logs for > warnings, and the unnecessary printf for an error is removed. > > Fixes: eeb486f3ba65 ("eal: add telemetry as dependency") > Fixes: dd6275a424ac ("telemetry: fix error log output") > Cc: david.marchand@redhat.com > > Signed-off-by: Ciara Power > --- > lib/librte_eal/freebsd/eal.c | 4 +++- > lib/librte_eal/linux/eal.c | 4 +++- > lib/librte_telemetry/rte_telemetry.h | 9 +++++++++ > lib/librte_telemetry/telemetry.c | 2 -- > 4 files changed, 15 insertions(+), 4 deletions(-) > > diff --git a/lib/librte_eal/freebsd/eal.c b/lib/librte_eal/freebsd/eal.c > index 14b52168e..07456059e 100644 > --- a/lib/librte_eal/freebsd/eal.c > +++ b/lib/librte_eal/freebsd/eal.c > @@ -956,13 +956,15 @@ rte_eal_init(int argc, char **argv) > return -1; > } > if (!internal_config.no_telemetry) { > - const char *error_str; > + const char *error_str = NULL; > if (rte_telemetry_init(rte_eal_get_runtime_dir(), > &internal_config.ctrl_cpuset, &error_str) > != 0) { > rte_eal_init_alert(error_str); > return -1; > } > + if (error_str != NULL) > + RTE_LOG(WARNING, EAL, "%s\n", error_str); > } > > eal_mcfg_complete(); > diff --git a/lib/librte_eal/linux/eal.c b/lib/librte_eal/linux/eal.c > index 9620d2544..10317a660 100644 > --- a/lib/librte_eal/linux/eal.c > +++ b/lib/librte_eal/linux/eal.c > @@ -1294,13 +1294,15 @@ rte_eal_init(int argc, char **argv) > return -1; > } > if (!internal_config.no_telemetry) { > - const char *error_str; > + const char *error_str = NULL; > if (rte_telemetry_init(rte_eal_get_runtime_dir(), > &internal_config.ctrl_cpuset, &error_str) > != 0) { > rte_eal_init_alert(error_str); > return -1; > } > + if (error_str != NULL) > + RTE_LOG(WARNING, EAL, "%s\n", error_str); "EAL: No legacy callbacks, legacy socket not created" comes all the times now. Should we treat this as a warning? as it comes for with for the built-in applications? If it is important why not have a default handler in the EAL library? > } > > eal_mcfg_complete(); > diff --git a/lib/librte_telemetry/rte_telemetry.h b/lib/librte_telemetry/rte_telemetry.h > index 2c3c96cf7..eb7f2c917 100644 > --- a/lib/librte_telemetry/rte_telemetry.h > +++ b/lib/librte_telemetry/rte_telemetry.h > @@ -241,8 +241,17 @@ int > rte_telemetry_register_cmd(const char *cmd, telemetry_cb fn, const char *help); > > /** > + * @internal > * Initialize Telemetry. > * > + * @param runtime_dir > + * The runtime directory of DPDK. > + * @param cpuset > + * The CPU set to be used for setting the thread affinity. > + * @param err_str > + * This err_str pointer should point to NULL on entry. In the case of an error > + * or warning, it will be non-NULL on exit. > + * > * @return > * 0 on success. > * @return > diff --git a/lib/librte_telemetry/telemetry.c b/lib/librte_telemetry/telemetry.c > index 7b6f8a79e..e7e3d861d 100644 > --- a/lib/librte_telemetry/telemetry.c > +++ b/lib/librte_telemetry/telemetry.c > @@ -403,12 +403,10 @@ rte_telemetry_init(const char *runtime_dir, rte_cpuset_t *cpuset, > { > if (telemetry_v2_init(runtime_dir, cpuset) != 0) { > *err_str = telemetry_log_error; > - printf("Error initialising telemetry - %s\n", *err_str); > return -1; > } > if (telemetry_legacy_init(runtime_dir, cpuset) != 0) { > *err_str = telemetry_log_error; > - printf("No telemetry legacy support - %s\n", *err_str); > } > return 0; > } > -- > 2.17.1 >