]> git.droids-corp.org - dpdk.git/commitdiff
eal: add telemetry as dependency
authorCiara Power <ciara.power@intel.com>
Thu, 30 Apr 2020 16:01:34 +0000 (17:01 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 10 May 2020 22:37:16 +0000 (00:37 +0200)
This patch moves telemetry further down the build, and adds it as a
dependency for EAL. Telemetry V2 is now configured to build by default,
and the legacy support is built when the telemetry config flag is set.

Telemetry now has EAL flags, shown below:
"--telemetry" = Enables telemetry (this is default if no flags given)
"--no-telemetry" = Disables telemetry

When telemetry is enabled, it will attempt to open the new socket
version, and also the legacy support socket (this will depend on Jansson
external dependency and telemetry config flag, as before).

Signed-off-by: Ciara Power <ciara.power@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Keith Wiles <keith.wiles@intel.com>
27 files changed:
config/common_base
examples/l3fwd-power/Makefile
examples/l3fwd-power/main.c
examples/l3fwd-power/meson.build
lib/Makefile
lib/librte_eal/common/eal_common_options.c
lib/librte_eal/common/eal_internal_cfg.h
lib/librte_eal/common/eal_options.h
lib/librte_eal/freebsd/Makefile
lib/librte_eal/freebsd/eal.c
lib/librte_eal/freebsd/meson.build
lib/librte_eal/linux/Makefile
lib/librte_eal/linux/eal.c
lib/librte_eal/linux/meson.build
lib/librte_eal/meson.build
lib/librte_ethdev/Makefile
lib/librte_ethdev/meson.build
lib/librte_ethdev/rte_ethdev.c
lib/librte_rawdev/Makefile
lib/librte_rawdev/meson.build
lib/librte_rawdev/rte_rawdev.c
lib/librte_telemetry/Makefile
lib/librte_telemetry/meson.build
lib/librte_telemetry/rte_telemetry.h
lib/librte_telemetry/telemetry.c
lib/meson.build
mk/rte.app.mk

index ab4776af0112f67021d3acea27ca5ca3965de284..c7d5c73215004bf8ba57d9b858c1f091640f5b8d 100644 (file)
@@ -929,7 +929,7 @@ CONFIG_RTE_LIBRTE_BITRATE=y
 CONFIG_RTE_LIBRTE_LATENCY_STATS=y
 
 #
-# Compile librte_telemetry
+# Compile librte_telemetry legacy support
 #
 CONFIG_RTE_LIBRTE_TELEMETRY=n
 
index 531a1d81cb5c81cfc9e5acca6555466956ba3a5e..852877c1f278cf0c9f17f919e91e32a24bd595f9 100644 (file)
@@ -60,7 +60,7 @@ else
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
-LDLIBS += -lm
+LDLIBS += -lm -lrte_telemetry
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
@@ -68,10 +68,6 @@ ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
 CFLAGS_main.o += -Wno-return-type
 endif
 
-ifeq ($(CONFIG_RTE_LIBRTE_TELEMETRY),y)
-LDLIBS += -lrte_telemetry
-endif
-
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
 endif
index 20dc765941a16112135d00898b763777d0265473..13fd72d213e0d79183eb3d79ddee973cfc4fd38a 100644 (file)
@@ -46,9 +46,7 @@
 #include <rte_spinlock.h>
 #include <rte_power_empty_poll.h>
 #include <rte_metrics.h>
-#ifdef RTE_LIBRTE_TELEMETRY
 #include <rte_telemetry.h>
-#endif
 
 #include "perf_core.h"
 #include "main.h"
@@ -2116,7 +2114,7 @@ update_telemetry(__rte_unused struct rte_timer *tim,
        if (ret < 0)
                RTE_LOG(WARNING, POWER, "failed to update metrcis\n");
 }
-#ifdef RTE_LIBRTE_TELEMETRY
+
 static int
 handle_app_stats(const char *cmd __rte_unused,
                const char *params __rte_unused,
@@ -2132,7 +2130,7 @@ handle_app_stats(const char *cmd __rte_unused,
                                values[i]);
        return 0;
 }
-#endif
+
 static void
 telemetry_setup_timer(void)
 {
@@ -2532,11 +2530,9 @@ main(int argc, char **argv)
                        rte_spinlock_init(&stats[lcore_id].telemetry_lock);
                }
                rte_timer_init(&telemetry_timer);
-#ifdef RTE_LIBRTE_TELEMETRY
                rte_telemetry_register_cmd("/l3fwd-power/stats",
                                handle_app_stats,
                                "Returns global power stats. Parameters: None");
-#endif
                rte_eal_mp_remote_launch(main_telemetry_loop, NULL,
                                                SKIP_MASTER);
        }
