From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id 5EFBD2BB9 for ; Thu, 8 Jun 2017 12:08:05 +0200 (CEST) Received: by mail-wm0-f41.google.com with SMTP id x70so74078823wme.0 for ; Thu, 08 Jun 2017 03:08:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dSq0JwvbdwNK0yZh4jnGFA4MzXrYhnyzvtzyQ0Nq104=; b=VZQHyYzTgOSRb8G1xiOfDX1FOb118jKLQnNGEDeK3OEOhoBu4VFdvKBOaFM42N+aNU j0fD9srMGBir9E21b4bjpctlL1tgfqzS/ZajaF+aoDsomyHhxSJPhU52rmJ3UwNtWqzh bR4bAPmdqZsiSXCg48bDY/DD5fN/Hg3D41FxCDsu1+PgDy0RxyhbkqO/rik9Gu69jPsJ avLLR3uLdUVxUm/p1pNn6Ob7oaOvp1KbRCMftC5T6s6ivPLvHR9ccmpY/kafmGXPbxdg 5oYIe7VLuj39d832dQ8Kqv1WQydE+cXt14pA3556vKMz6NZ+Ntl27Gass3o/ZtyLdmUZ 4cEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dSq0JwvbdwNK0yZh4jnGFA4MzXrYhnyzvtzyQ0Nq104=; b=Vv6RF1MW/gmxcWZsIVIZZCIJB5owkfscRC1HAZRpskaO6r53CsdYE89Fopmaj7hGz6 cI/zRWknYyvXGqintBwj6yVKGx7vwiklkp/UOaRHCHZVr7/EcsjtDMSii/qPAMhOPkDJ zSF9L2QS9ZOGQDbvguz9GHEHVfCY7YP0McAT1KRZRlS/5ujkI5LzPjVZ6LmxckGqSCGg gzkBRzemegCoT1fvjTTinsfPSTuPlCSVp/bao+vVnPOC/lm5QWjI9ZxQCbUs/K3xJMj0 +iErb6M3wY8GrBvrso3qJTavwq4Y4WhG5Gk2dCGo64IgTeTDB4kLNkZMMjtxqDYCxc7v pMcw== X-Gm-Message-State: AODbwcBepYHeHS9qlL5xbplheo+JAAHzxC9m82f9QfUvnxQmlU+ujuVw ilPqRw/79k9w0N6C X-Received: by 10.28.2.67 with SMTP id 64mr2702926wmc.101.1496916485023; Thu, 08 Jun 2017 03:08:05 -0700 (PDT) Received: from platinum (2a01cb0c03c651000226b0fffeed02fc.ipv6.abo.wanadoo.fr. [2a01:cb0c:3c6:5100:226:b0ff:feed:2fc]) by smtp.gmail.com with ESMTPSA id q77sm4999788wmd.31.2017.06.08.03.08.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Jun 2017 03:08:04 -0700 (PDT) Date: Thu, 8 Jun 2017 12:08:01 +0200 From: Olivier Matz To: Hemant Agrawal Cc: , , Message-ID: <20170608120801.1102e7bc@platinum> In-Reply-To: <1495532028-9700-2-git-send-email-hemant.agrawal@nxp.com> References: <1495532028-9700-1-git-send-email-hemant.agrawal@nxp.com> <1495532028-9700-2-git-send-email-hemant.agrawal@nxp.com> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-stable] [PATCH 2/2] mempool/dpaa2: improving the alloc/free logging X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jun 2017 10:08:05 -0000 Hi Hemant, On Tue, 23 May 2017 15:03:48 +0530, Hemant Agrawal wrote: > Debug logs are helpful for better debugging. Alloc > was having the logs, but logs were not present in free routines. > > This patch add support for debug mode logs in free routine. > Also, changing the log category to DRV instead of TX. > > Signed-off-by: Hemant Agrawal > --- > drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > > diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c > index 60dd1c0..e00ed5d 100644 > --- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c > +++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c > @@ -309,8 +309,8 @@ > > #ifdef RTE_LIBRTE_DPAA2_DEBUG_DRIVER > alloc += n; > - PMD_TX_LOG(DEBUG, "Total = %d , req = %d done = %d", > - alloc, count, n); > + PMD_DRV_LOG(DEBUG, "Total = %d , req = %d done = %d", > + alloc, count, n); > #endif > return 0; > } Since we are in a mempool driver, we may not want to use PMD_*_LOG() functions. Also, I don't see where these macros are defined for this file, but maybe I miss something that is right under my nose ;) Anyway, I suggest to use your own macros for dpaa mempool instead, and if possible: - avoid compilation options as much as possible - RTE_LOG() for logs that cannot occur in dataplane (they can be enabled dynamically) - RTE_LOG_DP() for dataplane logs: these are stripped at compilation time, unless your log level <= RTE_LOG_DP_LEVEL > @@ -320,6 +320,9 @@ > void * const *obj_table, unsigned int n) > { > struct dpaa2_bp_info *bp_info; > +#ifdef RTE_LIBRTE_DPAA2_DEBUG_DRIVER > + static int freed; > +#endif > > bp_info = mempool_to_bpinfo(pool); > if (!(bp_info->bp_list)) { > @@ -329,6 +332,11 @@ > rte_dpaa2_mbuf_release(pool, obj_table, bp_info->bpid, > bp_info->meta_data_size, n); > > +#ifdef RTE_LIBRTE_DPAA2_DEBUG_DRIVER > + freed += n; > + PMD_DRV_LOG(DEBUG, "Total = %d , done = %d", > + freed, n); > +#endif > return 0; > } >