On Tue, Oct 4, 2022 at 3:15 PM David Marchand <david.march...@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: sta...@dpdk.org > > Signed-off-by: David Marchand <david.march...@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 >