From patchwork Thu Oct 5 10:00:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 114869 Delivered-To: patch@linaro.org Received: by 10.80.163.170 with SMTP id s39csp47666edb; Thu, 5 Oct 2017 03:03:10 -0700 (PDT) X-Google-Smtp-Source: AOwi7QC95KGwT+h+Y56Ghep1qcWQajFB8bUzVvusSsorXWG8jcSG2atiDC2GDDAdIJ+fwCm7p3ch X-Received: by 10.107.149.143 with SMTP id x137mr38399181iod.266.1507197789882; Thu, 05 Oct 2017 03:03:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507197789; cv=none; d=google.com; s=arc-20160816; b=hDK7Mi3g8bpddE/JoXikFLWDGxyq4VZDLvgjsSxafHWwleXfxBGxHG8W2BCEThvwu8 5Igy8BtXrPZLrdvk1orEOZzIzWP2/B+Ps5ziO8isnVEFd4kXoikHX44G8gKFs9mAMdea eZuKbMk2ghFeNuFhc/1HLym9reHG4k0Uy4c86jh0qWnxhxUi5v8a4UrVh1Js8YigYdWx YN/AatuResM+XMpX1hOJECp/hh6o/c+kgSXGCDWc/nH47ESTvpkjI197H5xNR+Ie0a+y zg5o/g/rvsmJVHG4sGrtOFE4hKoM8kxTQG1c74KkWaT94lUp8AP6L9eXHpA26WWPjWU2 hoLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=2d4TOhMy0p6tSM/16WaQXUPSfFxcWFDSwPdg/yEL1eg=; b=T4BVHUhOUIVXXIFsgqtF1N9njHiTTz2fEwdi6qpsJWg/8Zf6I3dvvL9Wrpt6bxPteR O6sl9+0p7M3TSF5OCpnoW10Zg0fNYxgSlEUML/Zn15JjNLws+SPhNmKeKW9m2aZvTD01 HXihr8PkYAEP1onscJv/8e0AQ8xPejdrC/RCHpuwyA7mLZwoDDheu+bKqItEoPWd6O4B 7Gz5Rv40P/CExYOnW+/Vvi3JGMqxchXICdea0kgdx6Y/tA4ajobhreiWmD3lRJ9jKF1j Hnt5lX4c5kLhu6q21k2SXFrWR3M/zUgFx1eqZpGu5bfknTdtLiL5gHMFQMpKEV5CIxUW tYdg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id o187si14647913iof.95.2017.10.05.03.03.09; Thu, 05 Oct 2017 03:03:09 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 729D76486B; Thu, 5 Oct 2017 10:03:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id C75056449C; Thu, 5 Oct 2017 10:00:45 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 0237460C4F; Thu, 5 Oct 2017 10:00:28 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id 17428609AC for ; Thu, 5 Oct 2017 10:00:13 +0000 (UTC) Received: from mxback5g.mail.yandex.net (mxback5g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:166]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 6EB4A5105CAA for ; Thu, 5 Oct 2017 13:00:11 +0300 (MSK) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [2a02:6b8:0:1a2d::25]) by mxback5g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id EWQi1uIXyL-0BnGUIi7; Thu, 05 Oct 2017 13:00:11 +0300 Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id f4ZGI2XrWD-0Aa42dji; Thu, 05 Oct 2017 13:00:10 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 5 Oct 2017 13:00:06 +0300 Message-Id: <1507197606-6062-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1507197606-6062-1-git-send-email-odpbot@yandex.ru> References: <1507197606-6062-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 216 Subject: [lng-odp] [PATCH v1 1/1] linux-gen: Cleanup on printing system information X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Ilias Apalodimas Use unified odp_sys_info_print() instead of copying the same code on every example. Signed-off-by: Ilias Apalodimas --- /** Email created from pull request 216 (apalos:cleanup) ** https://github.com/Linaro/odp/pull/216 ** Patch: https://github.com/Linaro/odp/pull/216.patch ** Base sha: 52cfe7ba6d2541cf5ee464e46e91b2da5efe1497 ** Merge commit sha: c41a0d41f3a3312fa8c90dbf063ab0c55f64aab0 **/ example/classifier/odp_classifier.c | 13 +------------ example/generator/odp_generator.c | 12 +----------- example/ipsec/odp_ipsec.c | 12 +----------- example/l3fwd/odp_l3fwd.c | 14 +------------- example/packet/odp_pktio.c | 12 +----------- example/switch/odp_switch.c | 14 +------------- example/timer/odp_timer_test.c | 10 +--------- test/common_plat/performance/odp_bench_packet.c | 14 +------------- test/common_plat/performance/odp_l2fwd.c | 14 +------------- test/common_plat/performance/odp_pktio_ordered.c | 14 +------------- test/common_plat/performance/odp_scheduling.c | 12 +----------- test/linux-generic/pktio_ipc/ipc_common.c | 8 +------- 12 files changed, 12 insertions(+), 137 deletions(-) diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c index d67fe5ace..5644df96d 100644 --- a/example/classifier/odp_classifier.c +++ b/example/classifier/odp_classifier.c @@ -879,18 +879,7 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) */ static void print_info(char *progname, appl_args_t *appl_args) { - printf("\n" - "ODP system info\n" - "---------------\n" - "ODP API version: %s\n" - "CPU model: %s\n" - "CPU freq (hz): %"PRIu64"\n" - "Cache line size: %i\n" - "CPU count: %i\n" - "\n", - odp_version_api_str(), odp_cpu_model_str(), - odp_cpu_hz_max(), odp_sys_cache_line_size(), - odp_cpu_count()); + odp_sys_info_print(); printf("Running ODP appl: \"%s\"\n" "-----------------\n" diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index cc07cf1d7..53b397b33 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -1480,17 +1480,7 @@ static void print_info(char *progname, appl_args_t *appl_args) { int i; - printf("\n" - "ODP system info\n" - "---------------\n" - "ODP API version: %s\n" - "CPU model: %s\n" - "CPU freq (hz): %"PRIu64"\n" - "Cache line size: %i\n" - "CPU count: %i\n" - "\n", - odp_version_api_str(), odp_cpu_model_str(), odp_cpu_hz_max(), - odp_sys_cache_line_size(), odp_cpu_count()); + odp_sys_info_print(); printf("Running ODP appl: \"%s\"\n" "-----------------\n" diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index 9ed3aa201..59c3fa817 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -1540,17 +1540,7 @@ static void print_info(char *progname, appl_args_t *appl_args) { int i; - printf("\n" - "ODP system info\n" - "---------------\n" - "ODP API version: %s\n" - "CPU model: %s\n" - "CPU freq (hz): %"PRIu64"\n" - "Cache line size: %i\n" - "CPU count: %i\n" - "\n", - odp_version_api_str(), odp_cpu_model_str(), odp_cpu_hz_max(), - odp_sys_cache_line_size(), odp_cpu_count()); + odp_sys_info_print(); printf("Running ODP appl: \"%s\"\n" "-----------------\n" diff --git a/example/l3fwd/odp_l3fwd.c b/example/l3fwd/odp_l3fwd.c index f579d36d3..d7af4491b 100644 --- a/example/l3fwd/odp_l3fwd.c +++ b/example/l3fwd/odp_l3fwd.c @@ -652,19 +652,7 @@ static void print_info(char *progname, app_args_t *args) { int i; - printf("\n" - "ODP system info\n" - "---------------\n" - "ODP API version: %s\n" - "ODP impl name: %s\n" - "CPU model: %s\n" - "CPU freq (hz): %" PRIu64 "\n" - "Cache line size: %i\n" - "CPU count: %i\n" - "\n", - odp_version_api_str(), odp_version_impl_name(), - odp_cpu_model_str(), odp_cpu_hz_max(), - odp_sys_cache_line_size(), odp_cpu_count()); + odp_sys_info_print(); printf("Running ODP appl: \"%s\"\n" "-----------------\n" diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c index ea8428259..14466fd60 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -673,17 +673,7 @@ static void print_info(char *progname, appl_args_t *appl_args) { int i; - printf("\n" - "ODP system info\n" - "---------------\n" - "ODP API version: %s\n" - "CPU model: %s\n" - "CPU freq (hz): %"PRIu64"\n" - "Cache line size: %i\n" - "CPU count: %i\n" - "\n", - odp_version_api_str(), odp_cpu_model_str(), odp_cpu_hz_max(), - odp_sys_cache_line_size(), odp_cpu_count()); + odp_sys_info_print(); printf("Running ODP appl: \"%s\"\n" "-----------------\n" diff --git a/example/switch/odp_switch.c b/example/switch/odp_switch.c index 5bec6a043..be4830998 100644 --- a/example/switch/odp_switch.c +++ b/example/switch/odp_switch.c @@ -847,19 +847,7 @@ static void print_info(char *progname, appl_args_t *appl_args) { unsigned i; - printf("\n" - "ODP system info\n" - "---------------\n" - "ODP API version: %s\n" - "ODP impl name: %s\n" - "CPU model: %s\n" - "CPU freq (hz): %" PRIu64 "\n" - "Cache line size: %i\n" - "CPU count: %i\n" - "\n", - odp_version_api_str(), odp_version_impl_name(), - odp_cpu_model_str(), odp_cpu_hz_max(), - odp_sys_cache_line_size(), odp_cpu_count()); + odp_sys_info_print(); printf("Running ODP appl: \"%s\"\n" "-----------------\n" diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 2196b8c1f..731ae8521 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -363,15 +363,7 @@ int main(int argc, char *argv[]) } printf("\n"); - printf("ODP system info\n"); - printf("---------------\n"); - printf("ODP API version: %s\n", odp_version_api_str()); - printf("CPU model: %s\n", odp_cpu_model_str()); - printf("CPU freq (hz): %"PRIu64"\n", odp_cpu_hz_max()); - printf("Cache line size: %i\n", odp_sys_cache_line_size()); - printf("Max CPU count: %i\n", odp_cpu_count()); - - printf("\n"); + odp_sys_info_print(); /* Reserve memory for test_globals_t from shared mem */ shm = odp_shm_reserve("shm_test_globals", sizeof(test_globals_t), diff --git a/test/common_plat/performance/odp_bench_packet.c b/test/common_plat/performance/odp_bench_packet.c index 327b9b2c3..622245ffb 100644 --- a/test/common_plat/performance/odp_bench_packet.c +++ b/test/common_plat/performance/odp_bench_packet.c @@ -1372,19 +1372,7 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) */ static void print_info(char *progname, appl_args_t *appl_args ODP_UNUSED) { - printf("\n" - "ODP system info\n" - "---------------\n" - "ODP API version: %s\n" - "ODP impl name: %s\n" - "CPU model: %s\n" - "CPU freq (hz): %" PRIu64 "\n" - "Cache line size: %i\n" - "CPU count: %i\n" - "\n", - odp_version_api_str(), odp_version_impl_name(), - odp_cpu_model_str(), odp_cpu_hz_max(), - odp_sys_cache_line_size(), odp_cpu_count()); + odp_sys_info_print(); printf("Running ODP appl: \"%s\"\n" "-----------------\n", progname); diff --git a/test/common_plat/performance/odp_l2fwd.c b/test/common_plat/performance/odp_l2fwd.c index dd69cde40..8bd03d254 100644 --- a/test/common_plat/performance/odp_l2fwd.c +++ b/test/common_plat/performance/odp_l2fwd.c @@ -1336,19 +1336,7 @@ static void print_info(char *progname, appl_args_t *appl_args) { int i; - printf("\n" - "ODP system info\n" - "---------------\n" - "ODP API version: %s\n" - "ODP impl name: %s\n" - "CPU model: %s\n" - "CPU freq (hz): %" PRIu64 "\n" - "Cache line size: %i\n" - "CPU count: %i\n" - "\n", - odp_version_api_str(), odp_version_impl_name(), - odp_cpu_model_str(), odp_cpu_hz_max(), - odp_sys_cache_line_size(), odp_cpu_count()); + odp_sys_info_print(); printf("Running ODP appl: \"%s\"\n" "-----------------\n" diff --git a/test/common_plat/performance/odp_pktio_ordered.c b/test/common_plat/performance/odp_pktio_ordered.c index e772411a0..d7e43c4bc 100644 --- a/test/common_plat/performance/odp_pktio_ordered.c +++ b/test/common_plat/performance/odp_pktio_ordered.c @@ -1034,19 +1034,7 @@ static void print_info(char *progname, appl_args_t *appl_args) { int i; - printf("\n" - "ODP system info\n" - "---------------\n" - "ODP API version: %s\n" - "ODP impl name: %s\n" - "CPU model: %s\n" - "CPU freq (hz): %" PRIu64 "\n" - "Cache line size: %i\n" - "CPU count: %i\n" - "\n", - odp_version_api_str(), odp_version_impl_name(), - odp_cpu_model_str(), odp_cpu_hz_max(), - odp_sys_cache_line_size(), odp_cpu_count()); + odp_sys_info_print(); printf("Running ODP appl: \"%s\"\n" "-----------------\n" diff --git a/test/common_plat/performance/odp_scheduling.c b/test/common_plat/performance/odp_scheduling.c index 308ed410d..03078a5b3 100644 --- a/test/common_plat/performance/odp_scheduling.c +++ b/test/common_plat/performance/odp_scheduling.c @@ -831,17 +831,7 @@ int main(int argc, char *argv[]) } printf("\n"); - printf("ODP system info\n"); - printf("---------------\n"); - printf("ODP API version: %s\n", odp_version_api_str()); - printf("ODP impl name: %s\n", odp_version_impl_name()); - printf("ODP impl details: %s\n", odp_version_impl_str()); - printf("CPU model: %s\n", odp_cpu_model_str()); - printf("CPU freq (hz): %" PRIu64 "\n", odp_cpu_hz_max()); - printf("Cache line size: %i\n", odp_sys_cache_line_size()); - printf("Max CPU count: %i\n", odp_cpu_count()); - - printf("\n"); + odp_sys_info_print(); /* Get default worker cpumask */ num_workers = odp_cpumask_default_worker(&cpumask, args.cpu_count); diff --git a/test/linux-generic/pktio_ipc/ipc_common.c b/test/linux-generic/pktio_ipc/ipc_common.c index e15d39132..b0fa12a1f 100644 --- a/test/linux-generic/pktio_ipc/ipc_common.c +++ b/test/linux-generic/pktio_ipc/ipc_common.c @@ -139,13 +139,7 @@ void parse_args(int argc, char *argv[]) */ void print_info(char *progname) { - printf("\n" - "ODP system info\n" - "---------------\n" - "ODP API version: %s\n" - "CPU model: %s\n" - "\n", - odp_version_api_str(), odp_cpu_model_str()); + odp_sys_info_print(); printf("Running ODP appl: \"%s\"\n" "-----------------\n"