d6fd5a018e
Enabling trace points at runtime was not working if no trace point had
been enabled first at rte_eal_init() time. The reason was that
trace.args reflected the arguments passed to --trace= EAL option.
To fix this:
- the trace subsystem initialisation is updated: trace directory
creation is deferred to when traces are dumped (to avoid creating
directories that may not be used),
- per lcore memory allocation still relies on rte_trace_is_enabled() but
this helper now tracks if any trace point is enabled. The
documentation is updated accordingly,
- cleanup helpers must always be called in rte_eal_cleanup() since some
trace points might have been enabled and disabled in the lifetime of
the DPDK application,
With this fix, we can update the unit test and check that a trace point
callback is invoked when expected.
Note:
- the 'trace' global variable might be shadowed with the argument
passed to the functions dealing with trace point handles.
'tp' has been used for referring to trace_point object.
Prefer 't' for referring to handles,
Fixes: 84c4fae462
("trace: implement operation APIs")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>
18 lines
369 B
C
18 lines
369 B
C
/* SPDX-License-Identifier: BSD-3-Clause
|
|
* Copyright(C) 2020 Marvell International Ltd.
|
|
*/
|
|
#include <rte_trace_point.h>
|
|
|
|
extern int app_dpdk_test_tp_count;
|
|
RTE_TRACE_POINT(
|
|
app_dpdk_test_tp,
|
|
RTE_TRACE_POINT_ARGS(const char *str),
|
|
rte_trace_point_emit_string(str);
|
|
app_dpdk_test_tp_count++;
|
|
)
|
|
|
|
RTE_TRACE_POINT_FP(
|
|
app_dpdk_test_fp,
|
|
RTE_TRACE_POINT_ARGS(void),
|
|
)
|