From patchwork Wed Dec 30 23:49:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 59093 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp3134239lbb; Wed, 30 Dec 2015 15:49:37 -0800 (PST) X-Received: by 10.140.101.130 with SMTP id u2mr91259354qge.71.1451519377534; Wed, 30 Dec 2015 15:49:37 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id u64si47667414qki.62.2015.12.30.15.49.37; Wed, 30 Dec 2015 15:49:37 -0800 (PST) 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; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id D18F1617A2; Wed, 30 Dec 2015 23:49:36 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=AYtgGQsW; dkim-adsp=none (unprotected policy); dkim-atps=neutral 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.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, 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 051F5616A7; Wed, 30 Dec 2015 23:49:32 +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 0EC95616E3; Wed, 30 Dec 2015 23:49:30 +0000 (UTC) Received: from mail-oi0-f45.google.com (mail-oi0-f45.google.com [209.85.218.45]) by lists.linaro.org (Postfix) with ESMTPS id 353C8616A1 for ; Wed, 30 Dec 2015 23:49:29 +0000 (UTC) Received: by mail-oi0-f45.google.com with SMTP id o124so209188017oia.1 for ; Wed, 30 Dec 2015 15:49:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=80WqufoOn6acvsWm423HJ4kgMDemJ/xAEj9ywCatZWI=; b=AYtgGQsWCMNf4Nloa1OYo+jbqrxMpYZggQIfOqMk9BsryWuENRwZRYc9jr1Wva/FlH rZsKY1Rn5LCQacJmrxR6ytxxIqLk9B32IODuET++u7odIKl8aa9pYilAel7Vh5xSz7kR a7CEwBqjE2MhVDji8Bi7ZeUr4nqaj5hps1VZ8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=80WqufoOn6acvsWm423HJ4kgMDemJ/xAEj9ywCatZWI=; b=JPs5QR6hy+iRL6TavM1RaW71O/wZk3aHp/j5dGH0jBSUZmobkciQ8AaQNPVVAm4PNw zORxrWm74vH5T1J6Eoi07wjcyV7wQeUNZeTm4u1VzmBYtmbm3/EHJnUplCtAx9ia+cPL 90NoBBe9iBQaOqRpbFd/JXwV6UVBM60VG4MBGxJYhu5X5oYHc7noyi4BnsKWUiEYoOYT gmdBEYT6EqDG6GPLwjOAYTKVA/2W8cSlYUZIwWYhR1vIvS4F6yiXvoRgujqDVipCOwUK ogS46f9x31WyYoO3C5+GSuurtIDWfDtkXPoZPAPfNw1JQ/eBqNynBIkK3zIp4gG3xn/h mR9g== X-Gm-Message-State: ALoCoQmoPUBi2JLIxk9VOB6v9qJ3cmvGnAyn8VNfT0C9lxOgmavpTOigTejglX+eXvTq2B7TASd6XvmOVHcBnrHLBP/FIyxDWA== X-Received: by 10.202.86.136 with SMTP id k130mr42081989oib.69.1451519368678; Wed, 30 Dec 2015 15:49:28 -0800 (PST) Received: from Ubuntu15.localdomain (cpe-66-68-129-43.austin.res.rr.com. [66.68.129.43]) by smtp.gmail.com with ESMTPSA id q4sm24112560oew.6.2015.12.30.15.49.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Dec 2015 15:49:28 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Wed, 30 Dec 2015 17:49:24 -0600 Message-Id: <1451519364-29289-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH] validation: scheduler: add timing tests for scheduled queue types 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: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Expand the existing scheduler chaos test to provide timing information for mixed queues as well as individual timings for parallel, atomic, and ordered queues. This enables implementation scheduling efficiency to be displayed by queue type. Signed-off-by: Bill Fischofer --- test/validation/scheduler/scheduler.c | 51 ++++++++++++++++++++++++++++++----- test/validation/scheduler/scheduler.h | 3 +++ 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/test/validation/scheduler/scheduler.c b/test/validation/scheduler/scheduler.c index 7ba6a06..d5842de 100644 --- a/test/validation/scheduler/scheduler.c +++ b/test/validation/scheduler/scheduler.c @@ -451,12 +451,14 @@ static void *chaos_thread(void *arg) thread_args_t *args = (thread_args_t *)arg; test_globals_t *globals = args->globals; int me = odp_thread_id(); + odp_time_t start_time, end_time, diff; if (CHAOS_DEBUG) printf("Chaos thread %d starting...\n", me); /* Wait for all threads to start */ odp_barrier_wait(&globals->barrier); + start_time = odp_time_local(); /* Run the test */ wait = odp_schedule_wait_time(CHAOS_WAIT_FAIL); @@ -508,10 +510,16 @@ static void *chaos_thread(void *arg) odp_event_free(ev); } + end_time = odp_time_local(); + diff = odp_time_diff(end_time, start_time); + + printf("Thread %d ends, elapsed time = %" PRIu64 "us\n", + odp_thread_id(), odp_time_to_ns(diff) / 1000); + return NULL; } -void scheduler_test_chaos(void) +static void chaos_run(unsigned int qtype) { odp_pool_t pool; odp_pool_param_t params; @@ -557,11 +565,19 @@ void scheduler_test_chaos(void) qp.sched.prio = ODP_SCHED_PRIO_DEFAULT; for (i = 0; i < CHAOS_NUM_QUEUES; i++) { - qp.sched.sync = sync[i % num_sync]; - snprintf(globals->chaos_q[i].name, - sizeof(globals->chaos_q[i].name), - "chaos queue %d - %s", i, - qtypes[i % num_sync]); + if (qtype == num_sync) { + qp.sched.sync = sync[i % num_sync]; + snprintf(globals->chaos_q[i].name, + sizeof(globals->chaos_q[i].name), + "chaos queue %d - %s", i, + qtypes[i % num_sync]); + } else { + qp.sched.sync = sync[qtype]; + snprintf(globals->chaos_q[i].name, + sizeof(globals->chaos_q[i].name), + "chaos queue %d - %s", i, + qtypes[qtype]); + } globals->chaos_q[i].handle = odp_queue_create(globals->chaos_q[i].name, ODP_QUEUE_TYPE_SCHED, @@ -630,6 +646,26 @@ void scheduler_test_chaos(void) CU_ASSERT(rc == 0); } +void scheduler_test_chaos(void) +{ + chaos_run(3); +} + +void scheduler_test_parallel(void) +{ + chaos_run(0); +} + +void scheduler_test_atomic(void) +{ + chaos_run(1); +} + +void scheduler_test_ordered(void) +{ + chaos_run(2); +} + static void *schedule_common_(void *arg) { thread_args_t *args = (thread_args_t *)arg; @@ -1521,6 +1557,9 @@ odp_testinfo_t scheduler_suite[] = { ODP_TEST_INFO(scheduler_test_queue_destroy), ODP_TEST_INFO(scheduler_test_groups), ODP_TEST_INFO(scheduler_test_chaos), + ODP_TEST_INFO(scheduler_test_parallel), + ODP_TEST_INFO(scheduler_test_atomic), + ODP_TEST_INFO(scheduler_test_ordered), ODP_TEST_INFO(scheduler_test_1q_1t_n), ODP_TEST_INFO(scheduler_test_1q_1t_a), ODP_TEST_INFO(scheduler_test_1q_1t_o), diff --git a/test/validation/scheduler/scheduler.h b/test/validation/scheduler/scheduler.h index bba79aa..cd69e92 100644 --- a/test/validation/scheduler/scheduler.h +++ b/test/validation/scheduler/scheduler.h @@ -15,6 +15,9 @@ void scheduler_test_num_prio(void); void scheduler_test_queue_destroy(void); void scheduler_test_groups(void); void scheduler_test_chaos(void); +void scheduler_test_parallel(void); +void scheduler_test_atomic(void); +void scheduler_test_ordered(void); void scheduler_test_1q_1t_n(void); void scheduler_test_1q_1t_a(void); void scheduler_test_1q_1t_o(void);