[PATCH v2 2/9] trace: fix mode change

Jerin Jacob jerinjacobk at gmail.com
Tue Oct 11 16:20:19 CEST 2022


On Tue, Oct 4, 2022 at 3:15 PM David Marchand <david.marchand at redhat.com> wrote:
>
> The API does not state that changing mode should be refused if no trace
> point is enabled. Remove this limitation.
>
> Fixes: 84c4fae4628f ("trace: implement operation APIs")
> Cc: stable at dpdk.org
>
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> ---
>  app/test/test_trace.c             | 3 ---
>  lib/eal/common/eal_common_trace.c | 3 ---
>  2 files changed, 6 deletions(-)
>
> diff --git a/lib/eal/common/eal_common_trace.c b/lib/eal/common/eal_common_trace.c
> index d5dbc7d667..1b86f5d2d2 100644
> --- a/lib/eal/common/eal_common_trace.c
> +++ b/lib/eal/common/eal_common_trace.c
> @@ -127,9 +127,6 @@ rte_trace_mode_set(enum rte_trace_mode mode)
>  {
>         struct trace_point *tp;
>
> -       if (!rte_trace_is_enabled())
> -               return;

Just added pre check to avoid going through this linked list as an optimization.
Since it is in slowpath, your changes are OK.

> -
>         STAILQ_FOREACH(tp, &tp_list, next)
>                 trace_mode_set(tp->handle, mode);
>
> --
> 2.37.3
>


More information about the stable mailing list