From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7A34742401; Wed, 25 Jan 2023 17:09:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5DE8342D8C; Wed, 25 Jan 2023 17:09:53 +0100 (CET) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2082.outbound.protection.outlook.com [40.107.100.82]) by mails.dpdk.org (Postfix) with ESMTP id E058542D47 for ; Wed, 25 Jan 2023 17:09:51 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b9ep9Q34YGLAxXkesYKmvW8x9sptU4rnbOgr3nUKbPx8Jm0mvSvhYcA63mns6EMXaGgl+oui2kadsaH0sjOSer7rRcrfc5l/h3LdIqYyNJfORBoVX9n0mFjRsMGSJZdbZccRsrxyLLb01SZFCA/LFo14gNdpZZ11HqoepAQwvcE/3WJzFZcT30SslHJed8DOwG/7i0sO9UbwJJi5nKJaa59Pi+in3TKFh+vaE2EHabmfv/5OSsa8v0dRozj+EY+PlV6pL2eaQReZAqYULFi+RArzzCI7Z3JEGsEYGemdkxieFnySXFZyH5DKSjOqQiA5Z807cr0++cPmdu2r7Jty/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=R5fuZV9EdkMrB2sgNUh+2hchLDcTYU32kyfa+Nuv6UA=; b=WxHmSvXeQ7thWiKIKzbO9oVuTmCQy4BcUa042o1cLbRmcIhjcqA3GZdqgUz+ZqMj/NKCJW7PXtmRPuoSBpO0dx5OsIHpXNTx4Tz0UmiLyF8RztNOptunnmQhJbIEyJnNZi7xJZa+TqFgvix5VQfupFpimOVgBj4McqPNOVYXaemqH5w6sPglU3+LraUf09y8+mye9b3kBTTWIdjccK6kAT9cB4YbQDdjRcUFOoKCBb18CM0KS8+2KRMZaDNXI6gVd2GrO7WadJTbyCWUFlFz8/Qa9CM1IkeMushHQMKpSpONYOg/FzARoz9T9IZYeHUY4/Eny29b420y5BYyfSYQTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R5fuZV9EdkMrB2sgNUh+2hchLDcTYU32kyfa+Nuv6UA=; b=1Q5hnghmRupsaSeGTgs8BVwt0ixIf7jWSB5tYEZMK+KO1beDUg2Jggk8SjtjsR1JBJP9z1idUx1lob6ZKfyv07hFmqee7HE7DifHJ7q29xW092530gb54II+Yq8iKYgZZedMamh9R6lmUkxGNVexQh1X49/qP09mDx5h1jAa1tE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by SA0PR12MB4432.namprd12.prod.outlook.com (2603:10b6:806:98::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.21; Wed, 25 Jan 2023 16:09:49 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a%7]) with mapi id 15.20.6002.033; Wed, 25 Jan 2023 16:09:49 +0000 Message-ID: <300fe72b-6d3e-eb2f-3360-fc3150e0a94a@amd.com> Date: Wed, 25 Jan 2023 16:09:33 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 To: Ankur Dwivedi , "dev@dpdk.org" Cc: "thomas@monjalon.net" , "david.marchand@redhat.com" , "mdr@ashroe.eu" , "orika@nvidia.com" , "chas3@att.com" , "humin29@huawei.com" , "linville@tuxdriver.com" , "ciara.loftus@intel.com" , "qi.z.zhang@intel.com" , "mw@semihalf.com" , "mk@semihalf.com" , "shaibran@amazon.com" , "evgenys@amazon.com" , "igorch@amazon.com" , "chandu@amd.com" , Igor Russkikh , "shepard.siegel@atomicrules.com" , "ed.czeck@atomicrules.com" , "john.miller@atomicrules.com" , "ajit.khaparde@broadcom.com" , "somnath.kotur@broadcom.com" , Jerin Jacob Kollanukkaran , "Maciej Czekaj [C]" , Shijith Thotton , Srisivasubramanian Srinivasan , Harman Kalra , "rahul.lakkireddy@chelsio.com" , "johndale@cisco.com" , "hyonkim@cisco.com" , "liudongdong3@huawei.com" , "yisen.zhuang@huawei.com" , "xuanziyang2@huawei.com" , "cloud.wangxiaoyun@huawei.com" , "zhouguoyang@huawei.com" , "simei.su@intel.com" , "wenjun1.wu@intel.com" , "qiming.yang@intel.com" , "Yuying.Zhang@intel.com" , "beilei.xing@intel.com" , "xiao.w.wang@intel.com" , "jingjing.wu@intel.com" , "junfeng.guo@intel.com" , "rosen.xu@intel.com" , Nithin Kumar Dabilpuram , Kiran Kumar Kokkilagadda , Sunil Kumar Kori , Satha Koteswara Rao Kottidi , Liron Himi , "zr@semihalf.com" , Radha Chintakuntla , Veerasenareddy Burru , Sathesh B Edara , "matan@nvidia.com" , "viacheslavo@nvidia.com" , "longli@microsoft.com" , "spinler@cesnet.cz" , "chaoyong.he@corigine.com" , "niklas.soderlund@corigine.com" , "hemant.agrawal@nxp.com" , "sachin.saxena@oss.nxp.com" , "g.singh@nxp.com" , "apeksha.gupta@nxp.com" , "sachin.saxena@nxp.com" , "aboyer@pensando.io" , Rasesh Mody , Shahed Shaikh , Devendra Singh Rawat , "andrew.rybchenko@oktetlabs.ru" , "jiawenwu@trustnetic.com" , "jianwang@trustnetic.com" , "jbehrens@vmware.com" , "maxime.coquelin@redhat.com" , "chenbo.xia@intel.com" , "steven.webster@windriver.com" , "matt.peters@windriver.com" , "bruce.richardson@intel.com" , "mtetsuyah@gmail.com" , "grive@u256.net" , "jasvinder.singh@intel.com" , "cristian.dumitrescu@intel.com" , "jgrajcia@cisco.com" , "mb@smartsharesystems.com" References: <20230112112140.807233-1-adwivedi@marvell.com> <20230120084059.2926575-1-adwivedi@marvell.com> <20230120084059.2926575-2-adwivedi@marvell.com> <4dfeba29-baf2-f9f0-4b9e-51a93160a13b@amd.com> Content-Language: en-US From: Ferruh Yigit Subject: Re: [EXT] Re: [PATCH v6 1/6] eal: trace: add trace point emit for blob In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P265CA0190.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:311::18) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SA0PR12MB4432:EE_ X-MS-Office365-Filtering-Correlation-Id: 2f0943aa-cf3f-47a7-cbe3-08dafeee9536 X-LD-Processed: 3dd8961f-e488-4e60-8e11-a82d994e183d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gpy3RLPCHiEorXokOjG+zUc4PSBZYAKqMwGlf/2dm5KJ2El7V9g5SrjMJ99T+smrM7cypSnvyLLPgiWKmoQ+3ix5ZVwu8Q6aEpReAHfjARmbSCxEci3AnQak96DLIYYuLsF5NWR6Q2850jTuTQUvs/Btn4zUWnCzu27S6K/zSU0VZo6v+xMpFBiPwzjgpG83tmPx/DT/MpUrdqo/Qe5mMzTwmr+sGFGLRnY7jthVfF52Mdw2+NaDWJlQRdySdFVzawWfSEXtnr0xIxOQoso2OEumevF39e30mb14dwtnbtiqeNmXeVpom7VN1Unboy7MP7kPyLX0TZPcsoAuRRrIqqFSH+L1MZtvUNIlLgDIXOtZdwGJdKMlXoWh/UwOoUcE+f9j3furugW2g2tEOg9vsqrev/LSFHL8UpFj7x1XgxkWNREL7l6LyGsQX4c8M4qzPuE11ffe37/0GmrjpIsUCifNGhvfB70SCHOjsB3TQUhxbe2HYVyxfK4dCGRA/pz/CNDMglwVCleoCTE/W1EJCYqOJHCmn+W+uPFoch75JC+2zG4VSnYIgOkRoUr2u040doHunWrFH7WLwkOq62WTDZBhZvvumjRoyyXPWM6vMoSC6vdvGwW3KErdygnuVE4c6i+m9LMdIHXlJC5qbEHtKx0R3+XhUs/EeSbe37bSDEQhixuwceYHPzvwXRGyOacI85IefePt01GvAFHtEIjiXh0SPu2xgMSOCoohUPjDbWc= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(39860400002)(346002)(366004)(376002)(136003)(396003)(451199018)(5660300002)(186003)(316002)(2906002)(66946007)(66476007)(66556008)(8936002)(8676002)(4326008)(41300700001)(31686004)(6486002)(83380400001)(478600001)(6666004)(53546011)(6506007)(6512007)(26005)(2616005)(38100700002)(7336002)(7406005)(7366002)(7416002)(44832011)(110136005)(54906003)(36756003)(31696002)(86362001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?V0NsOUNubG9QRUJvR2wrUlZicktBcFFsbW44MGN2RWVKZWF0VjN6RGpVcGF6?= =?utf-8?B?clpjM296cjFpTUZaTkFRaG5QYW1STTdmUDBNUkdZeEp0QjIvV2hvMklEYnRa?= =?utf-8?B?Yzh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ajhrQWprM1p0MjZLYThqMlZv?= =?utf-8?B?ei9nUUxKUlRPbWpEMktiWEJDbXVEbVAzRjRNdks4UXVEUUswNUx0dm1nNTYy?= =?utf-8?B?enFzcUE3RU42Q2htZUpObHF6UzlhTnR3cUJsb2tUT3lpN1BldGRHN2RzK0VD?= =?utf-8?B?dkY0Ym1tZDViVHhaNzRCaEhOVkxOOFROTlBoRDJ2Ny9SWkZneE1JTWE0M21m?= =?utf-8?Q?bNrEiwJEUUd5nLRIfqlkD9wym?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2f0943aa-cf3f-47a7-cbe3-08dafeee9536 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2023 16:09:49.3238 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XeE5sDWaYYbTPgSmZe3O6P6KAyyAnjawvv/nGlf77Zw5JhqOseypMUSJv7HSEgci X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4432 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 1/25/2023 3:02 PM, Ankur Dwivedi wrote: > >> >> ---------------------------------------------------------------------- >> On 1/20/2023 8:40 AM, Ankur Dwivedi wrote: >>> Adds a trace point emit function for capturing a blob. The blob >>> captures the length passed by the application followed by the array. >>> >>> The maximum blob bytes which can be captured is bounded by >>> RTE_TRACE_BLOB_LEN_MAX macro. The value for max blob length macro is >>> 64 bytes. If the length is less than 64 the remaining trailing bytes >>> are set to zero. >>> >>> This patch also adds test case for emit blob tracepoint function. >>> >>> Signed-off-by: Ankur Dwivedi >>> --- >>> app/test/test_trace.c | 11 ++++++++ >>> doc/guides/prog_guide/trace_lib.rst | 12 ++++++++ >>> lib/eal/common/eal_common_trace_points.c | 2 ++ >>> lib/eal/include/rte_eal_trace.h | 6 ++++ >>> lib/eal/include/rte_trace_point.h | 32 ++++++++++++++++++++++ >>> lib/eal/include/rte_trace_point_register.h | 9 ++++++ >>> lib/eal/version.map | 3 ++ >>> 7 files changed, 75 insertions(+) >>> >>> diff --git a/app/test/test_trace.c b/app/test/test_trace.c index >>> 6bedf14024..ad4a394a29 100644 >>> --- a/app/test/test_trace.c >>> +++ b/app/test/test_trace.c >>> @@ -4,6 +4,7 @@ >>> >>> #include >>> #include >>> +#include >>> #include >>> >>> #include "test.h" >>> @@ -177,7 +178,12 @@ test_fp_trace_points(void) static int >>> test_generic_trace_points(void) >>> { >>> + uint8_t arr[RTE_TRACE_BLOB_LEN_MAX]; >>> int tmp; >>> + int i; >>> + >>> + for (i = 0; i < RTE_TRACE_BLOB_LEN_MAX; i++) >>> + arr[i] = i; >>> >>> rte_eal_trace_generic_void(); >>> rte_eal_trace_generic_u64(0x10000000000000); >>> @@ -195,6 +201,11 @@ 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, 0); >>> + rte_eal_trace_generic_blob(arr, 17); >>> + rte_eal_trace_generic_blob(arr, RTE_TRACE_BLOB_LEN_MAX); >>> + rte_eal_trace_generic_blob(arr, rte_rand() % >>> + RTE_TRACE_BLOB_LEN_MAX); >>> RTE_EAL_TRACE_GENERIC_FUNC; >>> >>> return TEST_SUCCESS; >>> diff --git a/doc/guides/prog_guide/trace_lib.rst >>> b/doc/guides/prog_guide/trace_lib.rst >>> index 9a8f38073d..3e0ea5835c 100644 >>> --- a/doc/guides/prog_guide/trace_lib.rst >>> +++ b/doc/guides/prog_guide/trace_lib.rst >>> @@ -352,3 +352,15 @@ event ID. >>> The ``packet.header`` and ``packet.context`` will be written in the >>> slow path at the time of trace memory creation. The ``trace.header`` >>> and trace payload will be emitted when the tracepoint function is invoked. >>> + >>> +Limitations >>> +----------- >>> + >>> +- The ``rte_trace_point_emit_blob()`` function can capture a maximum >>> +blob of >>> + length ``RTE_TRACE_BLOB_LEN_MAX`` bytes. The application can call >>> + ``rte_trace_point_emit_blob()`` multiple times with length less >>> +than or equal to >>> + ``RTE_TRACE_BLOB_LEN_MAX``, if it needs to capture more than >>> +``RTE_TRACE_BLOB_LEN_MAX`` >>> + bytes. >>> +- If the length passed to the ``rte_trace_point_emit_blob()`` is less >>> +than >>> + ``RTE_TRACE_BLOB_LEN_MAX``, then the trailing >>> +``(RTE_TRACE_BLOB_LEN_MAX - len)`` >>> + bytes in the trace are set to zero. >>> 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..e0b836eb2f 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, uint8_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..aca8344dbf 100644 >>> --- a/lib/eal/include/rte_trace_point.h >>> +++ b/lib/eal/include/rte_trace_point.h >>> @@ -144,6 +144,16 @@ _tp _args \ >>> #define rte_trace_point_emit_ptr(val) >>> /** Tracepoint function payload for string datatype */ #define >>> rte_trace_point_emit_string(val) >>> +/** >>> + * Tracepoint function to capture a blob. >>> + * >>> + * @param val >>> + * Pointer to the array to be captured. >>> + * @param len >>> + * Length to be captured. The maximum supported length is >>> + * RTE_TRACE_BLOB_LEN_MAX bytes. >>> + */ >>> +#define rte_trace_point_emit_blob(val, len) >>> >> >> This is just for doxygen right, why doxygen comments are not above the actual >> macros but there is a separate #if block for it? > > The actual macro is within a #ifndef __DOXYGEN__ block. I think that is the reason for including > Doxygen comments here. Thanks for confirming. Why comments are not as part of actual macro, but there is a separate '#ifdef __DOXYGEN__' block? >> >>> #endif /* __DOXYGEN__ */ >>> >>> @@ -152,6 +162,9 @@ _tp _args \ >>> /** @internal Macro to define event header size. */ #define >>> __RTE_TRACE_EVENT_HEADER_SZ sizeof(uint64_t) >>> >>> +/** Macro to define maximum emit length of blob. */ #define >>> +RTE_TRACE_BLOB_LEN_MAX 64 >>> + >>> /** >>> * Enable recording events of the given tracepoint in the trace buffer. >>> * >>> @@ -374,12 +387,31 @@ 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; \ >>> + if (len > RTE_TRACE_BLOB_LEN_MAX) \ >>> + len = RTE_TRACE_BLOB_LEN_MAX; \ >>> + __rte_trace_point_emit(len, uint8_t); \ >>> + memcpy(mem, in, len); \ >>> + mem = RTE_PTR_ADD(mem, len); \ >>> + memset(mem, 0, RTE_TRACE_BLOB_LEN_MAX - len); \ >>> + mem = RTE_PTR_ADD(mem, RTE_TRACE_BLOB_LEN_MAX - len); \ >> >> >> Is first memset later memcpy not done because of performance concerns? > > The memset sets to 0 the unused bytes (RTE_TRACE_BLOB_LEN_MAX - len). So memset is done after memcpy. yep, I can see what is done. Question is, you can do more simply: memset(mem, 0, RTE_TRACE_BLOB_LEN_MAX); memcpy(mem, in, len); mem = RTE_PTR_ADD(mem, RTE_TRACE_BLOB_LEN_MAX - len); Why did you prefer the implementation you did, intentionally? If so what is the intention, performance concerns? btw, I want to remind that size of the 'len' can be max 64 bytes. >> >>> +} 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..7efbac8a72 100644 >>> --- a/lib/eal/include/rte_trace_point_register.h >>> +++ b/lib/eal/include/rte_trace_point_register.h >>> @@ -47,6 +47,15 @@ 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, uint8_t); \ >>> + __rte_trace_point_emit_field(RTE_TRACE_BLOB_LEN_MAX, \ >>> + RTE_STR(in)"["RTE_STR(RTE_TRACE_BLOB_LEN_MAX)"]", \ >>> + RTE_STR(uint8_t)); \ >>> +} while (0) >>> + >> >> Why this macro defined here again, it is also defined in 'rte_trace_point.h' >> already? >> Is it because of 'register_fn()' in '__rte_trace_point_register()'? > > Yes the register happens in this function. You are not really answering questions. There are three copy of '#define rte_trace_point_emit_blob(in, len)' one of them is for doxygen comment, please explain why there are two more copies of it? >> >>> #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; >> >> This is not a function but a trace object. >> I guess it was agreed that trace object not need to be exported, and trace can >> be found by name? > > Yes the export in version.map can be removed. Will remove it in next patch series. ack. Will there be a separate patch to remove existing symbols? Although I am not sure if it will be ABI break.