From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: bruce.richardson@intel.com, thomas@monjalon.net,
bluca@debian.org, tredaelli@redhat.com, i.maximets@ovn.org,
james.r.harris@intel.com, mohammed@hawari.fr,
Maryam Tahhan <maryam.tahhan@intel.com>,
Reshma Pattan <reshma.pattan@intel.com>,
Xiaoyun Li <xiaoyun.li@intel.com>
Subject: [PATCH v2 3/5] build: make metrics libraries optional
Date: Wed, 17 Nov 2021 12:28:45 +0100 [thread overview]
Message-ID: <20211117112847.7362-4-david.marchand@redhat.com> (raw)
In-Reply-To: <20211117112847.7362-1-david.marchand@redhat.com>
metrics, bitratestats, jobstats and latencystats libraries can be made
optional as they provide standalone features.
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
app/proc-info/main.c | 16 ++++++++++++++++
app/proc-info/meson.build | 5 ++++-
app/test-pmd/meson.build | 5 ++++-
app/test-pmd/testpmd.c | 4 ++++
app/test/meson.build | 24 +++++++++++++++---------
lib/meson.build | 4 ++++
6 files changed, 47 insertions(+), 11 deletions(-)
diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index ebe2d77264..ce140aaf84 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -29,7 +29,9 @@
#include <rte_log.h>
#include <rte_branch_prediction.h>
#include <rte_string_fns.h>
+#ifdef RTE_LIB_METRICS
#include <rte_metrics.h>
+#endif
#include <rte_cycles.h>
#ifdef RTE_LIB_SECURITY
#include <rte_security.h>
@@ -58,8 +60,10 @@ static uint32_t enable_collectd_format;
static int stdout_fd;
/**< Host id process is running on */
static char host_id[MAX_LONG_OPT_SZ];
+#ifdef RTE_LIB_METRICS
/**< Enable metrics. */
static uint32_t enable_metrics;
+#endif
/**< Enable stats reset. */
static uint32_t reset_stats;
/**< Enable xstats reset. */
@@ -107,8 +111,10 @@ proc_info_usage(const char *prgname)
" --stats: to display port statistics, enabled by default\n"
" --xstats: to display extended port statistics, disabled by "
"default\n"
+#ifdef RTE_LIB_METRICS
" --metrics: to display derived metrics of the ports, disabled by "
"default\n"
+#endif
" --xstats-name NAME: to display single xstat id by NAME\n"
" --xstats-ids IDLIST: to display xstat values by id. "
"The argument is comma-separated list of xstat ids to print out.\n"
@@ -217,7 +223,9 @@ proc_info_parse_args(int argc, char **argv)
{"stats", 0, NULL, 0},
{"stats-reset", 0, NULL, 0},
{"xstats", 0, NULL, 0},
+#ifdef RTE_LIB_METRICS
{"metrics", 0, NULL, 0},
+#endif
{"xstats-reset", 0, NULL, 0},
{"xstats-name", required_argument, NULL, 1},
{"collectd-format", 0, NULL, 0},
@@ -259,10 +267,12 @@ proc_info_parse_args(int argc, char **argv)
else if (!strncmp(long_option[option_index].name, "xstats",
MAX_LONG_OPT_SZ))
enable_xstats = 1;
+#ifdef RTE_LIB_METRICS
else if (!strncmp(long_option[option_index].name,
"metrics",
MAX_LONG_OPT_SZ))
enable_metrics = 1;
+#endif
/* Reset stats */
if (!strncmp(long_option[option_index].name, "stats-reset",
MAX_LONG_OPT_SZ))
@@ -592,6 +602,7 @@ nic_xstats_clear(uint16_t port_id)
printf("\n NIC extended statistics for port %d cleared\n", port_id);
}
+#ifdef RTE_LIB_METRICS
static void
metrics_display(int port_id)
{
@@ -652,6 +663,7 @@ metrics_display(int port_id)
rte_free(metrics);
rte_free(names);
}
+#endif
static void
show_security_context(uint16_t portid, bool inline_offload)
@@ -1521,14 +1533,18 @@ main(int argc, char **argv)
else if (nb_xstats_ids > 0)
nic_xstats_by_ids_display(i, xstats_ids,
nb_xstats_ids);
+#ifdef RTE_LIB_METRICS
else if (enable_metrics)
metrics_display(i);
+#endif
}
+#ifdef RTE_LIB_METRICS
/* print port independent stats */
if (enable_metrics)
metrics_display(RTE_METRICS_GLOBAL);
+#endif
/* show information for PMD */
if (enable_shw_port)
diff --git a/app/proc-info/meson.build b/app/proc-info/meson.build
index 1062e0ef86..1563ce656a 100644
--- a/app/proc-info/meson.build
+++ b/app/proc-info/meson.build
@@ -8,4 +8,7 @@ if is_windows
endif
sources = files('main.c')
-deps += ['ethdev', 'metrics', 'security']
+deps += ['ethdev', 'security']
+if dpdk_conf.has('RTE_LIB_METRICS')
+ deps += 'metrics'
+endif
diff --git a/app/test-pmd/meson.build b/app/test-pmd/meson.build
index eba03b572c..43130c8856 100644
--- a/app/test-pmd/meson.build
+++ b/app/test-pmd/meson.build
@@ -32,7 +32,7 @@ if dpdk_conf.has('RTE_HAS_JANSSON')
ext_deps += jansson_dep
endif
-deps += ['ethdev', 'cmdline', 'metrics', 'bus_pci']
+deps += ['ethdev', 'cmdline', 'bus_pci']
if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
deps += 'crypto_scheduler'
endif
@@ -52,6 +52,9 @@ endif
if dpdk_conf.has('RTE_LIB_LATENCYSTATS')
deps += 'latencystats'
endif
+if dpdk_conf.has('RTE_LIB_METRICS')
+ deps += 'metrics'
+endif
if dpdk_conf.has('RTE_LIB_PDUMP')
deps += 'pdump'
endif
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index f74ba61be6..ba65342b6d 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -54,7 +54,9 @@
#include <rte_pdump.h>
#endif
#include <rte_flow.h>
+#ifdef RTE_LIB_METRICS
#include <rte_metrics.h>
+#endif
#ifdef RTE_LIB_BITRATESTATS
#include <rte_bitrate.h>
#endif
@@ -4242,8 +4244,10 @@ main(int argc, char** argv)
port_id, rte_strerror(-ret));
}
+#ifdef RTE_LIB_METRICS
/* Init metrics library */
rte_metrics_init(rte_socket_id());
+#endif
#ifdef RTE_LIB_LATENCYSTATS
if (latencystats_enabled != 0) {
diff --git a/app/test/meson.build b/app/test/meson.build
index 2191a5e146..0d261b1138 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -98,7 +98,6 @@ test_sources = files(
'test_mempool_perf.c',
'test_memzone.c',
'test_meter.c',
- 'test_metrics.c',
'test_mcslock.c',
'test_mp_secondary.c',
'test_per_lcore.c',
@@ -162,7 +161,6 @@ test_deps = [
'acl',
'bus_pci',
'bus_vdev',
- 'bitratestats',
'bpf',
'cfgfile',
'cmdline',
@@ -177,10 +175,8 @@ test_deps = [
'graph',
'hash',
'ipsec',
- 'latencystats',
'lpm',
'member',
- 'metrics',
'node',
'pipeline',
'port',
@@ -280,7 +276,6 @@ fast_tests = [
['kni_autotest', false],
['kvargs_autotest', true],
['member_autotest', true],
- ['metrics_autotest', true],
['power_cpufreq_autotest', false],
['power_autotest', true],
['power_kvm_vm_autotest', false],
@@ -385,6 +380,11 @@ endif
if dpdk_conf.has('RTE_EVENT_SKELETON')
test_deps += 'event_skeleton'
endif
+if dpdk_conf.has('RTE_LIB_METRICS')
+ test_deps += 'metrics'
+ test_sources += ['test_metrics.c']
+ fast_tests += [['metrics_autotest', true]]
+endif
if dpdk_conf.has('RTE_LIB_TELEMETRY')
test_sources += ['test_telemetry_json.c', 'test_telemetry_data.c']
fast_tests += [['telemetry_json_autotest', true], ['telemetry_data_autotest', true]]
@@ -406,16 +406,22 @@ if dpdk_conf.has('RTE_NET_RING')
test_sources += 'test_pmd_ring_perf.c'
test_sources += 'test_pmd_ring.c'
test_sources += 'test_event_eth_tx_adapter.c'
- test_sources += 'test_bitratestats.c'
- test_sources += 'test_latencystats.c'
test_sources += 'sample_packet_forward.c'
test_sources += 'test_pdump.c'
fast_tests += [['ring_pmd_autotest', true]]
perf_test_names += 'ring_pmd_perf_autotest'
fast_tests += [['event_eth_tx_adapter_autotest', false]]
- fast_tests += [['bitratestats_autotest', true]]
- fast_tests += [['latencystats_autotest', true]]
fast_tests += [['pdump_autotest', true]]
+ if dpdk_conf.has('RTE_LIB_BITRATESTATS')
+ test_deps += 'bitratestats'
+ test_sources += 'test_bitratestats.c'
+ fast_tests += [['bitratestats_autotest', true]]
+ endif
+ if dpdk_conf.has('RTE_LIB_LATENCYSTATS')
+ test_deps += 'latencystats'
+ test_sources += 'test_latencystats.c'
+ fast_tests += [['latencystats_autotest', true]]
+ endif
endif
if dpdk_conf.has('RTE_HAS_LIBPCAP')
diff --git a/lib/meson.build b/lib/meson.build
index 2766c02bd2..961b95f4ad 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -66,9 +66,13 @@ libraries = [
]
optional_libs = [
+ 'bitratestats',
'gro',
'gso',
'kni',
+ 'jobstats',
+ 'latencystats',
+ 'metrics',
'power',
'vhost',
]
--
2.23.0
next prev parent reply other threads:[~2021-11-17 11:30 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-10 16:48 [PATCH 0/5] Extend optional libraries list David Marchand
2021-11-10 16:48 ` [PATCH 1/5] ci: test build with minimum configuration David Marchand
2021-11-16 17:06 ` Thomas Monjalon
2021-11-16 20:39 ` David Marchand
2021-11-16 21:47 ` Thomas Monjalon
2021-11-10 16:48 ` [PATCH 2/5] build: make GRO/GSO optional David Marchand
2021-11-16 17:11 ` Thomas Monjalon
2021-11-10 16:48 ` [PATCH 3/5] build: make metrics libraries optional David Marchand
2021-11-16 17:12 ` Thomas Monjalon
2021-11-10 16:48 ` [PATCH 4/5] build: make pdump optional David Marchand
2021-11-16 17:14 ` Thomas Monjalon
2021-11-10 16:48 ` [PATCH 5/5] build: select optional libraries David Marchand
2021-11-10 17:34 ` Bruce Richardson
2021-11-16 17:25 ` Thomas Monjalon
2021-11-17 10:47 ` Bruce Richardson
2021-11-17 11:27 ` David Marchand
2022-01-07 16:13 ` Morten Brørup
2022-01-07 16:47 ` Stephen Hemminger
2021-11-10 17:34 ` [PATCH 0/5] Extend optional libraries list Bruce Richardson
2021-11-17 11:28 ` [PATCH v2 " David Marchand
2021-11-17 11:28 ` [PATCH v2 1/5] ci: test minimum configuration David Marchand
2021-11-17 11:50 ` Thomas Monjalon
2021-11-17 13:38 ` Aaron Conole
2021-11-17 11:28 ` [PATCH v2 2/5] build: make GRO/GSO optional David Marchand
2021-11-17 11:28 ` David Marchand [this message]
2021-11-17 11:28 ` [PATCH v2 4/5] build: make pdump optional David Marchand
2021-11-17 11:28 ` [PATCH v2 5/5] build: select optional libraries David Marchand
2023-06-16 7:14 ` [PATCH v3] " David Marchand
2023-06-16 9:42 ` Bruce Richardson
2023-06-19 8:00 ` David Marchand
2023-06-19 14:11 ` David Marchand
2023-06-19 14:26 ` Bruce Richardson
2023-06-20 8:31 ` David Marchand
2023-06-20 8:35 ` Bruce Richardson
2023-06-20 8:38 ` David Marchand
2023-06-20 8:44 ` Bruce Richardson
2023-06-20 8:48 ` David Marchand
2023-06-20 9:03 ` Bruce Richardson
2023-06-20 14:33 ` Thomas Monjalon
2023-06-20 14:40 ` Bruce Richardson
2023-06-20 15:01 ` Bruce Richardson
2023-06-21 9:54 ` David Marchand
2023-06-21 10:49 ` Bruce Richardson
2023-06-21 11:35 ` Morten Brørup
2023-06-22 9:27 ` Juraj Linkeš
2023-06-21 17:00 ` [PATCH v4 0/4] Select " David Marchand
2023-06-21 17:00 ` [PATCH v4 1/4] kni: move IOVA build check David Marchand
2023-06-22 8:37 ` Bruce Richardson
2023-06-21 17:00 ` [PATCH v4 2/4] build: rename enabled libraries list David Marchand
2023-06-22 8:38 ` Bruce Richardson
2023-06-21 17:00 ` [PATCH v4 3/4] build: select deprecated libraries David Marchand
2023-06-22 8:43 ` Bruce Richardson
2023-06-22 8:50 ` Bruce Richardson
2023-06-23 9:35 ` David Marchand
2023-06-23 11:04 ` Bruce Richardson
2023-06-23 11:15 ` Morten Brørup
2023-06-23 11:19 ` Bruce Richardson
2023-06-23 11:32 ` Morten Brørup
2023-06-28 12:10 ` David Marchand
2023-06-21 17:00 ` [PATCH v4 4/4] build: select optional libraries David Marchand
2023-06-22 8:49 ` Bruce Richardson
2023-06-22 9:09 ` [PATCH v4 0/4] Select " Bruce Richardson
2023-06-22 16:41 ` Thomas Monjalon
2023-06-28 13:20 ` [PATCH v5 0/2] " David Marchand
2023-06-28 13:20 ` [PATCH v5 1/2] build: select deprecated libraries David Marchand
2023-06-29 12:44 ` Aaron Conole
2023-06-28 13:20 ` [PATCH v5 2/2] build: select optional libraries David Marchand
2023-06-28 14:48 ` [PATCH v5 0/2] Select " Morten Brørup
2023-07-17 12:54 ` Bruce Richardson
2021-11-17 11:52 ` [PATCH v2 0/5] Extend optional libraries list Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211117112847.7362-4-david.marchand@redhat.com \
--to=david.marchand@redhat.com \
--cc=bluca@debian.org \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=i.maximets@ovn.org \
--cc=james.r.harris@intel.com \
--cc=maryam.tahhan@intel.com \
--cc=mohammed@hawari.fr \
--cc=reshma.pattan@intel.com \
--cc=thomas@monjalon.net \
--cc=tredaelli@redhat.com \
--cc=xiaoyun.li@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).