|SUCCESS| [RFC] dts: add code coverage parameter to DTS

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Fri May 1 03:15:10 CEST 2026


Test-Label: ai-code-review
Test-Status: SUCCESS
https://dpdk.org/patch/163508

_AI Code Review_

=== Patch Review: series.patch (via Claude) ===
Review date: 2026-05-01

Subject: [RFC] dts: add code coverage parameter to DTS

commit sha: 20260430192911.297180-1-knimoji at iol.unh.edu
Author: Koushik Bhargav Nimoji <knimoji at iol.unh.edu>

This patch introduces a command line argument to enable code coverage
during DPDK builds in DTS, allowing users to generate coverage reports
of code executed during test runs.

> diff --git a/.mailmap b/.mailmap
> index 0e0d83e1c6..3b0ffb689c 100644
> --- a/.mailmap
> +++ b/.mailmap
> @@ -868,6 +868,7 @@ Klaus Degner <kd at allegro-packets.com>
>  Kommula Shiva Shankar <kshankar at marvell.com>
>  Konstantin Ananyev <konstantin.ananyev at huawei.com> <konstantin.v.ananyev at yandex.ru>
>  Konstantin Ananyev <konstantin.ananyev at huawei.com> <konstantin.ananyev at intel.com>
> +Koushik Bhargav Nimoji <knimoji at iol.unh.edu>
>  Krishna Murthy <krishna.j.murthy at intel.com>
>  Krzysztof Galazka <krzysztof.galazka at intel.com>
>  Krzysztof Kanas <kkanas at marvell.com> <krzysztof.kanas at caviumnetworks.com>

[ ... ]

> diff --git a/dts/framework/remote_session/dpdk.py b/dts/framework/remote_session/dpdk.py
> index c3575cfcaf..d5813eec00 100644
> --- a/dts/framework/remote_session/dpdk.py
> +++ b/dts/framework/remote_session/dpdk.py
> @@ -29,6 +29,7 @@
>  from framework.logger import DTSLogger, get_dts_logger
>  from framework.params.eal import EalParams
>  from framework.remote_session.remote_session import CommandResult
> +from framework.settings import SETTINGS
>  from framework.testbed_model.cpu import LogicalCore, LogicalCoreCount, LogicalCoreList, lcore_filter
>  from framework.testbed_model.node import Node
>  from framework.testbed_model.os_session import OSSession
> @@ -272,6 +273,9 @@ def _build_dpdk(self) -> None:
>          else:
>              meson_args = MesonArgs(default_library="static", libdir="lib")
>  
> +        if SETTINGS.code_coverage:
> +            meson_args._add_arg("-Db_coverage=true")

Does this code follow the Python convention that names beginning with an
underscore indicate internal implementation details? The _add_arg()
method is being called on a public interface. Should this be a public
method instead?

> diff --git a/dts/framework/settings.py b/dts/framework/settings.py
> index b08373b7ea..7df535bd84 100644
> --- a/dts/framework/settings.py
> +++ b/dts/framework/settings.py
> @@ -159,6 +159,8 @@ class Settings:
>      re_run: int = 0
>      #:
>      random_seed: int | None = None
> +    #:
> +    code_coverage: bool = False

[ ... ]

> diff --git a/dts/framework/utils.py b/dts/framework/utils.py
> index 9917ffbfaa..38da88cd9c 100644
> --- a/dts/framework/utils.py
> +++ b/dts/framework/utils.py
> @@ -125,6 +125,14 @@ def __str__(self) -> str:
>          """The actual args."""
>          return " ".join(f"{self._default_library} {self._dpdk_args}".split())
>  
> +    def _add_arg(self, arg: str):
> +        """Used to add a meson build argument to the DPDK build.
> +
> +        Args:
> +            arg: The meson build argument to be added.
> +        """
> +        self._dpdk_args = self._dpdk_args + " " + arg

Does this method have proper input validation? What happens if arg is
None or contains malicious shell characters? Should this validate or
sanitize the input string before concatenation?

Also, does this method need to handle empty strings or multiple
consecutive spaces in self._dpdk_args that could result from repeated
calls?


More information about the test-report mailing list