Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/69122/?format=api
https://patches.dpdk.org/api/patches/69122/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200422190349.3768487-3-jerinj@marvell.com/", "project": { "id": 1, "url": "https://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20200422190349.3768487-3-jerinj@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200422190349.3768487-3-jerinj@marvell.com", "date": "2020-04-22T19:03:19", "name": "[v7,02/32] eal/trace: define the public API for trace support", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "bdbb6ff82c8409f955fff88ff7bd366b88dfeec8", "submitter": { "id": 1188, "url": "https://patches.dpdk.org/api/people/1188/?format=api", "name": "Jerin Jacob Kollanukkaran", "email": "jerinj@marvell.com" }, "delegate": { "id": 24651, "url": "https://patches.dpdk.org/api/users/24651/?format=api", "username": "dmarchand", "first_name": "David", "last_name": "Marchand", "email": "david.marchand@redhat.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200422190349.3768487-3-jerinj@marvell.com/mbox/", "series": [ { "id": 9574, "url": "https://patches.dpdk.org/api/series/9574/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=9574", "date": "2020-04-22T19:03:17", "name": "DPDK Trace support", "version": 7, "mbox": "https://patches.dpdk.org/series/9574/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/69122/comments/", "check": "warning", "checks": "https://patches.dpdk.org/api/patches/69122/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 4A74CA00C2;\n\tWed, 22 Apr 2020 21:04:15 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id AE7351D14F;\n\tWed, 22 Apr 2020 21:04:09 +0200 (CEST)", "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id C09531D14F\n for <dev@dpdk.org>; Wed, 22 Apr 2020 21:04:04 +0200 (CEST)", "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n 03MJ1N6U005804; Wed, 22 Apr 2020 12:04:02 -0700", "from sc-exch01.marvell.com ([199.233.58.181])\n by mx0b-0016f401.pphosted.com with ESMTP id 30jd013jav-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Wed, 22 Apr 2020 12:04:02 -0700", "from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH01.marvell.com\n (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Wed, 22 Apr 2020 12:03:59 -0700", "from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Wed, 22 Apr 2020 12:03:59 -0700", "from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14])\n by maili.marvell.com (Postfix) with ESMTP id C5AAF3F703F;\n Wed, 22 Apr 2020 12:03:56 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0818;\n bh=d11WN4vNV6j1GV5uo2IJ5BJBQzkLlR3JpOkBfvAHplQ=;\n b=JxKW+zCzE/PVHPakGmkIlCGPN4cig/RrRuEB5fl/9Ek3G0uQ5gcQlp3rInNqzNeGX51W\n sOY4GKAWJNxHHmaYHblLPOm2b8bmL7lNpU0ClF4tjvFvmNHhm24IRbblBRCIPHjVnaom\n AqrdBV2bzgXyWpIp+S7q8hmQ5AOe0NmwNE+L3vfnPHnz6ptGX9Wnyin9zEgye42CmE4H\n FA9icLuLqHAClzCGgOuyd0HRedel0S0dsClTK4MP6wcSwzcR0x2Zb7pUh4F58EcFYboJ\n 3mIILKHCfafR7TqBsqoFyrBFdu5qwKwtdC+JMuBY5ABiawAsK5/RoGqDm3ubKIFdv0WM kg==", "From": "<jerinj@marvell.com>", "To": "Thomas Monjalon <thomas@monjalon.net>, John McNamara\n <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,\n \"Jerin Jacob\" <jerinj@marvell.com>, Sunil Kumar Kori <skori@marvell.com>,\n \"Bruce Richardson\" <bruce.richardson@intel.com>", "CC": "<dev@dpdk.org>, <david.marchand@redhat.com>,\n <mattias.ronnblom@ericsson.com>", "Date": "Thu, 23 Apr 2020 00:33:19 +0530", "Message-ID": "<20200422190349.3768487-3-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>\n <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\n definitions=2020-04-22_06:2020-04-22,\n 2020-04-22 signatures=0", "Subject": "[dpdk-dev] [PATCH v7 02/32] eal/trace: define the public API for\n\ttrace support", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "From: Jerin Jacob <jerinj@marvell.com>\n\nDefine the public API for trace support.\nThis patch also adds support for the build infrastructure and\nupdate the MAINTAINERS file for the trace subsystem.\n\nThe tracepoint object is of size 8B, it a global variable and used in\nfastpath. Created a new __rte_trace_point section to store the\ntracepoint objects as,\n- It is a mostly read-only data and not to mix with other \"write\"\nglobal variables.\n- Chances that the same subsystem Fast path variables come in the same\nfast path cache line. i.e, it will enable a more predictable\nperformance number from build to build.\n\nSigned-off-by: Jerin Jacob <jerinj@marvell.com>\nSigned-off-by: Sunil Kumar Kori <skori@marvell.com>\n---\n MAINTAINERS | 6 +\n config/common_base | 1 +\n config/meson.build | 1 +\n doc/api/doxy-api-index.md | 4 +-\n doc/guides/prog_guide/build-sdk-meson.rst | 5 +\n lib/librte_eal/common/eal_common_trace.c | 7 +\n lib/librte_eal/common/meson.build | 1 +\n lib/librte_eal/freebsd/Makefile | 1 +\n lib/librte_eal/include/meson.build | 2 +\n lib/librte_eal/include/rte_trace.h | 141 +++++++++++++\n lib/librte_eal/include/rte_trace_point.h | 234 ++++++++++++++++++++++\n lib/librte_eal/linux/Makefile | 1 +\n meson_options.txt | 2 +\n 13 files changed, 405 insertions(+), 1 deletion(-)\n create mode 100644 lib/librte_eal/common/eal_common_trace.c\n create mode 100644 lib/librte_eal/include/rte_trace.h\n create mode 100644 lib/librte_eal/include/rte_trace_point.h", "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex 7b81e2d1b..52bbff623 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -194,6 +194,12 @@ F: app/test/test_string_fns.c\n F: app/test/test_tailq.c\n F: app/test/test_version.c\n \n+Trace - EXPERIMENTAL\n+M: Jerin Jacob <jerinj@marvell.com>\n+M: Sunil Kumar Kori <skori@marvell.com>\n+F: lib/librte_eal/include/rte_trace*.h\n+F: lib/librte_eal/common/eal_common_trace*.c\n+\n Memory Allocation\n M: Anatoly Burakov <anatoly.burakov@intel.com>\n F: lib/librte_eal/include/rte_fbarray.h\ndiff --git a/config/common_base b/config/common_base\nindex 9ec689dde..d26eebbba 100644\n--- a/config/common_base\n+++ b/config/common_base\n@@ -99,6 +99,7 @@ CONFIG_RTE_MAX_MEMZONE=2560\n CONFIG_RTE_MAX_TAILQ=32\n CONFIG_RTE_ENABLE_ASSERT=n\n CONFIG_RTE_LOG_DP_LEVEL=RTE_LOG_INFO\n+CONFIG_RTE_ENABLE_TRACE_FP=n\n CONFIG_RTE_LOG_HISTORY=256\n CONFIG_RTE_BACKTRACE=y\n CONFIG_RTE_LIBEAL_USE_HPET=n\ndiff --git a/config/meson.build b/config/meson.build\nindex 224d29e1c..e851b407b 100644\n--- a/config/meson.build\n+++ b/config/meson.build\n@@ -229,6 +229,7 @@ dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))\n dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))\n dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))\n dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))\n+dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp'))\n # values which have defaults which may be overridden\n dpdk_conf.set('RTE_MAX_VFIO_GROUPS', 64)\n dpdk_conf.set('RTE_DRIVER_MEMPOOL_BUCKET_SIZE_KB', 64)\ndiff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md\nindex dff496be0..845a53491 100644\n--- a/doc/api/doxy-api-index.md\n+++ b/doc/api/doxy-api-index.md\n@@ -174,7 +174,9 @@ The public API headers are grouped by topics:\n [hexdump] (@ref rte_hexdump.h),\n [debug] (@ref rte_debug.h),\n [log] (@ref rte_log.h),\n- [errno] (@ref rte_errno.h)\n+ [errno] (@ref rte_errno.h),\n+ [trace] (@ref rte_trace.h),\n+ [trace_point] (@ref rte_trace_point.h)\n \n - **misc**:\n [EAL config] (@ref rte_eal.h),\ndiff --git a/doc/guides/prog_guide/build-sdk-meson.rst b/doc/guides/prog_guide/build-sdk-meson.rst\nindex e34daab91..a036299da 100644\n--- a/doc/guides/prog_guide/build-sdk-meson.rst\n+++ b/doc/guides/prog_guide/build-sdk-meson.rst\n@@ -87,6 +87,9 @@ Project-specific options are passed used -Doption=value::\n \tmeson -Ddisable_drivers=event/*,net/tap # disable tap driver and all\n \t\t\t\t\t# eventdev PMDs for a smaller build\n \n+\tmeson -Denable_trace_fp=true tracebuild # build with fastpath trace\n+\t\t\t\t\t#enabled\n+\n Examples of setting some of the same options using meson configure::\n \n \tmeson configure -Dwerror=true\n@@ -97,6 +100,8 @@ Examples of setting some of the same options using meson configure::\n \n \tmeson configure -Dmax_lcores=8\n \n+\tmeson configure -Denable_trace_fp=true\n+\n NOTE: once meson has been run to configure a build in a directory, it\n cannot be run again on the same directory. Instead ``meson configure``\n should be used to change the build settings within the directory, and when\ndiff --git a/lib/librte_eal/common/eal_common_trace.c b/lib/librte_eal/common/eal_common_trace.c\nnew file mode 100644\nindex 000000000..33a6e563a\n--- /dev/null\n+++ b/lib/librte_eal/common/eal_common_trace.c\n@@ -0,0 +1,7 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ */\n+\n+#include <rte_trace.h>\n+#include <rte_trace_point.h>\n+\ndiff --git a/lib/librte_eal/common/meson.build b/lib/librte_eal/common/meson.build\nindex 02d9280cc..429e89f99 100644\n--- a/lib/librte_eal/common/meson.build\n+++ b/lib/librte_eal/common/meson.build\n@@ -42,6 +42,7 @@ sources += files(\n \t'eal_common_tailqs.c',\n \t'eal_common_thread.c',\n \t'eal_common_timer.c',\n+\t'eal_common_trace.c',\n \t'eal_common_uuid.c',\n \t'hotplug_mp.c',\n \t'malloc_elem.c',\ndiff --git a/lib/librte_eal/freebsd/Makefile b/lib/librte_eal/freebsd/Makefile\nindex 2d53ce9ee..500afc578 100644\n--- a/lib/librte_eal/freebsd/Makefile\n+++ b/lib/librte_eal/freebsd/Makefile\n@@ -59,6 +59,7 @@ SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_thread.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_proc.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_fbarray.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_uuid.c\n+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_trace.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += rte_malloc.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += hotplug_mp.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += malloc_elem.c\ndiff --git a/lib/librte_eal/include/meson.build b/lib/librte_eal/include/meson.build\nindex 6fd427494..126455d1c 100644\n--- a/lib/librte_eal/include/meson.build\n+++ b/lib/librte_eal/include/meson.build\n@@ -40,6 +40,8 @@ headers += files(\n \t'rte_string_fns.h',\n \t'rte_tailq.h',\n \t'rte_time.h',\n+\t'rte_trace.h',\n+\t'rte_trace_point.h',\n \t'rte_uuid.h',\n \t'rte_version.h',\n \t'rte_vfio.h',\ndiff --git a/lib/librte_eal/include/rte_trace.h b/lib/librte_eal/include/rte_trace.h\nnew file mode 100644\nindex 000000000..a7ff4590b\n--- /dev/null\n+++ b/lib/librte_eal/include/rte_trace.h\n@@ -0,0 +1,141 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ */\n+\n+#ifndef _RTE_TRACE_H_\n+#define _RTE_TRACE_H_\n+\n+/**\n+ * @file\n+ *\n+ * RTE Trace API\n+ *\n+ * This file provides the trace API to RTE applications.\n+ *\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ */\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+#include <stdbool.h>\n+#include <stdio.h>\n+\n+#include <rte_common.h>\n+#include <rte_compat.h>\n+\n+/**\n+ * Enumerate trace mode operation.\n+ */\n+enum rte_trace_mode {\n+\t/**\n+\t * In this mode, When no space left in trace buffer, the subsequent\n+\t * events overwrite the old events in the trace buffer.\n+\t */\n+\tRTE_TRACE_MODE_OVERWRITE,\n+\t/**\n+\t * In this mode, When no space left on trace buffer, the subsequent\n+\t * events shall not be recorded in the trace buffer.\n+\t */\n+\tRTE_TRACE_MODE_DISCARD,\n+};\n+\n+/**\n+ * Test if trace is enabled.\n+ *\n+ * @return\n+ * true if trace is enabled, false otherwise.\n+ */\n+__rte_experimental\n+bool rte_trace_is_enabled(void);\n+\n+/**\n+ * Set the trace mode.\n+ *\n+ * @param mode\n+ * Trace mode.\n+ */\n+__rte_experimental\n+void rte_trace_mode_set(enum rte_trace_mode mode);\n+\n+/**\n+ * Get the trace mode.\n+ *\n+ * @return\n+ * The current trace mode.\n+ */\n+__rte_experimental\n+enum rte_trace_mode rte_trace_mode_get(void);\n+\n+/**\n+ * Enable/Disable a set of tracepoints based on globbing pattern.\n+ *\n+ * @param pattern\n+ * The match pattern identifying the tracepoint.\n+ * @param enable\n+ * true to enable tracepoint, false to disable the tracepoint, upon match.\n+ * @return\n+ * - 0: Success and no pattern match.\n+ * - 1: Success and found pattern match.\n+ * - (-ERANGE): Tracepoint object is not registered.\n+ */\n+__rte_experimental\n+int rte_trace_pattern(const char *pattern, bool enable);\n+\n+/**\n+ * Enable/Disable a set of tracepoints based on regular expression.\n+ *\n+ * @param regex\n+ * A regular expression identifying the tracepoint.\n+ * @param enable\n+ * true to enable tracepoint, false to disable the tracepoint, upon match.\n+ * @return\n+ * - 0: Success and no pattern match.\n+ * - 1: Success and found pattern match.\n+ * - (-ERANGE): Tracepoint object is not registered.\n+ * - (-EINVAL): Invalid regular expression rule.\n+ */\n+__rte_experimental\n+int rte_trace_regexp(const char *regex, bool enable);\n+\n+/**\n+ * Save the trace buffer to the trace directory.\n+ *\n+ * By default, trace directory will be created at $HOME directory and this can\n+ * be overridden by --trace-dir EAL parameter.\n+ *\n+ * @return\n+ * - 0: Success.\n+ * - <0 : Failure.\n+ */\n+__rte_experimental\n+int rte_trace_save(void);\n+\n+/**\n+ * Dump the trace metadata to a file.\n+ *\n+ * @param f\n+ * A pointer to a file for output\n+ * @return\n+ * - 0: Success.\n+ * - <0 : Failure.\n+ */\n+__rte_experimental\n+int rte_trace_metadata_dump(FILE *f);\n+\n+/**\n+ * Dump the trace subsystem status to a file.\n+ *\n+ * @param f\n+ * A pointer to a file for output\n+ */\n+__rte_experimental\n+void rte_trace_dump(FILE *f);\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* _RTE_TRACE_H_ */\ndiff --git a/lib/librte_eal/include/rte_trace_point.h b/lib/librte_eal/include/rte_trace_point.h\nnew file mode 100644\nindex 000000000..9d11830f6\n--- /dev/null\n+++ b/lib/librte_eal/include/rte_trace_point.h\n@@ -0,0 +1,234 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ */\n+\n+#ifndef _RTE_TRACE_POINT_H_\n+#define _RTE_TRACE_POINT_H_\n+\n+/**\n+ * @file\n+ *\n+ * RTE Tracepoint API\n+ *\n+ * This file provides the tracepoint API to RTE applications.\n+ *\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ */\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+#include <stdbool.h>\n+#include <stdio.h>\n+\n+#include <rte_common.h>\n+#include <rte_compat.h>\n+\n+/** The tracepoint object. */\n+typedef uint64_t rte_trace_point_t;\n+\n+/** Macro to define the tracepoint. */\n+#define RTE_TRACE_POINT_DEFINE(tp)\\\n+rte_trace_point_t __attribute__((section(\"__rte_trace_point\"))) __##tp\n+\n+/**\n+ * Macro to define the tracepoint arguments in RTE_TRACE_POINT macro.\n+\n+ * @see RTE_TRACE_POINT, RTE_TRACE_POINT_FP\n+ */\n+#define RTE_TRACE_POINT_ARGS\n+\n+/** @internal Helper Macro to support RTE_TRACE_POINT and RTE_TRACE_POINT_FP */\n+#define __RTE_TRACE_POINT(_mode, _tp, _args, ...)\\\n+extern rte_trace_point_t __##_tp;\\\n+static __rte_always_inline void \\\n+_tp _args \\\n+{\\\n+\t__rte_trace_point_emit_header_##_mode(&__##_tp);\\\n+\t__VA_ARGS__\\\n+}\n+\n+/**\n+ * Create a tracepoint definition.\n+ *\n+ * A tracepoint definition defines, for a given tracepoint:\n+ * - Its input arguments. They are the C function style parameters to define\n+ * the arguments of tracepoint function. These input arguments embedded using\n+ * RTE_TRACE_POINT_ARGS macro.\n+ * - Its output event fields. They are the sources of event fields that form\n+ * the payload of any event that the execution of the tracepoint macro emits\n+ * for this particular tracepoint. The application uses rte_trace_point_emit_*\n+ * macros to emit the output event fields.\n+ *\n+ * @param tp\n+ * Tracepoint object. Before using the tracepoint, an application needs to\n+ * define the tracepoint using RTE_TRACE_POINT_DEFINE macro.\n+ * @param args\n+ * C function style input arguments to define the arguments to tracepoint\n+ * function.\n+ * @param ...\n+ * Define the payload of trace function. The payload will be formed using\n+ * rte_trace_point_emit_* macros, Use \";\" delimiter between two payloads.\n+ *\n+ * @see RTE_TRACE_POINT_ARGS, RTE_TRACE_POINT_DEFINE, rte_trace_point_emit_*\n+ */\n+#define RTE_TRACE_POINT(tp, args, ...)\\\n+\t__RTE_TRACE_POINT(generic, tp, args, __VA_ARGS__)\n+\n+/**\n+ * Create a tracepoint definition for the data path.\n+ *\n+ * Similar to RTE_TRACE_POINT, except that it is removed at compilation time\n+ * using RTE_ENABLE_TRACE_FP configuration parameter.\n+ *\n+ * @param tp\n+ * Tracepoint object. Before using the tracepoint, an application needs to\n+ * define the tracepoint using RTE_TRACE_POINT_DEFINE macro.\n+ * @param args\n+ * C function style input arguments to define the arguments to tracepoint.\n+ * function.\n+ * @param ...\n+ * Define the payload of trace function. The payload will be formed using\n+ * rte_trace_point_emit_* macros, Use \";\" delimiter between two payloads.\n+ *\n+ * @see RTE_TRACE_POINT\n+ */\n+#define RTE_TRACE_POINT_FP(tp, args, ...)\\\n+\t__RTE_TRACE_POINT(fp, tp, args, __VA_ARGS__)\n+\n+#ifdef __DOXYGEN__\n+\n+/**\n+ * Macro to select rte_trace_point_emit_* definition for trace register function\n+ *\n+ * rte_trace_point_emit_* emits different definitions for trace function.\n+ * Application must define RTE_TRACE_POINT_REGISTER_SELECT before including\n+ * rte_trace_point.h in the C file where RTE_TRACE_POINT_REGISTER used.\n+ *\n+ * @see RTE_TRACE_POINT_REGISTER\n+ */\n+#define RTE_TRACE_POINT_REGISTER_SELECT\n+\n+/**\n+ * Register a dynamic tracepoint.\n+ *\n+ * @param trace\n+ * The tracepoint object created using RTE_TRACE_POINT_DEFINE.\n+ * @param name\n+ * The name of the tracepoint object.\n+ * @return\n+ * - 0: Successfully registered the tracepoint.\n+ * - <0: Failure to register the tracepoint.\n+ *\n+ * @see RTE_TRACE_POINT_REGISTER_SELECT\n+ */\n+#define RTE_TRACE_POINT_REGISTER(trace, name)\n+\n+/** Tracepoint function payload for uint64_t datatype */\n+#define rte_trace_point_emit_u64(val)\n+/** Tracepoint function payload for int64_t datatype */\n+#define rte_trace_point_emit_i64(val)\n+/** Tracepoint function payload for uint32_t datatype */\n+#define rte_trace_point_emit_u32(val)\n+/** Tracepoint function payload for int32_t datatype */\n+#define rte_trace_point_emit_i32(val)\n+/** Tracepoint function payload for uint16_t datatype */\n+#define rte_trace_point_emit_u16(val)\n+/** Tracepoint function payload for int16_t datatype */\n+#define rte_trace_point_emit_i16(val)\n+/** Tracepoint function payload for uint8_t datatype */\n+#define rte_trace_point_emit_u8(val)\n+/** Tracepoint function payload for int8_t datatype */\n+#define rte_trace_point_emit_i8(val)\n+/** Tracepoint function payload for int datatype */\n+#define rte_trace_point_emit_int(val)\n+/** Tracepoint function payload for long datatype */\n+#define rte_trace_point_emit_long(val)\n+/** Tracepoint function payload for float datatype */\n+#define rte_trace_point_emit_float(val)\n+/** Tracepoint function payload for double datatype */\n+#define rte_trace_point_emit_double(val)\n+/** Tracepoint function payload for pointer datatype */\n+#define rte_trace_point_emit_ptr(val)\n+/** Tracepoint function payload for string datatype */\n+#define rte_trace_point_emit_string(val)\n+\n+#endif /* __DOXYGEN__ */\n+\n+/** @internal Macro to define maximum emit length of string datatype. */\n+#define __RTE_TRACE_EMIT_STRING_LEN_MAX 32\n+/** @internal Macro to define event header size. */\n+#define __RTE_TRACE_EVENT_HEADER_SZ sizeof(uint64_t)\n+\n+/**\n+ * Enable recording of the given tracepoint in the trace buffer.\n+ *\n+ * @param tp\n+ * The tracepoint object to enable.\n+ * @return\n+ * - 0: Success.\n+ * - (-ERANGE): Trace object is not registered.\n+ */\n+__rte_experimental\n+int rte_trace_point_enable(rte_trace_point_t *tp);\n+\n+/**\n+ * Disable recording of the given tracepoint in the trace buffer.\n+ *\n+ * @param tp\n+ * The tracepoint object to disable.\n+ * @return\n+ * - 0: Success.\n+ * - (-ERANGE): Trace object is not registered.\n+ */\n+__rte_experimental\n+int rte_trace_point_disable(rte_trace_point_t *tp);\n+\n+/**\n+ * Test if given tracepoint is enabled.\n+ *\n+ * @param tp\n+ * The tracepoint object.\n+ * @return\n+ * true if tracepoint is enabled, false otherwise.\n+ */\n+__rte_experimental\n+bool rte_trace_point_is_enabled(rte_trace_point_t *tp);\n+\n+/**\n+ * Lookup a tracepoint object from its name.\n+ *\n+ * @param name\n+ * The name of the tracepoint.\n+ * @return\n+ * The tracepoint object or NULL if not found.\n+ */\n+__rte_experimental\n+rte_trace_point_t *rte_trace_point_lookup(const char *name);\n+\n+/**\n+ * @internal\n+ *\n+ * Test if the tracepoint fastpath compile-time option is enabled.\n+ *\n+ * @return\n+ * true if tracepoint fastpath enabled, false otherwise.\n+ */\n+__rte_experimental\n+static __rte_always_inline bool\n+__rte_trace_point_fp_is_enabled(void)\n+{\n+#ifdef RTE_ENABLE_TRACE_FP\n+\treturn true;\n+#else\n+\treturn false;\n+#endif\n+}\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* _RTE_TRACE_POINT_H_ */\ndiff --git a/lib/librte_eal/linux/Makefile b/lib/librte_eal/linux/Makefile\nindex fc2316667..2ced2085b 100644\n--- a/lib/librte_eal/linux/Makefile\n+++ b/lib/librte_eal/linux/Makefile\n@@ -66,6 +66,7 @@ SRCS-$(CONFIG_RTE_EXEC_ENV_LINUX) += eal_common_thread.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_LINUX) += eal_common_proc.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_LINUX) += eal_common_fbarray.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_LINUX) += eal_common_uuid.c\n+SRCS-$(CONFIG_RTE_EXEC_ENV_LINUX) += eal_common_trace.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_LINUX) += rte_malloc.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_LINUX) += hotplug_mp.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_LINUX) += malloc_elem.c\ndiff --git a/meson_options.txt b/meson_options.txt\nindex 9e4923a4f..3578a23ab 100644\n--- a/meson_options.txt\n+++ b/meson_options.txt\n@@ -30,6 +30,8 @@ option('max_lcores', type: 'integer', value: 128,\n \tdescription: 'maximum number of cores/threads supported by EAL')\n option('max_numa_nodes', type: 'integer', value: 4,\n \tdescription: 'maximum number of NUMA nodes supported by EAL')\n+option('enable_trace_fp', type: 'boolean', value: false,\n+\tdescription: 'enable fastpath trace points.')\n option('tests', type: 'boolean', value: true,\n \tdescription: 'build unit tests')\n option('use_hpet', type: 'boolean', value: false,\n", "prefixes": [ "v7", "02/32" ] }{ "id": 69122, "url": "