index e7c6be6477170a11cd9d4c3b21d2615b9ae5c90c..4cd694710d2fde967f2fff14e359e77a0610b1cd 100644 (file)
@@ -12,11 +12,7 @@ if not dpdk_conf.has('RTE_LIBRTE_POWER')
 endif
 
 allow_experimental_apis = true
-deps += ['power', 'timer', 'lpm', 'hash', 'metrics']
+deps += ['power', 'timer', 'lpm', 'hash', 'metrics', 'telemetry']
 sources = files(
        'main.c', 'perf_core.c'
 )
-
-if dpdk_conf.has('RTE_LIBRTE_TELEMETRY')
-       deps += ['telemetry']
-endif
index 7d5497b5d0b55f2ba15271510895911dbf2fada8..e0e5eb4d8defd5d86c9951c761c2e3d40ccdba94 100644 (file)
@@ -4,8 +4,9 @@
 include $(RTE_SDK)/mk/rte.vars.mk
 
 DIRS-$(CONFIG_RTE_LIBRTE_KVARGS) += librte_kvargs
+DIRS-y += librte_telemetry
 DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
-DEPDIRS-librte_eal := librte_kvargs
+DEPDIRS-librte_eal := librte_kvargs librte_telemetry
 DIRS-$(CONFIG_RTE_LIBRTE_PCI) += librte_pci
 DEPDIRS-librte_pci := librte_eal
 DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
@@ -22,8 +23,6 @@ DIRS-$(CONFIG_RTE_LIBRTE_CFGFILE) += librte_cfgfile
 DEPDIRS-librte_cfgfile := librte_eal
 DIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += librte_cmdline
 DEPDIRS-librte_cmdline := librte_eal librte_net
-DIRS-$(CONFIG_RTE_LIBRTE_TELEMETRY) += librte_telemetry
-DEPDIRS-librte_telemetry := librte_eal
 DIRS-$(CONFIG_RTE_LIBRTE_ETHER) += librte_ethdev
 DEPDIRS-librte_ethdev := librte_net librte_eal librte_mempool librte_ring
 DEPDIRS-librte_ethdev += librte_mbuf
index 418731ca408766550bc68c9c1eb662071d645ac8..f44d147b4e64be1139ad30b02018f230075ce5ee 100644 (file)
@@ -93,6 +93,8 @@ eal_long_options[] = {
        {OPT_LEGACY_MEM,        0, NULL, OPT_LEGACY_MEM_NUM       },
        {OPT_SINGLE_FILE_SEGMENTS, 0, NULL, OPT_SINGLE_FILE_SEGMENTS_NUM},
        {OPT_MATCH_ALLOCATIONS, 0, NULL, OPT_MATCH_ALLOCATIONS_NUM},
+       {OPT_TELEMETRY,         0, NULL, OPT_TELEMETRY_NUM        },
+       {OPT_NO_TELEMETRY,      0, NULL, OPT_NO_TELEMETRY_NUM     },
        {0,                     0, NULL, 0                        }
 };
 
@@ -1501,6 +1503,11 @@ eal_parse_common_option(int opt, const char *optarg,
                        return -1;
                }
                break;
