David Marchand d6fd5a018e trace: fix dynamically enabling trace points
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: 84c4fae4628f ("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>
2022-10-20 13:34:19 +02:00
..
2022-02-08 14:19:40 +01:00
2019-02-26 15:29:27 +01:00
2022-06-24 14:51:09 +02:00
2021-11-10 11:42:34 +01:00
2022-02-12 12:07:48 +01:00
2019-02-26 15:29:27 +01:00
2019-02-26 15:29:27 +01:00
2022-09-23 16:14:34 +02:00
2022-02-27 18:57:45 +01:00
2021-10-22 18:15:38 +02:00
2019-07-06 10:32:34 +02:00
2022-06-24 14:51:09 +02:00
2022-08-29 16:24:18 +02:00
2022-02-08 14:19:40 +01:00
2022-02-12 12:07:48 +01:00
2022-10-09 23:11:43 +02:00
2020-02-05 14:37:41 +01:00
2021-10-26 19:59:26 +02:00
2019-02-26 15:29:27 +01:00
2020-10-16 22:26:41 +02:00
2021-05-20 23:10:22 +02:00
2022-02-12 12:07:48 +01:00
2019-02-26 15:29:27 +01:00
2022-06-07 13:33:14 +02:00
2019-02-26 15:29:27 +01:00
2019-02-26 15:29:27 +01:00
2019-02-26 15:29:27 +01:00
2022-09-23 16:14:34 +02:00
2019-02-26 15:29:27 +01:00