From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E42DAA00C2; Wed, 22 Apr 2020 21:06:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 62F8B1D536; Wed, 22 Apr 2020 21:05:28 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 5B1BA1D5ED for ; Wed, 22 Apr 2020 21:04:56 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03MJ1RxP005822; Wed, 22 Apr 2020 12:04:55 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=uP7cWYj6F6gOYzYloW8e5P/9RtrW8CSJLdCGC+61pf4=; b=I0vEykKRV7I4cDeRN47pp8GuzkP5wlPAKYyUJlm7BFQdJ05vwk/v7+CRNsaUB9dN9qPp 7kxF159GMH66HNt5Erz3hcoPiy68DYCkQYX9EIonJp6NOF/JqWjKqEGi/LOU7CqBCCUQ VKnE136DdSWbAeYbt4TMGuGpYkqYeAjsgzQ7rHyWCYYVbqGvds+7cB0G7xwUFoi2Yp08 0nhOax1K+mc2iClFbaWKxx+jPXE8Bv+r1hzQ6HUkGRK6k9Me8VqSyez3KOSz3YZBwF8Z p5/x0eXeHLJjRruqU4+pDkKBv18EmCrZF+ofjqLq7pdG/0/dV6Wm2Sgke2wItho8SLwk yw== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 30jd013jj4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 22 Apr 2020 12:04:55 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 22 Apr 2020 12:04:53 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 22 Apr 2020 12:04:52 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 22 Apr 2020 12:04:52 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 805483F703F; Wed, 22 Apr 2020 12:04:50 -0700 (PDT) From: To: Jerin Jacob , Sunil Kumar Kori , Bruce Richardson CC: , , , Date: Thu, 23 Apr 2020 00:33:33 +0530 Message-ID: <20200422190349.3768487-17-jerinj@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200422190349.3768487-1-jerinj@marvell.com> References: <20200419100133.3232316-1-jerinj@marvell.com> <20200422190349.3768487-1-jerinj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-22_06:2020-04-22, 2020-04-22 signatures=0 Subject: [dpdk-dev] [PATCH v7 16/32] eal/trace: add generic tracepoints X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Jerin Jacob This patch creates the following generic tracepoint for generic tracing when there is no dedicated tracepoint is available. - rte_trace_lib_eal_generic_void() - rte_trace_lib_eal_generic_u64() - rte_trace_lib_eal_generic_u32() - rte_trace_lib_eal_generic_u16() - rte_trace_lib_eal_generic_u8() - rte_trace_lib_eal_generic_i64() - rte_trace_lib_eal_generic_i32() - rte_trace_lib_eal_generic_i16() - rte_trace_lib_eal_generic_i8() - rte_trace_lib_eal_generic_int() - rte_trace_lib_eal_generic_long() - rte_trace_lib_eal_generic_float() - rte_trace_lib_eal_generic_double() - rte_trace_lib_eal_generic_ptr() - rte_trace_lib_eal_generic_str() For example, if an application wishes to emit an int datatype, it can call rte_trace_lib_eal_generic_int(val) to emit the trace. Signed-off-by: Jerin Jacob Signed-off-by: Sunil Kumar Kori --- .../common/eal_common_trace_points.c | 60 +++++++++ lib/librte_eal/common/meson.build | 1 + lib/librte_eal/freebsd/Makefile | 1 + lib/librte_eal/include/meson.build | 1 + lib/librte_eal/include/rte_eal_trace.h | 122 ++++++++++++++++++ lib/librte_eal/linux/Makefile | 1 + lib/librte_eal/rte_eal_version.map | 17 +++ 7 files changed, 203 insertions(+) create mode 100644 lib/librte_eal/common/eal_common_trace_points.c create mode 100644 lib/librte_eal/include/rte_eal_trace.h diff --git a/lib/librte_eal/common/eal_common_trace_points.c b/lib/librte_eal/common/eal_common_trace_points.c new file mode 100644 index 000000000..d37289f81 --- /dev/null +++ b/lib/librte_eal/common/eal_common_trace_points.c @@ -0,0 +1,60 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(C) 2020 Marvell International Ltd. + */ + +#define RTE_TRACE_POINT_REGISTER_SELECT /* Select trace point register macros */ + +#include + +RTE_TRACE_POINT_DEFINE(rte_eal_trace_generic_void); +RTE_TRACE_POINT_DEFINE(rte_eal_trace_generic_u64); +RTE_TRACE_POINT_DEFINE(rte_eal_trace_generic_u32); +RTE_TRACE_POINT_DEFINE(rte_eal_trace_generic_u16); +RTE_TRACE_POINT_DEFINE(rte_eal_trace_generic_u8); +RTE_TRACE_POINT_DEFINE(rte_eal_trace_generic_i64); +RTE_TRACE_POINT_DEFINE(rte_eal_trace_generic_i32); +RTE_TRACE_POINT_DEFINE(rte_eal_trace_generic_i16); +RTE_TRACE_POINT_DEFINE(rte_eal_trace_generic_i8); +RTE_TRACE_POINT_DEFINE(rte_eal_trace_generic_int); +RTE_TRACE_POINT_DEFINE(rte_eal_trace_generic_long); +RTE_TRACE_POINT_DEFINE(rte_eal_trace_generic_float); +RTE_TRACE_POINT_DEFINE(rte_eal_trace_generic_double); +RTE_TRACE_POINT_DEFINE(rte_eal_trace_generic_ptr); +RTE_TRACE_POINT_DEFINE(rte_eal_trace_generic_str); +RTE_TRACE_POINT_DEFINE(rte_eal_trace_generic_func); + +RTE_INIT(eal_trace_init) +{ + RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_void, + lib.eal.generic.void); + RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_u64, + lib.eal.generic.u64); + RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_u32, + lib.eal.generic.u32); + RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_u16, + lib.eal.generic.u16); + RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_u8, + lib.eal.generic.u8); + RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_i64, + lib.eal.generic.i64); + RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_i32, + lib.eal.generic.i32); + RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_i16, + lib.eal.generic.i16); + RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_i8, + lib.eal.generic.i8); + RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_int, + lib.eal.generic.int); + RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_long, + lib.eal.generic.long); + RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_float, + lib.eal.generic.float); + RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_double, + lib.eal.generic.double); + RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_ptr, + lib.eal.generic.ptr); + RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_str, + lib.eal.generic.string); + RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_func, + lib.eal.generic.func); +} diff --git a/lib/librte_eal/common/meson.build b/lib/librte_eal/common/meson.build index d2ac44313..155da29b4 100644 --- a/lib/librte_eal/common/meson.build +++ b/lib/librte_eal/common/meson.build @@ -44,6 +44,7 @@ sources += files( 'eal_common_timer.c', 'eal_common_trace.c', 'eal_common_trace_ctf.c', + 'eal_common_trace_points.c', 'eal_common_trace_utils.c', 'eal_common_uuid.c', 'hotplug_mp.c', diff --git a/lib/librte_eal/freebsd/Makefile b/lib/librte_eal/freebsd/Makefile index 539ad44a7..a8400f20a 100644 --- a/lib/librte_eal/freebsd/Makefile +++ b/lib/librte_eal/freebsd/Makefile @@ -61,6 +61,7 @@ SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_fbarray.c SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_uuid.c SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_trace.c SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_trace_ctf.c +SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_trace_points.c SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_trace_utils.c SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += rte_malloc.c SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += hotplug_mp.c diff --git a/lib/librte_eal/include/meson.build b/lib/librte_eal/include/meson.build index ce360615f..609a18b12 100644 --- a/lib/librte_eal/include/meson.build +++ b/lib/librte_eal/include/meson.build @@ -41,6 +41,7 @@ headers += files( 'rte_tailq.h', 'rte_time.h', 'rte_trace.h', + 'rte_eal_trace.h', 'rte_trace_point.h', 'rte_trace_point_provider.h', 'rte_trace_point_register.h', diff --git a/lib/librte_eal/include/rte_eal_trace.h b/lib/librte_eal/include/rte_eal_trace.h new file mode 100644 index 000000000..fe9776d80 --- /dev/null +++ b/lib/librte_eal/include/rte_eal_trace.h @@ -0,0 +1,122 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(C) 2020 Marvell International Ltd. + */ + +#ifndef _RTE_EAL_TRACE_H_ +#define _RTE_EAL_TRACE_H_ + +/** + * @file + * + * API for EAL trace support + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/* Generic */ +RTE_TRACE_POINT( + rte_eal_trace_generic_void, + RTE_TRACE_POINT_ARGS(void), +) + +RTE_TRACE_POINT( + rte_eal_trace_generic_u64, + RTE_TRACE_POINT_ARGS(uint64_t in), + rte_trace_point_emit_u64(in); +) + +RTE_TRACE_POINT( + rte_eal_trace_generic_u32, + RTE_TRACE_POINT_ARGS(uint32_t in), + rte_trace_point_emit_u32(in); +) + +RTE_TRACE_POINT( + rte_eal_trace_generic_u16, + RTE_TRACE_POINT_ARGS(uint16_t in), + rte_trace_point_emit_u16(in); +) + +RTE_TRACE_POINT( + rte_eal_trace_generic_u8, + RTE_TRACE_POINT_ARGS(uint8_t in), + rte_trace_point_emit_u8(in); +) + +RTE_TRACE_POINT( + rte_eal_trace_generic_i64, + RTE_TRACE_POINT_ARGS(int64_t in), + rte_trace_point_emit_i64(in); +) + +RTE_TRACE_POINT( + rte_eal_trace_generic_i32, + RTE_TRACE_POINT_ARGS(int32_t in), + rte_trace_point_emit_i32(in); +) + +RTE_TRACE_POINT( + rte_eal_trace_generic_i16, + RTE_TRACE_POINT_ARGS(int16_t in), + rte_trace_point_emit_i16(in); +) + +RTE_TRACE_POINT( + rte_eal_trace_generic_i8, + RTE_TRACE_POINT_ARGS(int8_t in), + rte_trace_point_emit_i8(in); +) + +RTE_TRACE_POINT( + rte_eal_trace_generic_int, + RTE_TRACE_POINT_ARGS(int in), + rte_trace_point_emit_int(in); +) + +RTE_TRACE_POINT( + rte_eal_trace_generic_long, + RTE_TRACE_POINT_ARGS(long in), + rte_trace_point_emit_long(in); +) + +RTE_TRACE_POINT( + rte_eal_trace_generic_float, + RTE_TRACE_POINT_ARGS(float in), + rte_trace_point_emit_float(in); +) + +RTE_TRACE_POINT( + rte_eal_trace_generic_double, + RTE_TRACE_POINT_ARGS(double in), + rte_trace_point_emit_double(in); +) + +RTE_TRACE_POINT( + rte_eal_trace_generic_ptr, + RTE_TRACE_POINT_ARGS(const void *ptr), + rte_trace_point_emit_ptr(ptr); +) + +RTE_TRACE_POINT( + rte_eal_trace_generic_str, + RTE_TRACE_POINT_ARGS(const char *str), + rte_trace_point_emit_string(str); +) + +RTE_TRACE_POINT( + rte_eal_trace_generic_func, + RTE_TRACE_POINT_ARGS(const char *func), + rte_trace_point_emit_string(func); +) + +#define RTE_TRACE_LIB_EAL_GENERIC_FUNC rte_eal_trace_generic_func(__func__) + +#ifdef __cplusplus +} +#endif + +#endif /* _RTE_EAL_TRACE_H_ */ diff --git a/lib/librte_eal/linux/Makefile b/lib/librte_eal/linux/Makefile index f00588d6e..a77eb1757 100644 --- a/lib/librte_eal/linux/Makefile +++ b/lib/librte_eal/linux/Makefile @@ -68,6 +68,7 @@ SRCS-$(CONFIG_RTE_EXEC_ENV_LINUX) += eal_common_fbarray.c SRCS-$(CONFIG_RTE_EXEC_ENV_LINUX) += eal_common_uuid.c SRCS-$(CONFIG_RTE_EXEC_ENV_LINUX) += eal_common_trace.c SRCS-$(CONFIG_RTE_EXEC_ENV_LINUX) += eal_common_trace_ctf.c +SRCS-$(CONFIG_RTE_EXEC_ENV_LINUX) += eal_common_trace_points.c SRCS-$(CONFIG_RTE_EXEC_ENV_LINUX) += eal_common_trace_utils.c SRCS-$(CONFIG_RTE_EXEC_ENV_LINUX) += rte_malloc.c SRCS-$(CONFIG_RTE_EXEC_ENV_LINUX) += hotplug_mp.c diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map index 8b51c8a5b..c333ac900 100644 --- a/lib/librte_eal/rte_eal_version.map +++ b/lib/librte_eal/rte_eal_version.map @@ -356,4 +356,21 @@ EXPERIMENTAL { rte_trace_point_lookup; rte_trace_regexp; rte_trace_save; + + __rte_trace_lib_eal_generic_double; + __rte_trace_lib_eal_generic_float; + __rte_trace_lib_eal_generic_func; + __rte_trace_lib_eal_generic_i16; + __rte_trace_lib_eal_generic_i32; + __rte_trace_lib_eal_generic_i64; + __rte_trace_lib_eal_generic_i8; + __rte_trace_lib_eal_generic_int; + __rte_trace_lib_eal_generic_long; + __rte_trace_lib_eal_generic_ptr; + __rte_trace_lib_eal_generic_str; + __rte_trace_lib_eal_generic_u16; + __rte_trace_lib_eal_generic_u32; + __rte_trace_lib_eal_generic_u64; + __rte_trace_lib_eal_generic_u8; + __rte_trace_lib_eal_generic_void; }; -- 2.25.1