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 6BB25A0C41; Wed, 17 Nov 2021 12:30:45 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 630D441C3D; Wed, 17 Nov 2021 12:30:43 +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 8B8CF41C3C for ; Wed, 17 Nov 2021 12:30:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637148641; 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=wEHJIWnfDNLNULCIBwcJTVlsPJmicZ2i6+D6hnA7DRQ=; b=hQu/7ei5sWxXRGbD500Kb7YUKpWA0yDt2c6nqZlvIZFRGZVo5aRWeV5KAvG8kOCCuxaoxt y5K8y1WyonkfvlwcJnWKo1l1IujR/Nz5lcW1zThpnQSTAu/qwnDKoFPeMzNTgkC1TpVCgP gZuPZuCIAeG8Rgcsbn0C//SqvRvCJp4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-103-MN8zyPByMxaucfzkmMIsWA-1; Wed, 17 Nov 2021 06:30:39 -0500 X-MC-Unique: MN8zyPByMxaucfzkmMIsWA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 150CBEC1A0; Wed, 17 Nov 2021 11:30:38 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.192.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 52E9B1F452; Wed, 17 Nov 2021 11:30:34 +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 v2 3/5] build: make metrics libraries optional Date: Wed, 17 Nov 2021 12:28:45 +0100 Message-Id: <20211117112847.7362-4-david.marchand@redhat.com> In-Reply-To: <20211117112847.7362-1-david.marchand@redhat.com> References: <20211110164814.5231-1-david.marchand@redhat.com> <20211117112847.7362-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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 Acked-by: Bruce Richardson Acked-by: Thomas Monjalon --- 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 #include #include +#ifdef RTE_LIB_METRICS #include +#endif #include #ifdef RTE_LIB_SECURITY #include @@ -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 #endif #include +#ifdef RTE_LIB_METRICS #include +#endif #ifdef RTE_LIB_BITRATESTATS #include #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