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 2D0E143265; Wed, 1 Nov 2023 23:47:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ED69842D27; Wed, 1 Nov 2023 23:47:05 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id D854D40298 for ; Wed, 1 Nov 2023 23:47:04 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 33DFC20B74C0; Wed, 1 Nov 2023 15:47:04 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 33DFC20B74C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1698878824; bh=1BZEyEz6/2AQu/CR166EQjTlbOenBhgy9gK39bci/2U=; h=From:To:Cc:Subject:Date:From; b=oFfSs68y7qxkD5P9/gEra56ECoGKRJQ5WChbWU0fgK3S2AeoB5qOtSWHhclNWbsy+ VAKop04Afq2Q8ln81BJ2ENYDf/JAubfYMtmg3GpGQNL5P1FLVylRn/rUfYJ7oBI/D8 QctwvIgOlWdHxMBBq9W3ruhtlNTxDzVwNZbyplWg= From: Tyler Retzlaff To: dev@dpdk.org Cc: Jerin Jacob , Sunil Kumar Kori , david.marchand@redhat.com, Tyler Retzlaff Subject: [PATCH] eal: provide trace point register macro for MSVC Date: Wed, 1 Nov 2023 15:47:02 -0700 Message-Id: <1698878822-17099-1-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 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 Provide an alternate RTE_TRACE_POINT_REGISTER macro when building with MSVC that allocates segments for the trace point using MSVC specific features Signed-off-by: Tyler Retzlaff --- lib/eal/include/rte_trace_point_register.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/eal/include/rte_trace_point_register.h b/lib/eal/include/rte_trace_point_register.h index a9682d3..e6c2abe 100644 --- a/lib/eal/include/rte_trace_point_register.h +++ b/lib/eal/include/rte_trace_point_register.h @@ -18,6 +18,19 @@ RTE_DECLARE_PER_LCORE(volatile int, trace_point_sz); +#ifdef RTE_TOOLCHAIN_MSVC +#define RTE_TRACE_POINT_REGISTER(trace, name) \ +rte_trace_point_t \ +__pragma(data_seg("__rte_trace_point")) \ +__declspec(allocate("__rte_trace_point")) \ +__##trace; \ +static const char __##trace##_name[] = RTE_STR(name); \ +RTE_INIT(trace##_init) \ +{ \ + __rte_trace_point_register(&__##trace, __##trace##_name, \ + (void (*)(void)) trace); \ +} +#else #define RTE_TRACE_POINT_REGISTER(trace, name) \ rte_trace_point_t __attribute__((section("__rte_trace_point"))) __##trace; \ static const char __##trace##_name[] = RTE_STR(name); \ @@ -26,6 +39,7 @@ __rte_trace_point_register(&__##trace, __##trace##_name, \ (void (*)(void)) trace); \ } +#endif #define __rte_trace_point_emit_header_generic(t) \ RTE_PER_LCORE(trace_point_sz) = __RTE_TRACE_EVENT_HEADER_SZ -- 1.8.3.1