+       case OPT_TELEMETRY_NUM:
+               break;
+       case OPT_NO_TELEMETRY_NUM:
+               conf->no_telemetry = 1;
+               break;
 
        /* don't know what to do, leave this to caller */
        default:
@@ -1769,6 +1776,8 @@ eal_common_usage(void)
               "  --"OPT_IN_MEMORY"   Operate entirely in memory. This will\n"
               "                      disable secondary process support\n"
               "  --"OPT_BASE_VIRTADDR"     Base virtual address\n"
+              "  --"OPT_TELEMETRY"   Enable telemetry support (on by default)\n"
+              "  --"OPT_NO_TELEMETRY"   Disable telemetry support\n"
               "\nEAL options for DEBUG use only:\n"
               "  --"OPT_HUGE_UNLINK"       Unlink hugepage files after init\n"
               "  --"OPT_NO_HUGE"           Use malloc instead of hugetlbfs\n"
index a42f3492325a9f876f65b3e6fce2f4d1b6687196..c650bc0814ac0acc6098443cad331df7d18600a9 100644 (file)
@@ -82,6 +82,7 @@ struct internal_config {
        rte_cpuset_t ctrl_cpuset;         /**< cpuset for ctrl threads */
        volatile unsigned int init_complete;
        /**< indicates whether EAL has completed initialization */
+       unsigned int no_telemetry; /**< true to disable Telemetry */
 };
 extern struct internal_config internal_config; /**< Global EAL configuration. */
 
index 90ead1b7c015173af64da4352f371400782b8bd2..238eb3e44eb39ce00aab46ad3a0654e2654e6890 100644 (file)
@@ -77,6 +77,10 @@ enum {
        OPT_IOVA_MODE_NUM,
 #define OPT_MATCH_ALLOCATIONS  "match-allocations"
        OPT_MATCH_ALLOCATIONS_NUM,
+#define OPT_TELEMETRY         "telemetry"
+       OPT_TELEMETRY_NUM,
+#define OPT_NO_TELEMETRY      "no-telemetry"
+       OPT_NO_TELEMETRY_NUM,
        OPT_LONG_MAX_NUM
 };
 
index a8400f20a9cf3bd861803ef794aea137cfef0e6a..e95728e74063268a9769499ac12e8689416dcd1d 100644 (file)
@@ -18,6 +18,7 @@ LDLIBS += -lexecinfo
 LDLIBS += -lpthread
 LDLIBS += -lgcc_s
 LDLIBS += -lrte_kvargs
+LDLIBS += -lrte_telemetry
 
 EXPORT_MAP := ../rte_eal_version.map
 
index 540b7d38c5b75365cc843ddcb4aee998d71e4e3a..bc86dccc27ecbc63a39b9e866dd08ddebefc2715 100644 (file)
@@ -44,6 +44,7 @@
 #include <rte_option.h>
 #include <rte_atomic.h>
 #include <malloc_heap.h>
+#include <rte_telemetry.h>
 
 #include "eal_private.h"
 #include "eal_thread.h"
@@ -960,6 +961,14 @@ rte_eal_init(int argc, char **argv)
                rte_eal_init_alert("Cannot clear runtime directory\n");
                return -1;
        }
+       if (!internal_config.no_telemetry) {
+               const char *error_str;
+               if (rte_telemetry_init(rte_eal_get_runtime_dir(),
+                               &error_str) != 0) {
+                       rte_eal_init_alert(error_str);
+                       return -1;
+               }
+       }
 
        eal_mcfg_complete();
 
index 22fc4e80741e27e4bf68a0f778f9ba4a9186a578..e10fd8a16de01f52c3ec514afb6482dd4a56f5dc 100644 (file)
@@ -18,4 +18,4 @@ sources += files(
        'eal_timer.c',
 )
 
