From patchwork Wed Jan 20 22:25:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 60053 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp3439622lbb; Wed, 20 Jan 2016 14:25:37 -0800 (PST) X-Received: by 10.55.52.211 with SMTP id b202mr48754144qka.27.1453328737659; Wed, 20 Jan 2016 14:25:37 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id c51si31608909qgc.0.2016.01.20.14.25.37; Wed, 20 Jan 2016 14:25: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 189DB61798; Wed, 20 Jan 2016 22:25:37 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=EOA56e1C; 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 753936165F; Wed, 20 Jan 2016 22:25:30 +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 A41E0616E7; Wed, 20 Jan 2016 22:25:27 +0000 (UTC) Received: from mail-oi0-f53.google.com (mail-oi0-f53.google.com [209.85.218.53]) by lists.linaro.org (Postfix) with ESMTPS id 9DDAA6165F for ; Wed, 20 Jan 2016 22:25:26 +0000 (UTC) Received: by mail-oi0-f53.google.com with SMTP id w75so14928733oie.0 for ; Wed, 20 Jan 2016 14:25:26 -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=h0jbqYdG5Uo4m/eLQ6Xvu9hyHB6vV5DmFW6bR3uMNk0=; b=EOA56e1C6f23aXQSCXJIiKU05Sq7KMFjRK2ekd8xQdyjVqAPKm7gkzUWmPnZ/GmYkd 2TohSII6/qj9wRu8dpYegXqMW2XX78pSAxXiVC7DvSQKgQGCR/EeDru6mqjrkDkh42m/ IuwTWR7YH7qVbwc0slAtkL5yd/3SgBjECmumA= 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=h0jbqYdG5Uo4m/eLQ6Xvu9hyHB6vV5DmFW6bR3uMNk0=; b=a4mvDgXoAYRaWQpwZMw+eBCCPQEVe/D6kwa0U9OieZvzscYxeV0N6bXzkRit3yy7vC 2SHMqtVGbi+21TzWuJwEBCCCllcnQaKcFw5yQI45KKaJGd1xjTQ4B9AfXQpvrQY5pJLh vfo9DfBjPaNNfkuR9PEPMoL3HF6lE94M3j1wl8/rWKt1kymkfQ0p+u3oFo6JvMj1wgyF ZbjMxtGQUvDjwKu8DD+ArDtsEsmB9CGO41JwmQ/5nAF6myQYD1u2VF2QpyHfzeSeQl+/ oQSlBjcqGsz6SLdo3M2zjz5B17SjjnRf/qeU2MX/P3uvBIhSMVgjILY4HHVnFfB2Or8N 54ww== X-Gm-Message-State: AG10YOQ/jdPbQ4LjtQYDBxsnYVSYzth4v/hyI90XYjXiPH/sI4HlwduVC0i8bRfqubvFv89y2K0= X-Received: by 10.202.105.8 with SMTP id e8mr2345840oic.34.1453328726162; Wed, 20 Jan 2016 14:25:26 -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 sd7sm18692302oec.13.2016.01.20.14.25.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Jan 2016 14:25:25 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Wed, 20 Jan 2016 16:25:19 -0600 Message-Id: <1453328719-7322-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv3] 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 Reviewed-by: Ivan Khoronzhuk --- test/validation/scheduler/scheduler.c | 41 +++++++++++++++++++++++++++++++---- test/validation/scheduler/scheduler.h | 3 +++ 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/test/validation/scheduler/scheduler.c b/test/validation/scheduler/scheduler.c index 7ba6a06..ea246d4 100644 --- a/test/validation/scheduler/scheduler.c +++ b/test/validation/scheduler/scheduler.c @@ -41,7 +41,7 @@ #define CHAOS_NUM_QUEUES 6 #define CHAOS_NUM_BUFS_PER_QUEUE 6 -#define CHAOS_NUM_ROUNDS 50000 +#define CHAOS_NUM_ROUNDS 1000 #define CHAOS_NUM_EVENTS (CHAOS_NUM_QUEUES * CHAOS_NUM_BUFS_PER_QUEUE) #define CHAOS_DEBUG (CHAOS_NUM_ROUNDS < 1000) #define CHAOS_PTR_TO_NDX(p) ((uint64_t)(uint32_t)(uintptr_t)p) @@ -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,13 @@ 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]; + uint32_t ndx = qtype == num_sync ? i % num_sync : qtype; + qp.sched.sync = sync[ndx]; snprintf(globals->chaos_q[i].name, sizeof(globals->chaos_q[i].name), "chaos queue %d - %s", i, - qtypes[i % num_sync]); + qtypes[ndx]); + globals->chaos_q[i].handle = odp_queue_create(globals->chaos_q[i].name, ODP_QUEUE_TYPE_SCHED, @@ -630,6 +640,26 @@ void scheduler_test_chaos(void) CU_ASSERT(rc == 0); } +void scheduler_test_parallel(void) +{ + chaos_run(0); +} + +void scheduler_test_atomic(void) +{ + chaos_run(1); +} + +void scheduler_test_ordered(void) +{ + chaos_run(2); +} + +void scheduler_test_chaos(void) +{ + chaos_run(3); +} + static void *schedule_common_(void *arg) { thread_args_t *args = (thread_args_t *)arg; @@ -1520,6 +1550,9 @@ odp_testinfo_t scheduler_suite[] = { ODP_TEST_INFO(scheduler_test_num_prio), ODP_TEST_INFO(scheduler_test_queue_destroy), ODP_TEST_INFO(scheduler_test_groups), + ODP_TEST_INFO(scheduler_test_parallel), + ODP_TEST_INFO(scheduler_test_atomic), + ODP_TEST_INFO(scheduler_test_ordered), ODP_TEST_INFO(scheduler_test_chaos), ODP_TEST_INFO(scheduler_test_1q_1t_n), ODP_TEST_INFO(scheduler_test_1q_1t_a), 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);