From: Stephen Hemminger <stephen@networkplumber.org>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: dev@dpdk.org, shperetz@nvidia.com, viacheslavo@nvidia.com,
bruce.richardson@intel.com, mb@smartsharesystems.com
Subject: Re: [PATCH v7 0/7] add mbuf debug capabilities
Date: Fri, 24 Oct 2025 15:25:46 -0700 [thread overview]
Message-ID: <20251024152546.5a568d6a@phoenix> (raw)
In-Reply-To: <20251016203557.2554678-1-thomas@monjalon.net>
On Thu, 16 Oct 2025 22:34:38 +0200
Thomas Monjalon <thomas@monjalon.net> wrote:
> History is added to mbuf for debugging.
>
> This series set some marks in mbuf allocation/freeing and ethdev Rx/Tx.
> More marks could be added in other libraries.
> Drivers could benefit a finer debugging by marking alloc/free calls,
> in addition to marks already done in the mbuf library.
> Even better, the application could add its own marks.
>
> As part of this series, mbuf statistics can be dumped,
> and a Python script will help to parse mbuf history.
>
> ---
>
> v7 changes:
> - loop for sum of allocated mbufs
> - remove unused Python import
>
> v6 changes:
> - simplify testpmd commands
> - use enum op type
> - rename Tx ops
> - mark free before freeing
> - mark out of sanity check loop
>
> v5 change:
> - fix MSVC build in testpmd
>
> v4 changes:
> - fix/rewrite testpmd commands
> - fix python script
> - fix thread safety
> - fix checks
> - fix logs
> - change config (no Meson option)
> - add documentation
>
> v3 changes:
> - use atomic
> - fix prefix
> - add asserts
> - reformat dump
> - remove #ifdef clutter
> - remove mlx5 patch
>
> v2 changes:
> - move to mbuf in dynamic field
>
> v1:
> - mempool feature
>
> ---
>
> Shani Peretz (3):
> mbuf: record mbuf operations history
> ethdev: mark mbufs in burst functions
> usertools/mbuf: parse mbuf history dump
>
> Thomas Monjalon (4):
> doc: explain debug options in mbuf guide
> mbuf: move header include for logs
> app/testpmd: use space separator in dump commands
> app/testpmd: add commands to dump mbuf history
>
> app/test-pmd/cmdline.c | 309 ++++++++++++++------
> config/rte_config.h | 1 +
> doc/guides/howto/debug_troubleshoot.rst | 7 +
> doc/guides/prog_guide/mbuf_lib.rst | 18 +-
> doc/guides/rel_notes/release_25_11.rst | 7 +
> doc/guides/testpmd_app_ug/testpmd_funcs.rst | 33 ++-
> lib/ethdev/rte_ethdev.h | 11 +
> lib/mbuf/mbuf_history.c | 223 ++++++++++++++
> lib/mbuf/mbuf_log.h | 2 +
> lib/mbuf/meson.build | 2 +
> lib/mbuf/rte_mbuf.c | 5 +-
> lib/mbuf/rte_mbuf.h | 15 +-
> lib/mbuf/rte_mbuf_dyn.h | 18 ++
> lib/mbuf/rte_mbuf_history.h | 207 +++++++++++++
> usertools/dpdk-mbuf-history-parser.py | 165 +++++++++++
> 15 files changed, 917 insertions(+), 106 deletions(-)
> create mode 100644 lib/mbuf/mbuf_history.c
> create mode 100644 lib/mbuf/rte_mbuf_history.h
> create mode 100755 usertools/dpdk-mbuf-history-parser.py
>
If build is done with lots of debug enabled it now fails.
Looks like typo in history code.
FAILED: lib/librte_mbuf.a.p/mbuf_mbuf_history.c.o
cc -Ilib/librte_mbuf.a.p -Ilib -I../lib -Ilib/mbuf -I../lib/mbuf -Ilib/eal/common -I../lib/eal/common -I. -I.. -Iconfig -I../config -Ilib/eal/include -I../lib/eal/include -Ilib/eal/linux/include -I../lib/eal/linux/include -Ilib/eal/x86/include -I../lib/eal/x86/include -I../kernel/linux -Ilib/eal -I../lib/eal -Ilib/kvargs -I../lib/kvargs -Ilib/log -I../lib/log -Ilib/metrics -I../lib/metrics -Ilib/telemetry -I../lib/telemetry -Ilib/argparse -I../lib/argparse -Ilib/mempool -I../lib/mempool -Ilib/ring -I../lib/ring -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c11 -O3 -include rte_config.h -Wvla -Wcast-qual -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-packed-not-aligned -Wno-missing-field-initializers -fzero-init-padding-bits=all -D_GNU_SOURCE -DRTE_ENABLE_ASSERT -DRTE_LIBRTE_ETHDEV_DEBUG=1 -DRTE_LIBRTE_IPFRAG_TBL_STAT -DRTE_LIBRTE_MEMPOOL_STATS -DRTE_LIBRTE_MEMPOOL_DEBUG -DRTE_MBUF_HISTORY_DEBUG -fPIC -march=native -mrtm -DALLOW_EXPERIMENTAL_API -DALLOW_INTERNAL_API -Wno-format-truncation -DRTE_LOG_DEFAULT_LOGTYPE=lib.mbuf -MD -MQ lib/librte_mbuf.a.p/mbuf_mbuf_history.c.o -MF lib/librte_mbuf.a.p/mbuf_mbuf_history.c.o.d -o lib/librte_mbuf.a.p/mbuf_mbuf_history.c.o -c ../lib/mbuf/mbuf_history.c
In file included from ../lib/eal/x86/include/rte_vect.h:14,
from ../lib/eal/x86/include/rte_memcpy.h:17,
from ../lib/mempool/rte_mempool.h:50,
from ../lib/mbuf/mbuf_history.c:8:
../lib/mbuf/mbuf_history.c: In function ‘rte_mbuf_history_init’:
../lib/log/rte_log.h:364:9: error: static assertion failed: "This log format string contains a \\n"
364 | static_assert(!__builtin_strchr(fmt, '\n'), \
| ^~~~~~~~~~~~~
../lib/log/rte_log.h:387:9: note: in expansion of macro ‘RTE_LOG_CHECK_NO_NEWLINE’
387 | RTE_LOG_CHECK_NO_NEWLINE(RTE_FMT_HEAD(__VA_ARGS__ ,)); \
| ^~~~~~~~~~~~~~~~~~~~~~~~
../lib/mbuf/mbuf_log.h:8:9: note: in expansion of macro ‘RTE_LOG_LINE’
8 | RTE_LOG_LINE(level, MBUF, "" __VA_ARGS__)
| ^~~~~~~~~~~~
../lib/mbuf/mbuf_history.c:219:17: note: in expansion of macro ‘MBUF_LOG’
219 | MBUF_LOG(ERR, "Failed to register mbuf history dynamic field: %s\n",
| ^~~~~~~~
prev parent reply other threads:[~2025-10-24 22:25 UTC|newest]
Thread overview: 106+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-16 7:29 [RFC PATCH 0/5] Introduce mempool object new " Shani Peretz
2025-06-16 7:29 ` [RFC PATCH 1/5] mempool: record mempool objects operations history Shani Peretz
2025-06-16 7:29 ` [RFC PATCH 2/5] drivers: add mempool history compilation flag Shani Peretz
2025-06-16 7:29 ` [RFC PATCH 3/5] net/mlx5: mark an operation in mempool object's history Shani Peretz
2025-06-16 7:29 ` [RFC PATCH 4/5] app/testpmd: add testpmd command to dump mempool history Shani Peretz
2025-06-16 7:29 ` [RFC PATCH 5/5] usertool: add a script to parse mempool history dump Shani Peretz
2025-06-16 15:30 ` [RFC PATCH 0/5] Introduce mempool object new debug capabilities Stephen Hemminger
2025-06-19 12:57 ` Morten Brørup
2025-07-07 5:46 ` Shani Peretz
2025-07-07 5:45 ` Shani Peretz
2025-07-07 12:10 ` Morten Brørup
2025-07-19 14:39 ` Morten Brørup
2025-08-25 11:27 ` Slava Ovsiienko
2025-09-01 15:34 ` Morten Brørup
2025-09-16 15:12 ` [PATCH v2 0/4] add mbuf " Shani Peretz
2025-09-16 15:12 ` [PATCH v2 1/4] mbuf: record mbuf operations history Shani Peretz
2025-09-16 21:17 ` Stephen Hemminger
2025-09-16 21:33 ` Thomas Monjalon
2025-09-17 1:22 ` Morten Brørup
2025-09-17 14:46 ` Morten Brørup
2025-09-19 9:14 ` Shani Peretz
2025-09-16 15:12 ` [PATCH v2 2/4] net/mlx5: mark an operation in mbuf's history Shani Peretz
2025-09-16 21:14 ` Stephen Hemminger
2025-09-16 21:31 ` Thomas Monjalon
2025-09-17 15:04 ` Stephen Hemminger
2025-09-16 15:12 ` [PATCH v2 3/4] app/testpmd: add testpmd command to dump mbuf history Shani Peretz
2025-09-16 15:12 ` [PATCH v2 4/4] usertool: add a script to parse mbuf history dump Shani Peretz
2025-09-30 23:25 ` [PATCH v3 0/5] add mbuf debug capabilities Thomas Monjalon
2025-09-30 23:25 ` [PATCH v3 1/5] mbuf: move header include for logs Thomas Monjalon
2025-09-30 23:25 ` [PATCH v3 2/5] mbuf: record mbuf operations history Thomas Monjalon
2025-10-01 0:12 ` Thomas Monjalon
2025-10-02 7:37 ` Morten Brørup
2025-10-02 21:23 ` Thomas Monjalon
2025-10-13 18:39 ` Thomas Monjalon
2025-10-13 20:08 ` Morten Brørup
2025-10-13 21:07 ` Thomas Monjalon
2025-10-14 10:04 ` Morten Brørup
2025-09-30 23:25 ` [PATCH v3 3/5] ethdev: mark mbufs in burst functions Thomas Monjalon
2025-10-02 7:44 ` Morten Brørup
2025-10-13 15:32 ` Thomas Monjalon
2025-09-30 23:25 ` [PATCH v3 4/5] app/testpmd: add commands to dump mbuf history Thomas Monjalon
2025-10-01 8:20 ` Stephen Hemminger
2025-10-13 15:31 ` Thomas Monjalon
2025-09-30 23:25 ` [PATCH v3 5/5] usertools/mbuf: parse mbuf history dump Thomas Monjalon
2025-10-02 8:07 ` Robin Jarry
2025-10-13 21:16 ` [PATCH v4 0/7] add mbuf debug capabilities Thomas Monjalon
2025-10-13 21:16 ` [PATCH v4 1/7] doc: explain debug options in mbuf guide Thomas Monjalon
2025-10-13 21:16 ` [PATCH v4 2/7] mbuf: move header include for logs Thomas Monjalon
2025-10-13 21:16 ` [PATCH v4 3/7] mbuf: record mbuf operations history Thomas Monjalon
2025-10-13 21:16 ` [PATCH v4 4/7] ethdev: mark mbufs in burst functions Thomas Monjalon
2025-10-13 21:16 ` [PATCH v4 5/7] app/testpmd: use space separator in dump commands Thomas Monjalon
2025-10-13 21:16 ` [PATCH v4 6/7] app/testpmd: add commands to dump mbuf history Thomas Monjalon
2025-10-13 21:16 ` [PATCH v4 7/7] usertools/mbuf: parse mbuf history dump Thomas Monjalon
2025-10-14 6:58 ` [PATCH v5 0/7] add mbuf debug capabilities Thomas Monjalon
2025-10-14 6:58 ` [PATCH v5 1/7] doc: explain debug options in mbuf guide Thomas Monjalon
2025-10-14 6:58 ` [PATCH v5 2/7] mbuf: move header include for logs Thomas Monjalon
2025-10-14 8:47 ` Morten Brørup
2025-10-14 6:58 ` [PATCH v5 3/7] mbuf: record mbuf operations history Thomas Monjalon
2025-10-14 9:59 ` Morten Brørup
2025-10-14 12:03 ` Thomas Monjalon
2025-10-14 12:31 ` Thomas Monjalon
2025-10-14 6:58 ` [PATCH v5 4/7] ethdev: mark mbufs in burst functions Thomas Monjalon
2025-10-14 6:58 ` [PATCH v5 5/7] app/testpmd: use space separator in dump commands Thomas Monjalon
2025-10-14 6:58 ` [PATCH v5 6/7] app/testpmd: add commands to dump mbuf history Thomas Monjalon
2025-10-14 8:45 ` Morten Brørup
2025-10-14 9:43 ` Thomas Monjalon
2025-10-14 9:48 ` Bruce Richardson
2025-10-14 9:55 ` Thomas Monjalon
2025-10-14 6:58 ` [PATCH v5 7/7] usertools/mbuf: parse mbuf history dump Thomas Monjalon
2025-10-14 12:33 ` [PATCH v6 0/7] add mbuf debug capabilities Thomas Monjalon
2025-10-14 12:33 ` [PATCH v6 1/7] doc: explain debug options in mbuf guide Thomas Monjalon
2025-10-14 12:33 ` [PATCH v6 2/7] mbuf: move header include for logs Thomas Monjalon
2025-10-14 12:33 ` [PATCH v6 3/7] mbuf: record mbuf operations history Thomas Monjalon
2025-10-16 9:04 ` Morten Brørup
2025-10-16 9:53 ` Thomas Monjalon
2025-10-14 12:33 ` [PATCH v6 4/7] ethdev: mark mbufs in burst functions Thomas Monjalon
2025-10-16 9:26 ` Morten Brørup
2025-10-14 12:33 ` [PATCH v6 5/7] app/testpmd: use space separator in dump commands Thomas Monjalon
2025-10-15 17:52 ` Stephen Hemminger
2025-10-15 19:10 ` Thomas Monjalon
2025-10-16 9:28 ` Morten Brørup
2025-10-14 12:33 ` [PATCH v6 6/7] app/testpmd: add commands to dump mbuf history Thomas Monjalon
2025-10-14 12:33 ` [PATCH v6 7/7] usertools/mbuf: parse mbuf history dump Thomas Monjalon
2025-10-14 14:03 ` Robin Jarry
2025-10-15 17:50 ` Stephen Hemminger
2025-10-15 19:11 ` Thomas Monjalon
2025-10-15 19:41 ` Robin Jarry
2025-10-16 8:10 ` Bruce Richardson
2025-10-16 8:42 ` Thomas Monjalon
2025-10-16 12:07 ` Robin Jarry
2025-10-16 9:46 ` Morten Brørup
2025-10-16 20:34 ` [PATCH v7 0/7] add mbuf debug capabilities Thomas Monjalon
2025-10-16 20:34 ` [PATCH v7 1/7] doc: explain debug options in mbuf guide Thomas Monjalon
2025-10-16 22:30 ` Morten Brørup
2025-10-16 20:34 ` [PATCH v7 2/7] mbuf: move header include for logs Thomas Monjalon
2025-10-16 20:34 ` [PATCH v7 3/7] mbuf: record mbuf operations history Thomas Monjalon
2025-10-16 22:29 ` Morten Brørup
2025-10-17 7:32 ` Thomas Monjalon
2025-10-17 7:55 ` Morten Brørup
2025-10-17 9:09 ` Thomas Monjalon
2025-10-16 20:34 ` [PATCH v7 4/7] ethdev: mark mbufs in burst functions Thomas Monjalon
2025-10-16 20:34 ` [PATCH v7 5/7] app/testpmd: use space separator in dump commands Thomas Monjalon
2025-10-16 20:34 ` [PATCH v7 6/7] app/testpmd: add commands to dump mbuf history Thomas Monjalon
2025-10-16 20:34 ` [PATCH v7 7/7] usertools/mbuf: parse mbuf history dump Thomas Monjalon
2025-10-17 16:10 ` [PATCH v7 0/7] add mbuf debug capabilities Thomas Monjalon
2025-10-24 22:25 ` Stephen Hemminger [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=20251024152546.5a568d6a@phoenix \
--to=stephen@networkplumber.org \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=mb@smartsharesystems.com \
--cc=shperetz@nvidia.com \
--cc=thomas@monjalon.net \
--cc=viacheslavo@nvidia.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).