-deps += ['kvargs']
+deps += ['kvargs', 'telemetry']
index a77eb17570ae0bfad5f4116b6ab31ad395ad347d..be57a6d076b92f76c15dd7d395e6e32b1e725b69 100644 (file)
@@ -19,6 +19,7 @@ LDLIBS += -lpthread
 LDLIBS += -lgcc_s
 LDLIBS += -lrt
 LDLIBS += -lrte_kvargs
+LDLIBS += -lrte_telemetry
 ifeq ($(CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES),y)
 LDLIBS += -lnuma
 endif
index aa72d36509290fd8e0f8b67f117d57045e2b765a..e4086c75a9d2f10169ab7f9829192d07bfb48722 100644 (file)
@@ -51,6 +51,7 @@
 #include <malloc_heap.h>
 #include <rte_vfio.h>
 #include <rte_option.h>
+#include <rte_telemetry.h>
 
 #include "eal_private.h"
 #include "eal_thread.h"
@@ -1298,6 +1299,14 @@ rte_eal_init(int argc, char **argv)
                rte_eal_init_alert("Cannot clear runtime directory\n");
                return -1;
        }
+       if (!internal_config.no_telemetry) {
+               const char *error_str;
+               if (rte_telemetry_init(rte_eal_get_runtime_dir(),
+                               &error_str) != 0) {
+                       rte_eal_init_alert(error_str);
+                       return -1;
+               }
+       }
 
        eal_mcfg_complete();
 
index ca4f4e97852b82c14919cc0b631b85fb4dd0ce01..7742aa475969b82489140254f2c742329bb31b2f 100644 (file)
@@ -21,7 +21,7 @@ sources += files(
        'eal_vfio_mp_sync.c',
 )
 
-deps += ['kvargs']
+deps += ['kvargs', 'telemetry']
 if has_libnuma == 1
        dpdk_conf.set10('RTE_EAL_NUMA_AWARE_HUGEPAGES', true)
 endif
index 0267c3b9d8dcc320a1829038575e03ee981bf7bb..e301f45585023d369308ce351c8e7e95f54215a1 100644 (file)
@@ -11,7 +11,10 @@ subdir(exec_env)
 
 subdir(arch_subdir)
 
-deps += 'kvargs'
+deps += ['kvargs']
+if not is_windows
+       deps += ['telemetry']
+endif
 if dpdk_conf.has('RTE_USE_LIBBSD')
        ext_deps += libbsd
 endif
index 38d3d35bfe9099e476c09db3db61682c54d80ce3..47747150b26dd85623c296f3f795768a2caabb6c 100644 (file)
@@ -11,7 +11,7 @@ LIB = librte_ethdev.a
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -lrte_net -lrte_eal -lrte_mempool -lrte_ring
-LDLIBS += -lrte_mbuf -lrte_kvargs -lrte_meter
+LDLIBS += -lrte_mbuf -lrte_kvargs -lrte_meter -lrte_telemetry
 
 EXPORT_MAP := rte_ethdev_version.map
 
@@ -24,10 +24,6 @@ SRCS-y += rte_mtr.c
 SRCS-y += ethdev_profile.c
 SRCS-y += ethdev_trace_points.c
 
-ifeq ($(CONFIG_RTE_LIBRTE_TELEMETRY),y)
-LDLIBS += -lrte_telemetry
-endif
-
 #
 # Export include files
 #
index 6e0535ecfd69e9904019c6405cb0cffa83dd4587..8fc24e8c8ab8ec7246879ca8bff68fb47c501816 100644 (file)
@@ -27,8 +27,4 @@ headers = files('rte_ethdev.h',
        'rte_tm.h',
        'rte_tm_driver.h')
 
-deps += ['net', 'kvargs', 'meter']
-
-if dpdk_conf.has('RTE_LIBRTE_TELEMETRY')
-       deps += ['telemetry']
-endif
+deps += ['net', 'kvargs', 'meter', 'telemetry']
index 4cfc6d170748eebeea03cc6bd67eb45e6d416584..74e94feb0af4830167688b5930859d19064c0786 100644 (file)
@@ -38,9 +38,7 @@
 #include <rte_kvargs.h>
 #include <rte_class.h>
 #include <rte_ether.h>
