>> From: Tomasz Duszynski [mailto:tduszyn...@marvell.com] >> Sent: Monday, 28 October 2024 11.32 >> >> >On Fri, Oct 25, 2024 at 2:25 PM Tomasz Duszynski >> <tduszyn...@marvell.com> wrote: >> >> >> >> In order to profile app one needs to store significant amount of >> >> samples somewhere for an analysis later on. Since trace library >> >> supports storing data in a CTF format lets take advantage of that >> and >> >> add a dedicated PMU tracepoint. >> >> >> >> Signed-off-by: Tomasz Duszynski <tduszyn...@marvell.com> >> > >> > >> >--------------START------------------------- >> >> diff --git a/lib/eal/common/eal_common_trace_points.c >> >> b/lib/eal/common/eal_common_trace_points.c >> >> index 0f1240ea3a..c99eab92f4 100644 >> >> --- a/lib/eal/common/eal_common_trace_points.c >> >> +++ b/lib/eal/common/eal_common_trace_points.c >> >> @@ -100,3 +100,8 @@ >> RTE_TRACE_POINT_REGISTER(rte_eal_trace_intr_enable, >> >> lib.eal.intr.enable) >> >> RTE_TRACE_POINT_REGISTER(rte_eal_trace_intr_disable, >> >> lib.eal.intr.disable) >> >> + >> >> +#ifdef RTE_LIB_PMU >> >> +RTE_TRACE_POINT_REGISTER(rte_eal_trace_pmu_read, >> >> + lib.eal.pmu.read) >> >> +#endif >> >> >> >> #define RTE_EAL_TRACE_GENERIC_FUNC >> >> rte_eal_trace_generic_func(__func__) >> >> >> >> +#ifdef RTE_LIB_PMU >> >> +#include <rte_pmu.h> >> >> + >> >> +RTE_TRACE_POINT_FP( >> >> + rte_eal_trace_pmu_read, >> >> + RTE_TRACE_POINT_ARGS(unsigned int index), >> >> + uint64_t val = rte_pmu_read(index); >> >> + rte_trace_point_emit_u64(val); >> >> +) >> >> +#endif >> >> + >> >--------------END------------------------- >> > >> >All of the above changes can go to lib/pmu. Right? Like ethdev is >> adding its trace points in ethdev >> >library? >> >and make trace point name as rte_pmu_trace_read >> >> That's because libpmu is higher than eal in hierarchy of libraries so >> it won't see some symbols, for example __rte_trace_point_register(). >> So first tracing itself needs to be moved out to a separate library >> and then approach other libs take would become natural for libpmu too. > >OK; I suppose the required change of tracing library is not going to happen >right away, so Ack to >keeping it here (for now). > >Please rename trace point to rte_pmu_trace_read / lib.pmu.read as requested by >Jerin. Although it >is temporarily in EAL (due to the above trace library issue), it really is PMU >library, not EAL >library. >
Sure, no problem.