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 CA1C34246D; Mon, 23 Jan 2023 18:28:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 32EA640150; Mon, 23 Jan 2023 18:28:51 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2046.outbound.protection.outlook.com [40.107.93.46]) by mails.dpdk.org (Postfix) with ESMTP id 9718E400EF for ; Mon, 23 Jan 2023 18:28:49 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nk4L744azveF/ifvOg88MmiQdSiCLI42Lp8DCFQvROUtBm9LrIrJt0+7E+Bv4mzsRUzVsbCKgzauWObiDe2zm2b4W80UuQGaq/57NQA8H5NzdxrdWgu8nL/nXbx7DKQAftkFwCyztw4FjvlK6lu5MDA9I9ZVq+RTx5wJ4mjHAzWGLGB/asNKI6klvkQ91DSt67/38LWR+oz8Gp2rhSJrQxfCdNG0BxYoSiEeDW656jqPsTwhlO07wxuMc53qCEQvgXFvn1V0LeCLW5PbvQXNXL40xIGWHKLgFMjOW001prSZ9J1SV1+p8j3FeVntq//w/hiHJYuPvr+Af5cEUilkJw== 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=qW2ObwDOYzzEUINv0g8nclvANFsn0TglkJmPUIUDwuw=; b=JsaZekuDwoZaC7Y2n7EDuPTuAW24SpnwUyLUH/iQxtf6zWCpqXocEXWICB86tMw0M6KCAvY2JqGX2oi4acazWcEi9mjqeJc1fc0qJEvnPztJ4tkA/blSRzmcZ8deUZ2zyFlUYQwqaMFP/Nyli3JQQx8pO5yzyqIhY/mgyQ2SLFRc2jINvGvWua1gDAVlF86D7XPimccdfpD3jmmlcZTvO7hBRM/hJ7jl0Cz/nywUB4OQrnFAeczrfW/qP26oedtJtZUzcWAqjQH4Dmnew1EV+DMC6plodHFboJJtGRt5g3wnoNzZFOgGjets//TQyh2i1Ssu8DGggBjryjoiBwVVGQ== 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=qW2ObwDOYzzEUINv0g8nclvANFsn0TglkJmPUIUDwuw=; b=VeZtV3bdSsGOYratVWCWaTvbZ3IevyIx5ze5w+LcUI+/WcI58SCgjeZr8bmdPJ6nPjbF7Hwi98ioxsqZ/RC0u9/I0Z56r9fY/3zodL4gLosjF9b5EBukca7r/CTo9xpk4NNLXFNwVJkRkD7GMyMUQ0OySjHa/2w6yCj9ztxs2y8= 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 DM4PR12MB5149.namprd12.prod.outlook.com (2603:10b6:5:390::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.33; Mon, 23 Jan 2023 17:28:47 +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; Mon, 23 Jan 2023 17:28:40 +0000 Message-ID: <4dfeba29-baf2-f9f0-4b9e-51a93160a13b@amd.com> Date: Mon, 23 Jan 2023 17:27:56 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 From: Ferruh Yigit Subject: Re: [PATCH v6 1/6] eal: trace: add trace point emit for blob 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, irusskikh@marvell.com, shepard.siegel@atomicrules.com, ed.czeck@atomicrules.com, john.miller@atomicrules.com, ajit.khaparde@broadcom.com, somnath.kotur@broadcom.com, jerinj@marvell.com, mczekaj@marvell.com, sthotton@marvell.com, srinivasan@marvell.com, hkalra@marvell.com, 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, ndabilpuram@marvell.com, kirankumark@marvell.com, skori@marvell.com, skoteshwar@marvell.com, lironh@marvell.com, zr@semihalf.com, radhac@marvell.com, vburru@marvell.com, sedara@marvell.com, 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, rmody@marvell.com, shshaikh@marvell.com, dsinghrawat@marvell.com, 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> Content-Language: en-US In-Reply-To: <20230120084059.2926575-2-adwivedi@marvell.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P265CA0128.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2c6::16) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|DM4PR12MB5149:EE_ X-MS-Office365-Filtering-Correlation-Id: 3274b014-da91-47b8-01ef-08dafd67443b 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: ah99SiqYKgsOlHVAXncMXyvzXAFz3O2YLI8PdO/Nbxr5kTpSK3FxI7AexHJbrN+WiX3CKhmymzyniItcW3yeYYqax+S0nI/BJcjBFtSMr7QHSkBzRj30GVgMPCrA2raz5OVDhAsms7Y9W7lx9RUDc/SkDWlb6b3ySYvGq70jAJWDmKEACcAHdAYfJtAS3weNgRE4fN3PP0yDpIWQOJ3aWW4TULExURbLhUyS1byrG9gLnQYDbZ8N2Jwe96sLA06rCfu5tN+9vfdMd6+CUAR0to2oNebcr92mvM8ouuEIJkmbth3awSNeCky9MTFqyOe/ELMi2CiWF6VAD/VfXkJoZYgSlE9iz7uGNLIJ6JiCwceenJCZJw7L5gfmJMIM1gySyYT0Z6t/56A/nUYyX6+8N8Qz5GtWmnXmgyxFtRPHFFJPPdfavavl1j9SHdHOpUgJ9AgxdGYaTmr/4ZtaKfJbe8yA+88stnPqRTihFNrKZyeomMdEnllYHMbG5OD/mTk6VCwOpmBJqHaVjYgiAF5TJdEgQi1jNKars9DA0TETGJRcC0VaFh2Qk20cAPKoB8YVI1wbem7cEKdL1fO0/AvcHeqMaglJJ36i/qobk+macGWas6/sNaLh5M/zTG9tWAJvdCTy/9EeuntR5QhZBD1ViTVrV3LxqWPUDeBLM5+MgP6MAMlOK3N2D6bpc3G+pDyPIRKr4QMbJMIpWZr2+r7FtddhautYTZlTzt3DgUtdvbM= 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:(13230022)(4636009)(346002)(136003)(376002)(396003)(366004)(39860400002)(451199015)(31686004)(53546011)(31696002)(86362001)(2906002)(7366002)(44832011)(7336002)(7406005)(7416002)(8936002)(38100700002)(36756003)(5660300002)(83380400001)(6512007)(186003)(26005)(6666004)(6506007)(316002)(478600001)(6486002)(41300700001)(66946007)(66556008)(4326008)(8676002)(66476007)(2616005)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?K2MybjZRcEltanc5b0VGRURIb1UwYnkyaGpxeEMxSDdaOVA2bEhEQVVMcnBO?= =?utf-8?B?S0FIZ2N6QWQ5MkZWTStYa0ZJa2t1Z3dSNVFXeGsrMEp2WlUwbUg0clJ0aFQw?= =?utf-8?B?RzVPMTBOMWFQTVlHTlloeG1jZitPcUt1TE1yV3lwQnF4T0xpNHFoaDlhZnQ5?= =?utf-8?B?N2ZtZ09lWFlGVFhLTVpxVC9oWUZkN2FYenlNaWNMcGtreUFGZzgyNm9Nc0x5?= =?utf-8?B?emlWMTdmdERQR3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pERmtqbm56SnQ2TmtzdVEy?= =?utf-8?B?R21ndTJneWJXUXo0dGxzV2RxYmttSDlUUzQ5TUNqSmlPVkZNOXExVE1jMGVJ?= =?utf-8?Q?4lk8YRuOrByFMyL2csYNz/ecy?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3274b014-da91-47b8-01ef-08dafd67443b X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2023 17:28:39.9535 (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: l3ya1vCsPdgDI8HbA+piNlhzgqmTsMXPgKpUU1F4scSvHe087164KAtBeExiw93S X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5149 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/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? > #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? > +} 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()'? > #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?