From: Paolo Abeni <pabeni@redhat.com>
To: Stanislav Fomichev <sdf.kernel@gmail.com>, netdev@vger.kernel.org
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org
Subject: Re: [RFC net-next 1/6] selftests: net: py: add timestamped metric output
Date: Tue, 22 Sep 2026 18:10:59 +0200 [thread overview]
Message-ID: <9ff98cfc-392c-434c-a0c0-04dd4fa643e5@redhat.com> (raw)
In-Reply-To: <20260916190409.1222272-2-sdf@fomichev.me>
On 9/16/26 21:04, Stanislav Fomichev wrote:
> Add ksft_metric() to record timestamped JSON observations for the current
> test case.
>
> Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
> ---
> .../testing/selftests/drivers/net/README.rst | 27 ++++++++++++
> .../drivers/net/hw/lib/py/__init__.py | 8 ++--
> .../selftests/drivers/net/lib/py/__init__.py | 8 ++--
> .../testing/selftests/net/lib/py/__init__.py | 9 ++--
> tools/testing/selftests/net/lib/py/ksft.py | 44 ++++++++++++++++++-
> 5 files changed, 83 insertions(+), 13 deletions(-)
>
> diff --git a/tools/testing/selftests/drivers/net/README.rst b/tools/testing/selftests/drivers/net/README.rst
> index 3fe49bce4f3a..a6a8605844eb 100644
> --- a/tools/testing/selftests/drivers/net/README.rst
> +++ b/tools/testing/selftests/drivers/net/README.rst
> @@ -259,6 +259,33 @@ ksft_pr()
>
> Use ``ksft_pr()`` instead of ``print()`` to avoid breaking TAP format.
>
> +ksft_metric()
> +~~~~~~~~~~~~~
> +
> +Use ``ksft_metric()`` to report a numeric measurement for the current test
> +case. The helper records the time relative to the start of the case and emits
> +each observation immediately before the test result as compact JSON. For
> +example::
> +
> + ksft_metric("throughput", 100.5, shape="scalar", direction="rx")
Minor nits:
- find the 'shape' name confusing/unclear. I would like more 'type' instead.
also it would ne nice to list explicitly somewhere in the doc the suppored
shapes/types. (If such list is already there I could not find it easily).
- do we need a separare 'direction'? or can it be embedded into the name
metric itself? i.e. 'throughput-rx'?
/P
next prev parent reply other threads:[~2026-09-22 16:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 19:04 [RFC net-next 0/6] selftests: net: add performance metric reporting Stanislav Fomichev
2026-09-16 19:04 ` [RFC net-next 1/6] selftests: net: py: add timestamped metric output Stanislav Fomichev
2026-09-22 16:10 ` Paolo Abeni [this message]
2026-09-16 19:04 ` [RFC net-next 2/6] selftests: net: py: add metric policy output Stanislav Fomichev
2026-09-22 16:16 ` Paolo Abeni
2026-09-16 19:04 ` [RFC net-next 3/6] selftests: drv-net: add a system performance monitor Stanislav Fomichev
2026-09-16 19:04 ` [RFC net-next 4/6] selftests: drv-net: add an iperf performance test Stanislav Fomichev
2026-09-16 19:04 ` [RFC net-next 5/6] selftests: drv-net: add a kperf runner Stanislav Fomichev
2026-09-16 19:04 ` [RFC net-next 6/6] selftests: drv-net: measure devmem performance with kperf Stanislav Fomichev
2026-09-17 20:01 ` [RFC net-next 0/6] selftests: net: add performance metric reporting Jakub Kicinski
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=9ff98cfc-392c-434c-a0c0-04dd4fa643e5@redhat.com \
--to=pabeni@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sdf.kernel@gmail.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