-#ifdef RTE_LIBRTE_TELEMETRY
 #include <rte_telemetry.h>
-#endif
 
 #include "rte_ethdev_trace.h"
 #include "rte_ethdev.h"
@@ -5202,7 +5200,6 @@ parse_cleanup:
        return result;
 }
 
-#ifdef RTE_LIBRTE_TELEMETRY
 static int
 handle_port_list(const char *cmd __rte_unused,
                const char *params __rte_unused,
@@ -5295,14 +5292,12 @@ handle_port_link_status(const char *cmd __rte_unused,
                                "full-duplex" : "half-duplex");
        return 0;
 }
-#endif
 
 RTE_INIT(ethdev_init_log)
 {
        rte_eth_dev_logtype = rte_log_register("lib.ethdev");
        if (rte_eth_dev_logtype >= 0)
                rte_log_set_level(rte_eth_dev_logtype, RTE_LOG_INFO);
-#ifdef RTE_LIBRTE_TELEMETRY
        rte_telemetry_register_cmd("/ethdev/list", handle_port_list,
                        "Returns list of available ethdev ports. Takes no parameters");
        rte_telemetry_register_cmd("/ethdev/xstats", handle_port_xstats,
@@ -5310,5 +5305,4 @@ RTE_INIT(ethdev_init_log)
        rte_telemetry_register_cmd("/ethdev/link_status",
                        handle_port_link_status,
                        "Returns the link status for a port. Parameters: int port_id");
-#endif
 }
index 5d7c2a582d4fb1e50899a5e8424bc4d72ddb04a4..99f5d2a471f0268e0de62877159eb93b11e21c82 100644 (file)
@@ -9,11 +9,7 @@ LIB = librte_rawdev.a
 # build flags
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
-LDLIBS += -lrte_eal
-
-ifeq ($(CONFIG_RTE_LIBRTE_TELEMETRY),y)
-LDLIBS += -lrte_telemetry
-endif
+LDLIBS += -lrte_eal -lrte_telemetry
 
 # library source files
 SRCS-y += rte_rawdev.c
index 1f23d2a80c9fb6d4a6624e507016f04def3842ed..30d363cd2dcf2ac8aa0f3e925424cb0cfb82f2ec 100644 (file)
@@ -4,6 +4,4 @@
 sources = files('rte_rawdev.c')
 headers = files('rte_rawdev.h', 'rte_rawdev_pmd.h')
 
-if dpdk_conf.has('RTE_LIBRTE_TELEMETRY')
-       deps += ['telemetry']
-endif
+deps += ['telemetry']
index ee6c087b12f06a7f9e5dc2b87b0ff2e78db32054..c332a7648936d0118cd99c4997c9fb42c03697b3 100644 (file)
@@ -29,9 +29,7 @@
 #include <rte_common.h>
 #include <rte_malloc.h>
 #include <rte_errno.h>
-#ifdef RTE_LIBRTE_TELEMETRY
 #include <rte_telemetry.h>
-#endif
 
 #include "rte_rawdev.h"
 #include "rte_rawdev_pmd.h"
@@ -547,7 +545,6 @@ rte_rawdev_pmd_release(struct rte_rawdev *rawdev)
        return 0;
 }
 
