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 A1B86A034F; Wed, 10 Nov 2021 17:49:05 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8DB444115C; Wed, 10 Nov 2021 17:49:05 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 608004114E for ; Wed, 10 Nov 2021 17:49:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636562943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3fWsxBn4/sMMl1MpeKR1R8XcJHdm4cmn1tqnqv1Hy0w=; b=G/BXkgbb9N+LMAPp0VutQEq3/HNyRGR2Jb3BKm8JLtQJiAh//53qljsFVF5gh+2PWOFKg9 CRmCNLKT7v3yOO1wKC2/9JdvW/vbd50SBhMFGA76Mww+xLQXrDfWjjEUdXzF+hiN/VH1LD UkFM7nPDCFNaphdcr3/MzjrOpEwAK00= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-361-z4TBiDlcMnyvp9aUIrbGiQ-1; Wed, 10 Nov 2021 11:49:00 -0500 X-MC-Unique: z4TBiDlcMnyvp9aUIrbGiQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E3763101F7B1; Wed, 10 Nov 2021 16:48:58 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.192.42]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA72360854; Wed, 10 Nov 2021 16:48:54 +0000 (UTC) From: David Marchand 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 , Reshma Pattan , Xiaoyun Li Subject: [PATCH 3/5] build: make metrics libraries optional Date: Wed, 10 Nov 2021 17:48:12 +0100 Message-Id: <20211110164814.5231-4-david.marchand@redhat.com> In-Reply-To: <20211110164814.5231-1-david.marchand@redhat.com> References: <20211110164814.5231-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" 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 metrics, bitratestats, jobstats and latencystats libraries can be made optional as they provide standalone features. Signed-off-by: David Marchand --- 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 a4271047e6..19223d034c 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -30,7 +30,9 @@ #include #include #include +#ifdef RTE_LIB_METRICS #include +#endif #include #ifdef RTE_LIB_SECURITY #include @@ -59,8 +61,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. */ @@ -108,8 +112,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" @@ -218,7 +224,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}, @@ -260,10 +268,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)) @@ -593,6 +603,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) { @@ -653,6 +664,7 @@ metrics_display(int port_id) rte_free(metrics); rte_free(names); } +#endif static void show_security_context(uint16_t portid, bool inline_offload) @@ -1522,14 +1534,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 e2998b066b..73b8ba7236 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -55,7 +55,9 @@ #include #endif #include +#ifdef RTE_LIB_METRICS #include +#endif #ifdef RTE_LIB_BITRATESTATS #include #endif @@ -4231,8 +4233,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 a968abac76..b5f1a89edf 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', @@ -281,7 +277,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], @@ -378,6 +373,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]] @@ -399,16 +399,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