One more observation that the size of lib.eal.generic.blob trace point is 31962 
bytes.
Is this trace point this much big or some bug ?

> -----Original Message-----
> From: Sunil Kumar Kori
> Sent: Thursday, January 12, 2023 10:00 PM
> To: Ankur Dwivedi <adwiv...@marvell.com>; dev@dpdk.org
> Cc: tho...@monjalon.net; david.march...@redhat.com; m...@ashroe.eu;
> or...@nvidia.com; ferruh.yi...@amd.com; ch...@att.com;
> humi...@huawei.com; linvi...@tuxdriver.com; ciara.lof...@intel.com;
> qi.z.zh...@intel.com; m...@semihalf.com; m...@semihalf.com;
> shaib...@amazon.com; evge...@amazon.com; igo...@amazon.com;
> cha...@amd.com; Igor Russkikh <irussk...@marvell.com>;
> shepard.sie...@atomicrules.com; ed.cz...@atomicrules.com;
> john.mil...@atomicrules.com; ajit.khapa...@broadcom.com;
> somnath.ko...@broadcom.com; Jerin Jacob Kollanukkaran
> <jer...@marvell.com>; Maciej Czekaj [C] <mcze...@marvell.com>; Shijith
> Thotton <sthot...@marvell.com>; Srisivasubramanian Srinivasan
> <sriniva...@marvell.com>; Harman Kalra <hka...@marvell.com>;
> rahul.lakkire...@chelsio.com; johnd...@cisco.com; hyon...@cisco.com;
> liudongdo...@huawei.com; yisen.zhu...@huawei.com;
> xuanziya...@huawei.com; cloud.wangxiao...@huawei.com;
> zhouguoy...@huawei.com; simei...@intel.com; wenjun1...@intel.com;
> qiming.y...@intel.com; yuying.zh...@intel.com; beilei.x...@intel.com;
> xiao.w.w...@intel.com; jingjing...@intel.com; junfeng....@intel.com;
> rosen...@intel.com; Nithin Kumar Dabilpuram
> <ndabilpu...@marvell.com>; Kiran Kumar Kokkilagadda
> <kirankum...@marvell.com>; Satha Koteswara Rao Kottidi
> <skotesh...@marvell.com>; Liron Himi <lir...@marvell.com>;
> z...@semihalf.com; Radha Chintakuntla <rad...@marvell.com>;
> Veerasenareddy Burru <vbu...@marvell.com>; Sathesh B Edara
> <sed...@marvell.com>; ma...@nvidia.com; viachesl...@nvidia.com;
> lon...@microsoft.com; spin...@cesnet.cz; chaoyong...@corigine.com;
> niklas.soderl...@corigine.com; hemant.agra...@nxp.com;
> sachin.sax...@oss.nxp.com; g.si...@nxp.com; apeksha.gu...@nxp.com;
> sachin.sax...@nxp.com; abo...@pensando.io; Rasesh Mody
> <rm...@marvell.com>; Shahed Shaikh <shsha...@marvell.com>; Devendra
> Singh Rawat <dsinghra...@marvell.com>; andrew.rybche...@oktetlabs.ru;
> jiawe...@trustnetic.com; jianw...@trustnetic.com;
> jbehr...@vmware.com; maxime.coque...@redhat.com;
> chenbo....@intel.com; steven.webs...@windriver.com;
> matt.pet...@windriver.com; bruce.richard...@intel.com;
> mtetsu...@gmail.com; gr...@u256.net; jasvinder.si...@intel.com;
> cristian.dumitre...@intel.com; jgraj...@cisco.com;
> m...@smartsharesystems.com; Ankur Dwivedi <adwiv...@marvell.com>
> Subject: RE: [PATCH v5 1/6] eal: trace: add trace point emit for blob
> 
> > -----Original Message-----
> > From: Ankur Dwivedi <adwiv...@marvell.com>
> > Sent: Thursday, January 12, 2023 4:52 PM
> > To: dev@dpdk.org
> > Cc: tho...@monjalon.net; david.march...@redhat.com;
> m...@ashroe.eu;
> > or...@nvidia.com; ferruh.yi...@amd.com; ch...@att.com;
> > humi...@huawei.com; linvi...@tuxdriver.com; ciara.lof...@intel.com;
> > qi.z.zh...@intel.com; m...@semihalf.com; m...@semihalf.com;
> > shaib...@amazon.com; evge...@amazon.com; igo...@amazon.com;
> > cha...@amd.com; Igor Russkikh <irussk...@marvell.com>;
> > shepard.sie...@atomicrules.com; ed.cz...@atomicrules.com;
> > john.mil...@atomicrules.com; ajit.khapa...@broadcom.com;
> > somnath.ko...@broadcom.com; Jerin Jacob Kollanukkaran
> > <jer...@marvell.com>; Maciej Czekaj [C] <mcze...@marvell.com>; Shijith
> > Thotton <sthot...@marvell.com>; Srisivasubramanian Srinivasan
> > <sriniva...@marvell.com>; Harman Kalra <hka...@marvell.com>;
> > rahul.lakkire...@chelsio.com; johnd...@cisco.com; hyon...@cisco.com;
> > liudongdo...@huawei.com; yisen.zhu...@huawei.com;
> > xuanziya...@huawei.com; cloud.wangxiao...@huawei.com;
> > zhouguoy...@huawei.com; simei...@intel.com; wenjun1...@intel.com;
> > qiming.y...@intel.com; yuying.zh...@intel.com; beilei.x...@intel.com;
> > xiao.w.w...@intel.com; jingjing...@intel.com; junfeng....@intel.com;
> > rosen...@intel.com; Nithin Kumar Dabilpuram
> <ndabilpu...@marvell.com>;
> > Kiran Kumar Kokkilagadda <kirankum...@marvell.com>; Sunil Kumar Kori
> > <sk...@marvell.com>; Satha Koteswara Rao Kottidi
> > <skotesh...@marvell.com>; Liron Himi <lir...@marvell.com>;
> > z...@semihalf.com; Radha Chintakuntla <rad...@marvell.com>;
> > Veerasenareddy Burru <vbu...@marvell.com>; Sathesh B Edara
> > <sed...@marvell.com>; ma...@nvidia.com; viachesl...@nvidia.com;
> > lon...@microsoft.com; spin...@cesnet.cz; chaoyong...@corigine.com;
> > niklas.soderl...@corigine.com; hemant.agra...@nxp.com;
> > sachin.sax...@oss.nxp.com; g.si...@nxp.com; apeksha.gu...@nxp.com;
> > sachin.sax...@nxp.com; abo...@pensando.io; Rasesh Mody
> > <rm...@marvell.com>; Shahed Shaikh <shsha...@marvell.com>;
> Devendra
> > Singh Rawat <dsinghra...@marvell.com>;
> andrew.rybche...@oktetlabs.ru;
> > jiawe...@trustnetic.com; jianw...@trustnetic.com;
> jbehr...@vmware.com;
> > maxime.coque...@redhat.com; chenbo....@intel.com;
> > steven.webs...@windriver.com; matt.pet...@windriver.com;
> > bruce.richard...@intel.com; mtetsu...@gmail.com; gr...@u256.net;
> > jasvinder.si...@intel.com; cristian.dumitre...@intel.com;
> > jgraj...@cisco.com; m...@smartsharesystems.com; Ankur Dwivedi
> > <adwiv...@marvell.com>
> > Subject: [PATCH v5 1/6] eal: trace: add trace point emit for blob
> >
> > Adds a trace point emit function for emitting a blob. The maximum blob
> > bytes which can be captured is maximum value contained in uint16_t,
> > which is 65535.
> >
> > Also adds test case for emit array tracepoint function.
> >
> > Signed-off-by: Ankur Dwivedi <adwiv...@marvell.com>
> > ---
> >  app/test/test_trace.c                      |  5 +++++
> >  lib/eal/common/eal_common_trace_points.c   |  2 ++
> >  lib/eal/include/rte_eal_trace.h            |  6 ++++++
> >  lib/eal/include/rte_trace_point.h          | 17 +++++++++++++++++
> >  lib/eal/include/rte_trace_point_register.h |  7 +++++++
> >  lib/eal/version.map                        |  3 +++
> >  6 files changed, 40 insertions(+)
> >
> > diff --git a/app/test/test_trace.c b/app/test/test_trace.c index
> > 6bedf14024..cf781dc25b 100644
> > --- a/app/test/test_trace.c
> > +++ b/app/test/test_trace.c
> > @@ -4,6 +4,7 @@
> >
> >  #include <rte_eal_trace.h>
> >  #include <rte_lcore.h>
> > +#include <rte_random.h>
> >  #include <rte_trace.h>
> >
> >  #include "test.h"
> > @@ -177,6 +178,7 @@ test_fp_trace_points(void)  static int
> >  test_generic_trace_points(void)
> >  {
> > +   uint8_t arr[32] = {0};
> >     int tmp;
> >
> >     rte_eal_trace_generic_void();
> > @@ -195,6 +197,9 @@ test_generic_trace_points(void)
> >     rte_eal_trace_generic_ptr(&tmp);
> >     rte_eal_trace_generic_str("my string");
> >     rte_eal_trace_generic_size_t(sizeof(void *));
> > +   rte_eal_trace_generic_blob(arr, 17);
> Do we need this test case now as (rte_rand % 32) will make sure to validate
> array of valid size only i.e. 0-31 ?
> 
> > +   rte_eal_trace_generic_blob(arr, 32);
> > +   rte_eal_trace_generic_blob(arr, rte_rand() % 32);
> When executed trace_autotest then I didn't find 3rd generic.blob trace point.
> Can you please explain the behavior ?
> 
> >     RTE_EAL_TRACE_GENERIC_FUNC;
> >
> >     return TEST_SUCCESS;
> > diff --git a/lib/eal/common/eal_common_trace_points.c
> > b/lib/eal/common/eal_common_trace_points.c
> > index 0b0b254615..051f89809c 100644
> > --- a/lib/eal/common/eal_common_trace_points.c
> > +++ b/lib/eal/common/eal_common_trace_points.c
> > @@ -40,6 +40,8 @@
> > RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_size_t,
> >     lib.eal.generic.size_t)
> >  RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_func,
> >     lib.eal.generic.func)
> > +RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_blob,
> > +   lib.eal.generic.blob)
> >
> >  RTE_TRACE_POINT_REGISTER(rte_eal_trace_alarm_set,
> >     lib.eal.alarm.set)
> > diff --git a/lib/eal/include/rte_eal_trace.h
> > b/lib/eal/include/rte_eal_trace.h index 5ef4398230..02e3a564a1 100644
> > --- a/lib/eal/include/rte_eal_trace.h
> > +++ b/lib/eal/include/rte_eal_trace.h
> > @@ -143,6 +143,12 @@ RTE_TRACE_POINT(
> >     rte_trace_point_emit_string(func);
> >  )
> >
> > +RTE_TRACE_POINT(
> > +   rte_eal_trace_generic_blob,
> > +   RTE_TRACE_POINT_ARGS(void *in, uint16_t len),
> > +   rte_trace_point_emit_blob(in, len);
> > +)
> > +
> >  #define RTE_EAL_TRACE_GENERIC_FUNC
> > rte_eal_trace_generic_func(__func__)
> >
> >  /* Interrupt */
> > diff --git a/lib/eal/include/rte_trace_point.h
> > b/lib/eal/include/rte_trace_point.h
> > index 0f8700974f..21b6bf7bf6 100644
> > --- a/lib/eal/include/rte_trace_point.h
> > +++ b/lib/eal/include/rte_trace_point.h
> > @@ -144,6 +144,8 @@ _tp _args \
> >  #define rte_trace_point_emit_ptr(val)
> >  /** Tracepoint function payload for string datatype */  #define
> > rte_trace_point_emit_string(val)
> > +/** Tracepoint function payload for char array */ #define
> > +rte_trace_point_emit_blob(val, len)
> >
> >  #endif /* __DOXYGEN__ */
> >
> > @@ -374,12 +376,27 @@ do { \
> >     mem = RTE_PTR_ADD(mem,
> > __RTE_TRACE_EMIT_STRING_LEN_MAX); \  } while (0)
> >
> > +#define rte_trace_point_emit_blob(in, len) \ do { \
> > +   if (unlikely(in == NULL)) \
> > +           return; \
> > +   __rte_trace_point_emit(len, uint16_t); \
> Just to confirm that is there any typo meaning "in should be used in place of
> len here" ?
> 
> > +   memcpy(mem, in, len); \
> > +   mem = RTE_PTR_ADD(mem, len); \
> Also rte_trace_point_emit copies and increment the memory pointer itself.
> Then what is the purpose of above 2 instructions ?
> 
> > +} while (0)
> > +
> >  #else
> >
> >  #define __rte_trace_point_emit_header_generic(t) RTE_SET_USED(t)
> > #define __rte_trace_point_emit_header_fp(t) RTE_SET_USED(t)  #define
> > __rte_trace_point_emit(in, type) RTE_SET_USED(in)  #define
> > rte_trace_point_emit_string(in) RTE_SET_USED(in)
> > +#define rte_trace_point_emit_blob(in, len) \ do { \
> > +   RTE_SET_USED(in); \
> > +   RTE_SET_USED(len); \
> > +} while (0)
> > +
> >
> >  #endif /* ALLOW_EXPERIMENTAL_API */
> >  #endif /* _RTE_TRACE_POINT_REGISTER_H_ */ diff --git
> > a/lib/eal/include/rte_trace_point_register.h
> > b/lib/eal/include/rte_trace_point_register.h
> > index a32f4d731b..a54f9769da 100644
> > --- a/lib/eal/include/rte_trace_point_register.h
> > +++ b/lib/eal/include/rte_trace_point_register.h
> > @@ -47,6 +47,13 @@ do { \
> >             RTE_STR(in)"[32]", "string_bounded_t"); \  } while (0)
> >
> > +#define rte_trace_point_emit_blob(in, len) \ do { \
> > +   RTE_SET_USED(in); \
> > +   __rte_trace_point_emit(len, uint16_t); \
> > +   __rte_trace_point_emit_field(len, RTE_STR(in)"["#len"]",
> > +RTE_STR(uint8_t)); \ } while (0)
> > +
> >  #ifdef __cplusplus
> >  }
> >  #endif
> > diff --git a/lib/eal/version.map b/lib/eal/version.map index
> > 7ad12a7dc9..67be24686a 100644
> > --- a/lib/eal/version.map
> > +++ b/lib/eal/version.map
> > @@ -440,6 +440,9 @@ EXPERIMENTAL {
> >     rte_thread_detach;
> >     rte_thread_equal;
> >     rte_thread_join;
> > +
> > +   # added in 23.03
> > +   __rte_eal_trace_generic_blob;
> >  };
> >
> >  INTERNAL {
> > --
> > 2.25.1

Reply via email to