-#ifdef RTE_LIBRTE_TELEMETRY
 static int
 handle_dev_list(const char *cmd __rte_unused,
                const char *params __rte_unused,
@@ -615,17 +612,14 @@ handle_dev_xstats(const char *cmd __rte_unused,
        free(rawdev_xstats);
        return 0;
 }
-#endif
 
 RTE_INIT(librawdev_init_log)
 {
        librawdev_logtype = rte_log_register("lib.rawdev");
        if (librawdev_logtype >= 0)
                rte_log_set_level(librawdev_logtype, RTE_LOG_INFO);
-#ifdef RTE_LIBRTE_TELEMETRY
        rte_telemetry_register_cmd("/rawdev/list", handle_dev_list,
                        "Returns list of available rawdev ports. Takes no parameters");
        rte_telemetry_register_cmd("/rawdev/xstats", handle_dev_xstats,
                        "Returns the xstats for a rawdev port. Parameters: int port_id");
-#endif
 }
index 0dce053aeb85847c81dd3cc140ea09ce85c7ca36..29115ba7920a0d4ecc6ca61b2a3eef4ed0a7479c 100644 (file)
@@ -13,17 +13,16 @@ CFLAGS += -I$(RTE_SDK)/lib/librte_eal/include
 CFLAGS += -I$(RTE_SDK)/lib/librte_eal/$(ARCH_DIR)/include
 CFLAGS += -pthread
 
-LDLIBS += -lrte_eal
 LDLIBS += -lpthread
 
 EXPORT_MAP := rte_telemetry_version.map
 
 # library source files
-SRCS-$(CONFIG_RTE_LIBRTE_TELEMETRY) += telemetry.c
-SRCS-$(CONFIG_RTE_LIBRTE_TELEMETRY) += telemetry_data.c
-SRCS-$(CONFIG_RTE_LIBRTE_TELEMETRY) += telemetry_legacy.c
+SRCS-y += telemetry.c
+SRCS-y += telemetry_data.c
+SRCS-y += telemetry_legacy.c
 
 # export include files
-SYMLINK-$(CONFIG_RTE_LIBRTE_TELEMETRY)-include := rte_telemetry.h
+SYMLINK-y-include := rte_telemetry.h
 
 include $(RTE_SDK)/mk/rte.lib.mk
index f0af11a4cefed2e4d3cb5e06628fae9faefef21f..719973ff924094d4b5ebcf13fded51e43ac3acb0 100644 (file)
@@ -6,4 +6,3 @@ includes = [global_inc]
 sources = files('telemetry.c', 'telemetry_data.c', 'telemetry_legacy.c')
 headers = files('rte_telemetry.h')
 includes += include_directories('../librte_metrics')
-dpdk_app_link_libraries += ['telemetry']
index de99e83163dc2a146c93a3ab91c3b87d5aefd548..1965affba3aae4af8394f2b69310e14c58606bbe 100644 (file)
@@ -250,5 +250,6 @@ rte_telemetry_register_cmd(const char *cmd, telemetry_cb fn, const char *help);
  */
 __rte_experimental
 int
-rte_telemetry_init(void);
+rte_telemetry_init(const char *runtime_dir, const char **err_str);
+
 #endif
index 3614d6a412c4519db05786cf24f498c30e5bc6e1..9a1e9454553aad768a6795e9ddb4327f3328f449 100644 (file)
@@ -14,7 +14,6 @@
 #include <rte_common.h>
 #include <rte_spinlock.h>
 #include <rte_version.h>
-#include <rte_option.h>
 
 #include "rte_telemetry.h"
 #include "telemetry_json.h"
@@ -397,28 +396,16 @@ telemetry_v2_init(const char *runtime_dir)
 }
 
 int32_t
