Skip to content

Commit 8010858

Browse files
fengchengwentmonjalo
authored andcommitted
mempool: hide zero-value items in cache dump
Hide zero value items when dump mempool cache. Signed-off-by: Chengwen Feng <[email protected]> Acked-by: Morten Brørup <[email protected]> Acked-by: Konstantin Ananyev <[email protected]>
1 parent 71870b4 commit 8010858

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/mempool/rte_mempool.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1057,14 +1057,16 @@ rte_mempool_dump_cache(FILE *f, const struct rte_mempool *mp)
10571057
unsigned count = 0;
10581058
unsigned cache_count;
10591059

1060-
fprintf(f, " internal cache infos:\n");
1060+
fprintf(f, " internal cache infos (hide zero value items):\n");
10611061
fprintf(f, " cache_size=%"PRIu32"\n", mp->cache_size);
10621062

10631063
if (mp->cache_size == 0)
10641064
return count;
10651065

10661066
for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
10671067
cache_count = mp->local_cache[lcore_id].len;
1068+
if (cache_count == 0)
1069+
continue;
10681070
fprintf(f, " cache_count[%u]=%"PRIu32"\n",
10691071
lcore_id, cache_count);
10701072
count += cache_count;

0 commit comments

Comments
 (0)