>-----Original Message----- >From: David Marchand <david.march...@redhat.com> >Sent: Friday, June 26, 2020 8:18 PM >To: dev@dpdk.org >Cc: jerinjac...@gmail.com; bruce.richard...@intel.com; m...@ashroe.eu; >tho...@monjalon.net; arybche...@solarflare.com; ktray...@redhat.com; >ian.sto...@intel.com; i.maxim...@ovn.org; Jerin Jacob Kollanukkaran ><jer...@marvell.com>; Sunil Kumar Kori <sk...@marvell.com>; Neil Horman ><nhor...@tuxdriver.com>; Harini Ramakrishnan ><harini.ramakrish...@microsoft.com>; Omar Cardona ><ocard...@microsoft.com>; Pallavi Kadam <pallavi.ka...@intel.com>; >Ranjit Menon <ranjit.me...@intel.com> >Subject: [EXT] [PATCH v4 4/9] eal: introduce thread uninit helper > >External Email > >---------------------------------------------------------------------- >This is a preparation step for dynamically unregistering threads. > >Since we explicitly allocate a per thread trace buffer in rte_thread_init, add >an >internal helper to free this buffer. > >Signed-off-by: David Marchand <david.march...@redhat.com> >--- >Note: I preferred renaming the current internal function to free all threads >trace buffers (new name trace_mem_free()) and reuse the previous name >(trace_mem_per_thread_free()) when freeing this buffer for a given thread. > >Changes since v2: >- added missing stub for windows tracing support, >- moved free symbol to exported (experimental) ABI as a counterpart of > the alloc symbol we already had, > >Changes since v1: >- rebased on master, removed Windows workaround wrt traces support, > >--- > lib/librte_eal/common/eal_common_thread.c | 9 ++++ >lib/librte_eal/common/eal_common_trace.c | 51 +++++++++++++++++++---- > lib/librte_eal/common/eal_thread.h | 5 +++ > lib/librte_eal/common/eal_trace.h | 2 +- > lib/librte_eal/include/rte_trace_point.h | 9 ++++ > lib/librte_eal/rte_eal_version.map | 3 ++ > lib/librte_eal/windows/eal.c | 5 +++ > 7 files changed, 75 insertions(+), 9 deletions(-) > >diff --git a/lib/librte_eal/common/eal_common_thread.c >b/lib/librte_eal/common/eal_common_thread.c >index afb30236c5..3b30cc99d9 100644 >--- a/lib/librte_eal/common/eal_common_thread.c >+++ b/lib/librte_eal/common/eal_common_thread.c >@@ -20,6 +20,7 @@ > #include "eal_internal_cfg.h" > #include "eal_private.h" > #include "eal_thread.h" >+#include "eal_trace.h" > > RTE_DEFINE_PER_LCORE(unsigned int, _lcore_id) = LCORE_ID_ANY; >RTE_DEFINE_PER_LCORE(int, _thread_id) = -1; @@ -161,6 +162,14 @@ >rte_thread_init(unsigned int lcore_id, rte_cpuset_t *cpuset) > __rte_trace_mem_per_thread_alloc(); > } > >+void >+rte_thread_uninit(void) >+{
Need to check whether trace is enabled or not similar to trace_mem_free(). >+ __rte_trace_mem_per_thread_free(); >+ >+ RTE_PER_LCORE(_lcore_id) = LCORE_ID_ANY; } >+ > struct rte_thread_ctrl_params { > void *(*start_routine)(void *); > void *arg; [snipped] >2.23.0