-rte_telemetry_init(void)
+rte_telemetry_init(const char *runtime_dir, const char **err_str)
 {
-       const char *error_str;
-       if (telemetry_v2_init(rte_eal_get_runtime_dir()) != 0) {
-               error_str = telemetry_log_error;
-               printf("Error initialising telemetry - %s", error_str);
+       if (telemetry_v2_init(runtime_dir) != 0) {
+               *err_str = telemetry_log_error;
+               printf("Error initialising telemetry - %s", *err_str);
                return -1;
        }
-       if (telemetry_legacy_init(rte_eal_get_runtime_dir()) != 0) {
-               error_str = telemetry_log_error;
-               printf("No telemetry legacy support- %s", error_str);
+       if (telemetry_legacy_init(runtime_dir) != 0) {
+               *err_str = telemetry_log_error;
+               printf("No telemetry legacy support- %s", *err_str);
        }
        return 0;
 }
-
-static struct rte_option option = {
-       .name = "telemetry",
-       .usage = "Enable telemetry backend",
-       .cb = &rte_telemetry_init,
-       .enabled = 0
-};
-
-RTE_INIT(telemetry_register_op) {
-       rte_option_register(&option);
-}
index 2ea22125ef6553530f965650acf09c811a673b24..d190d84effafe6c239743d1438d0ac00e44a426c 100644 (file)
@@ -10,8 +10,8 @@
 # core libs which are widely reused, so their deps are kept to a minimum.
 libraries = [
        'kvargs', # eal depends on kvargs
+       'telemetry', # basic info querying
        'eal', # everything depends on eal
-       'telemetry',
        'ring',
        'rcu', # rcu depends on ring
        'mempool', 'mbuf', 'net', 'meter', 'ethdev', 'pci', # core
index d9f09ae51ac2aa0417e4dab002d73735e26301ad..0ce8cf5417bc817986a311379a80b59512247b89 100644 (file)
@@ -52,6 +52,9 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_ACL)            += -lrte_acl
 _LDLIBS-$(CONFIG_RTE_LIBRTE_JOBSTATS)       += -lrte_jobstats
 _LDLIBS-$(CONFIG_RTE_LIBRTE_METRICS)        += --whole-archive
 _LDLIBS-$(CONFIG_RTE_LIBRTE_METRICS)        += -lrte_metrics
+ifeq ($(CONFIG_RTE_LIBRTE_TELEMETRY),y)
+_LDLIBS-$(CONFIG_RTE_LIBRTE_METRICS)        += -ljansson
+endif
 _LDLIBS-$(CONFIG_RTE_LIBRTE_METRICS)        += --no-whole-archive
 _LDLIBS-$(CONFIG_RTE_LIBRTE_BITRATE)        += -lrte_bitratestats
 _LDLIBS-$(CONFIG_RTE_LIBRTE_LATENCY_STATS)  += -lrte_latencystats
@@ -74,6 +77,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_HASH)           += -lrte_hash
 _LDLIBS-$(CONFIG_RTE_LIBRTE_MEMBER)         += -lrte_member
 _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST)          += -lrte_vhost
 _LDLIBS-$(CONFIG_RTE_LIBRTE_KVARGS)         += -lrte_kvargs
+_LDLIBS-y                                   += -lrte_telemetry
 _LDLIBS-$(CONFIG_RTE_LIBRTE_MBUF)           += -lrte_mbuf
 _LDLIBS-$(CONFIG_RTE_LIBRTE_NET)            += -lrte_net
 _LDLIBS-$(CONFIG_RTE_LIBRTE_ETHER)          += -lrte_ethdev
@@ -90,7 +94,6 @@ _LDLIBS-$(CONFIG_RTE_DRIVER_MEMPOOL_RING)   += -lrte_mempool_ring
 _LDLIBS-$(CONFIG_RTE_LIBRTE_OCTEONTX2_MEMPOOL) += -lrte_mempool_octeontx2
 _LDLIBS-$(CONFIG_RTE_LIBRTE_RING)           += -lrte_ring
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PCI)            += -lrte_pci
-_LDLIBS-$(CONFIG_RTE_LIBRTE_TELEMETRY)      += -lrte_telemetry -ljansson
 _LDLIBS-$(CONFIG_RTE_LIBRTE_EAL)            += -lrte_eal
 _LDLIBS-$(CONFIG_RTE_LIBRTE_CMDLINE)        += -lrte_cmdline
 _LDLIBS-$(CONFIG_RTE_LIBRTE_REORDER)        += -lrte_reorder