DPDK patches and discussions
 help / color / mirror / Atom feed
From: Konstantin Ananyev <konstantin.ananyev@huawei.com>
To: Fengchengwen <fengchengwen@huawei.com>,
	"thomas@monjalon.net" <thomas@monjalon.net>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [PATCH] mempool: hide zero value items when dump cache
Date: Fri, 5 Sep 2025 08:08:52 +0000	[thread overview]
Message-ID: <c9e3b3f240f147288b474583902bd553@huawei.com> (raw)
In-Reply-To: <20250904120942.51729-1-fengchengwen@huawei.com>

> Hide zero value items when dump mempool cache.
> 
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> ---
>  lib/mempool/rte_mempool.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
> index 1021ede0c2..3042d94c14 100644
> --- a/lib/mempool/rte_mempool.c
> +++ b/lib/mempool/rte_mempool.c
> @@ -1057,7 +1057,7 @@ rte_mempool_dump_cache(FILE *f, const struct
> rte_mempool *mp)
>  	unsigned count = 0;
>  	unsigned cache_count;
> 
> -	fprintf(f, "  internal cache infos:\n");
> +	fprintf(f, "  internal cache infos (hide zero value items):\n");
>  	fprintf(f, "    cache_size=%"PRIu32"\n", mp->cache_size);
> 
>  	if (mp->cache_size == 0)
> @@ -1065,6 +1065,8 @@ rte_mempool_dump_cache(FILE *f, const struct
> rte_mempool *mp)
> 
>  	for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
>  		cache_count = mp->local_cache[lcore_id].len;
> +		if (cache_count == 0)
> +			continue;
>  		fprintf(f, "    cache_count[%u]=%"PRIu32"\n",
>  			lcore_id, cache_count);
>  		count += cache_count;
> --

Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>

> 2.17.1


      parent reply	other threads:[~2025-09-05  8:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-04 12:09 Chengwen Feng
2025-09-04 12:15 ` Morten Brørup
2025-09-05  8:08 ` Konstantin Ananyev [this message]

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=c9e3b3f240f147288b474583902bd553@huawei.com \
    --to=konstantin.ananyev@huawei.com \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=thomas@monjalon.net \
    /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).