From patchwork Wed Dec 24 22:36:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 42627 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D60E826C9C for ; Wed, 24 Dec 2014 22:36:39 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id gq15sf5368302lab.3 for ; Wed, 24 Dec 2014 14:36:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=tabG1RubdjL91hPCUcAnyYyV5VZpGsY9+sLQdfoHE5k=; b=iHC3qqcXEFIbNtJ+XJEX6k1wDIjIGPsYO100BQP0dXiJoF8QHVyVKiepoYOAj0F9bb IQWNmtuBYLiUJC7utcy3A21BbId4R4MX1D8dJaXH705CA3WkLeuWAE7h0WU+XUHNm8th 81eWvx8z7jbec8dUU3Rqc7UomGhJCAWpCYMVhpkdUZbUSDlrv+oxsWlR0NHlXLatATZy CzXMxvv+YUCa0NKWlKBBK3Py9ao2//muPId+CluYnCGRbr9PuOhS46ZMOWxDwOMpSfEH hHNE4X772hbG85Kg6mpSbJSaSzqzOI5hg0rz3HGfHwYTua8Ek0f4XT5gfuooHcCquXdy CW0w== X-Gm-Message-State: ALoCoQmSwWDxRAak6WlrFQsUkv4Gxb5Jx0rHL59+rwC0BKPdonC1bbYOwkaulRaYu/voqkC0ZxML X-Received: by 10.194.95.74 with SMTP id di10mr4363153wjb.0.1419460598484; Wed, 24 Dec 2014 14:36:38 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.135 with SMTP id s7ls1912508las.33.gmail; Wed, 24 Dec 2014 14:36:38 -0800 (PST) X-Received: by 10.112.50.239 with SMTP id f15mr35765736lbo.31.1419460598040; Wed, 24 Dec 2014 14:36:38 -0800 (PST) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id z5si3914367lbo.84.2014.12.24.14.36.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Dec 2014 14:36:37 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by mail-lb0-f179.google.com with SMTP id z11so7146806lbi.38 for ; Wed, 24 Dec 2014 14:36:37 -0800 (PST) X-Received: by 10.152.26.201 with SMTP id n9mr36516813lag.50.1419460597883; Wed, 24 Dec 2014 14:36:37 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.142.69 with SMTP id ru5csp1740625lbb; Wed, 24 Dec 2014 14:36:36 -0800 (PST) X-Received: by 10.140.30.244 with SMTP id d107mr54099758qgd.70.1419460595997; Wed, 24 Dec 2014 14:36:35 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id a92si27846931qge.117.2014.12.24.14.36.34 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 24 Dec 2014 14:36:35 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y3uXf-0007MW-KR; Wed, 24 Dec 2014 22:36:31 +0000 Received: from mail-qg0-f41.google.com ([209.85.192.41]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y3uXZ-0007MR-1N for lng-odp@lists.linaro.org; Wed, 24 Dec 2014 22:36:25 +0000 Received: by mail-qg0-f41.google.com with SMTP id e89so4406649qgf.28 for ; Wed, 24 Dec 2014 14:36:19 -0800 (PST) X-Received: by 10.224.51.11 with SMTP id b11mr58079396qag.43.1419460579715; Wed, 24 Dec 2014 14:36:19 -0800 (PST) Received: from mike-desktop.?.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id 90sm22318112qgl.3.2014.12.24.14.36.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Dec 2014 14:36:19 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Wed, 24 Dec 2014 17:36:12 -0500 Message-Id: <1419460572-5701-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 X-Topics: patch Subject: [lng-odp] [PATCH] example: move odp_example to test/performance X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mike.holmes@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 odp_example is too complex to be an example, and is not a unit test, instead it is a performance oriented test application. Signed-off-by: Mike Holmes Reviewed-by: Taras Kondratiuk --- configure.ac | 2 +- example/Makefile.am | 2 +- example/odp_example/.gitignore | 1 - example/odp_example/Makefile.am | 10 --- test/Makefile.am | 2 +- test/performance/.gitignore | 1 + test/performance/Makefile.am | 10 +++ .../performance/odp_scheduling.c | 76 +++++++++++----------- 8 files changed, 52 insertions(+), 52 deletions(-) delete mode 100644 example/odp_example/.gitignore delete mode 100644 example/odp_example/Makefile.am create mode 100644 test/performance/.gitignore create mode 100644 test/performance/Makefile.am rename example/odp_example/odp_example.c => test/performance/odp_scheduling.c (92%) diff --git a/configure.ac b/configure.ac index 377e8be..01644f6 100644 --- a/configure.ac +++ b/configure.ac @@ -198,13 +198,13 @@ AC_CONFIG_FILES([Makefile example/generator/Makefile example/ipsec/Makefile example/l2fwd/Makefile - example/odp_example/Makefile example/packet/Makefile example/timer/Makefile doc/Makefile test/Makefile test/api_test/Makefile test/validation/Makefile + test/performance/Makefile pkgconfig/libodp.pc]) AC_SEARCH_LIBS([timer_create],[rt posix4]) diff --git a/example/Makefile.am b/example/Makefile.am index b2a22a3..3021571 100644 --- a/example/Makefile.am +++ b/example/Makefile.am @@ -1 +1 @@ -SUBDIRS = generator ipsec l2fwd odp_example packet timer +SUBDIRS = generator ipsec l2fwd packet timer diff --git a/example/odp_example/.gitignore b/example/odp_example/.gitignore deleted file mode 100644 index 59ca8c8..0000000 --- a/example/odp_example/.gitignore +++ /dev/null @@ -1 +0,0 @@ -odp_example diff --git a/example/odp_example/Makefile.am b/example/odp_example/Makefile.am deleted file mode 100644 index 8252424..0000000 --- a/example/odp_example/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -include $(top_srcdir)/example/Makefile.inc - -bin_PROGRAMS = odp_example -odp_example_LDFLAGS = $(AM_LDFLAGS) -static -odp_example_CFLAGS = $(AM_CFLAGS) -I${top_srcdir}/example - -noinst_HEADERS = \ - $(top_srcdir)/example/example_debug.h - -dist_odp_example_SOURCES = odp_example.c diff --git a/test/Makefile.am b/test/Makefile.am index 90598bf..afaa1d0 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1 +1 @@ -SUBDIRS = api_test validation +SUBDIRS = api_test validation performance diff --git a/test/performance/.gitignore b/test/performance/.gitignore new file mode 100644 index 0000000..a229e10 --- /dev/null +++ b/test/performance/.gitignore @@ -0,0 +1 @@ +odp_scheduling diff --git a/test/performance/Makefile.am b/test/performance/Makefile.am new file mode 100644 index 0000000..359c4f0 --- /dev/null +++ b/test/performance/Makefile.am @@ -0,0 +1,10 @@ +include $(top_srcdir)/test/Makefile.inc + +bin_PROGRAMS = odp_scheduling +odp_scheduling_LDFLAGS = $(AM_LDFLAGS) -static +odp_scheduling_CFLAGS = $(AM_CFLAGS) -I${top_srcdir}/test + +noinst_HEADERS = \ + $(top_srcdir)/test/test_debug.h + +dist_odp_scheduling_SOURCES = odp_scheduling.c diff --git a/example/odp_example/odp_example.c b/test/performance/odp_scheduling.c similarity index 92% rename from example/odp_example/odp_example.c rename to test/performance/odp_scheduling.c index 8373f12..a18e858 100644 --- a/example/odp_example/odp_example.c +++ b/test/performance/odp_scheduling.c @@ -13,7 +13,7 @@ #include #include -#include +#include /* ODP main header */ #include @@ -95,7 +95,7 @@ static int create_queue(int thr, odp_buffer_pool_t msg_pool, int prio) buf = odp_buffer_alloc(msg_pool); if (!odp_buffer_is_valid(buf)) { - EXAMPLE_ERR(" [%i] msg_pool alloc failed\n", thr); + LOG_ERR(" [%i] msg_pool alloc failed\n", thr); return -1; } @@ -105,12 +105,12 @@ static int create_queue(int thr, odp_buffer_pool_t msg_pool, int prio) queue = odp_queue_lookup(name); if (queue == ODP_QUEUE_INVALID) { - EXAMPLE_ERR(" [%i] Queue %s lookup failed.\n", thr, name); + LOG_ERR(" [%i] Queue %s lookup failed.\n", thr, name); return -1; } if (odp_queue_enq(queue, buf)) { - EXAMPLE_ERR(" [%i] Queue enqueue failed.\n", thr); + LOG_ERR(" [%i] Queue enqueue failed.\n", thr); return -1; } @@ -144,20 +144,20 @@ static int create_queues(int thr, odp_buffer_pool_t msg_pool, int prio) queue = odp_queue_lookup(name); if (queue == ODP_QUEUE_INVALID) { - EXAMPLE_ERR(" [%i] Queue %s lookup failed.\n", thr, - name); + LOG_ERR(" [%i] Queue %s lookup failed.\n", thr, + name); return -1; } buf = odp_buffer_alloc(msg_pool); if (!odp_buffer_is_valid(buf)) { - EXAMPLE_ERR(" [%i] msg_pool alloc failed\n", thr); + LOG_ERR(" [%i] msg_pool alloc failed\n", thr); return -1; } if (odp_queue_enq(queue, buf)) { - EXAMPLE_ERR(" [%i] Queue enqueue failed.\n", thr); + LOG_ERR(" [%i] Queue enqueue failed.\n", thr); return -1; } } @@ -186,7 +186,7 @@ static int test_alloc_single(int thr, odp_buffer_pool_t pool) temp_buf = odp_buffer_alloc(pool); if (!odp_buffer_is_valid(temp_buf)) { - EXAMPLE_ERR(" [%i] alloc_single failed\n", thr); + LOG_ERR(" [%i] alloc_single failed\n", thr); return -1; } @@ -224,7 +224,7 @@ static int test_alloc_multi(int thr, odp_buffer_pool_t pool) temp_buf[j] = odp_buffer_alloc(pool); if (!odp_buffer_is_valid(temp_buf[j])) { - EXAMPLE_ERR(" [%i] alloc_multi failed\n", thr); + LOG_ERR(" [%i] alloc_multi failed\n", thr); return -1; } } @@ -266,7 +266,7 @@ static int test_poll_queue(int thr, odp_buffer_pool_t msg_pool) buf = odp_buffer_alloc(msg_pool); if (!odp_buffer_is_valid(buf)) { - EXAMPLE_ERR(" [%i] msg_pool alloc failed\n", thr); + LOG_ERR(" [%i] msg_pool alloc failed\n", thr); return -1; } @@ -287,14 +287,14 @@ static int test_poll_queue(int thr, odp_buffer_pool_t msg_pool) for (i = 0; i < QUEUE_ROUNDS; i++) { if (odp_queue_enq(queue, buf)) { - EXAMPLE_ERR(" [%i] Queue enqueue failed.\n", thr); + LOG_ERR(" [%i] Queue enqueue failed.\n", thr); return -1; } buf = odp_queue_deq(queue); if (!odp_buffer_is_valid(buf)) { - EXAMPLE_ERR(" [%i] Queue empty.\n", thr); + LOG_ERR(" [%i] Queue empty.\n", thr); return -1; } } @@ -343,7 +343,7 @@ static int test_schedule_one_single(const char *str, int thr, buf = odp_schedule_one(&queue, ODP_SCHED_WAIT); if (odp_queue_enq(queue, buf)) { - EXAMPLE_ERR(" [%i] Queue enqueue failed.\n", thr); + LOG_ERR(" [%i] Queue enqueue failed.\n", thr); return -1; } } @@ -404,7 +404,7 @@ static int test_schedule_one_many(const char *str, int thr, buf = odp_schedule_one(&queue, ODP_SCHED_WAIT); if (odp_queue_enq(queue, buf)) { - EXAMPLE_ERR(" [%i] Queue enqueue failed.\n", thr); + LOG_ERR(" [%i] Queue enqueue failed.\n", thr); return -1; } } @@ -462,7 +462,7 @@ static int test_schedule_single(const char *str, int thr, buf = odp_schedule(&queue, ODP_SCHED_WAIT); if (odp_queue_enq(queue, buf)) { - EXAMPLE_ERR(" [%i] Queue enqueue failed.\n", thr); + LOG_ERR(" [%i] Queue enqueue failed.\n", thr); return -1; } } @@ -481,7 +481,7 @@ static int test_schedule_single(const char *str, int thr, tot++; if (odp_queue_enq(queue, buf)) { - EXAMPLE_ERR(" [%i] Queue enqueue failed.\n", thr); + LOG_ERR(" [%i] Queue enqueue failed.\n", thr); return -1; } } @@ -541,7 +541,7 @@ static int test_schedule_many(const char *str, int thr, buf = odp_schedule(&queue, ODP_SCHED_WAIT); if (odp_queue_enq(queue, buf)) { - EXAMPLE_ERR(" [%i] Queue enqueue failed.\n", thr); + LOG_ERR(" [%i] Queue enqueue failed.\n", thr); return -1; } } @@ -560,7 +560,7 @@ static int test_schedule_many(const char *str, int thr, tot++; if (odp_queue_enq(queue, buf)) { - EXAMPLE_ERR(" [%i] Queue enqueue failed.\n", thr); + LOG_ERR(" [%i] Queue enqueue failed.\n", thr); return -1; } } @@ -619,8 +619,8 @@ static int test_schedule_multi(const char *str, int thr, queue = odp_queue_lookup(name); if (queue == ODP_QUEUE_INVALID) { - EXAMPLE_ERR(" [%i] Queue %s lookup failed.\n", thr, - name); + LOG_ERR(" [%i] Queue %s lookup failed.\n", thr, + name); return -1; } @@ -628,14 +628,14 @@ static int test_schedule_multi(const char *str, int thr, buf[j] = odp_buffer_alloc(msg_pool); if (!odp_buffer_is_valid(buf[j])) { - EXAMPLE_ERR(" [%i] msg_pool alloc failed\n", - thr); + LOG_ERR(" [%i] msg_pool alloc failed\n", + thr); return -1; } } if (odp_queue_enq_multi(queue, buf, MULTI_BUFS_MAX)) { - EXAMPLE_ERR(" [%i] Queue enqueue failed.\n", thr); + LOG_ERR(" [%i] Queue enqueue failed.\n", thr); return -1; } } @@ -650,7 +650,7 @@ static int test_schedule_multi(const char *str, int thr, tot += num; if (odp_queue_enq_multi(queue, buf, num)) { - EXAMPLE_ERR(" [%i] Queue enqueue failed.\n", thr); + LOG_ERR(" [%i] Queue enqueue failed.\n", thr); return -1; } } @@ -668,7 +668,7 @@ static int test_schedule_multi(const char *str, int thr, tot += num; if (odp_queue_enq_multi(queue, buf, num)) { - EXAMPLE_ERR(" [%i] Queue enqueue failed.\n", thr); + LOG_ERR(" [%i] Queue enqueue failed.\n", thr); return -1; } } @@ -720,7 +720,7 @@ static void *run_thread(void *arg) globals = odp_shm_addr(shm); if (globals == NULL) { - EXAMPLE_ERR("Shared mem lookup failed\n"); + LOG_ERR("Shared mem lookup failed\n"); return NULL; } @@ -740,7 +740,7 @@ static void *run_thread(void *arg) msg_pool = odp_buffer_pool_lookup("msg_pool"); if (msg_pool == ODP_BUFFER_POOL_INVALID) { - EXAMPLE_ERR(" [%i] msg_pool not found\n", thr); + LOG_ERR(" [%i] msg_pool not found\n", thr); return NULL; } @@ -840,7 +840,7 @@ static void test_time(void) double err; if (clock_gettime(CLOCK_MONOTONIC, &tp2)) { - EXAMPLE_ERR("clock_gettime failed.\n"); + LOG_ERR("clock_gettime failed.\n"); return; } @@ -848,7 +848,7 @@ static void test_time(void) do { if (clock_gettime(CLOCK_MONOTONIC, &tp1)) { - EXAMPLE_ERR("clock_gettime failed.\n"); + LOG_ERR("clock_gettime failed.\n"); return; } @@ -858,7 +858,7 @@ static void test_time(void) do { if (clock_gettime(CLOCK_MONOTONIC, &tp2)) { - EXAMPLE_ERR("clock_gettime failed.\n"); + LOG_ERR("clock_gettime failed.\n"); return; } @@ -976,7 +976,7 @@ int main(int argc, char *argv[]) /* ODP global init */ if (odp_init_global(NULL, NULL)) { - EXAMPLE_ERR("ODP global init failed.\n"); + LOG_ERR("ODP global init failed.\n"); return -1; } @@ -985,7 +985,7 @@ int main(int argc, char *argv[]) * setting up resources for worker threads. */ if (odp_init_local()) { - EXAMPLE_ERR("ODP global init failed.\n"); + LOG_ERR("ODP global init failed.\n"); return -1; } @@ -1033,7 +1033,7 @@ int main(int argc, char *argv[]) globals = odp_shm_addr(shm); if (globals == NULL) { - EXAMPLE_ERR("Shared memory reserve failed.\n"); + LOG_ERR("Shared memory reserve failed.\n"); return -1; } @@ -1051,7 +1051,7 @@ int main(int argc, char *argv[]) pool = odp_buffer_pool_create("msg_pool", ODP_SHM_NULL, ¶ms); if (pool == ODP_BUFFER_POOL_INVALID) { - EXAMPLE_ERR("Pool create failed.\n"); + LOG_ERR("Pool create failed.\n"); return -1; } @@ -1063,7 +1063,7 @@ int main(int argc, char *argv[]) queue = odp_queue_create("poll_queue", ODP_QUEUE_TYPE_POLL, NULL); if (queue == ODP_QUEUE_INVALID) { - EXAMPLE_ERR("Poll queue create failed.\n"); + LOG_ERR("Poll queue create failed.\n"); return -1; } @@ -1095,7 +1095,7 @@ int main(int argc, char *argv[]) ¶m); if (queue == ODP_QUEUE_INVALID) { - EXAMPLE_ERR("Schedule queue create failed.\n"); + LOG_ERR("Schedule queue create failed.\n"); return -1; } } @@ -1115,7 +1115,7 @@ int main(int argc, char *argv[]) first_core); if (ret < 0) { - EXAMPLE_ERR("Fork workers failed %i\n", ret); + LOG_ERR("Fork workers failed %i\n", ret); return -1; }