From patchwork Fri Jan 22 16:25:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 60169 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp787144lbb; Fri, 22 Jan 2016 08:25:21 -0800 (PST) X-Received: by 10.107.11.66 with SMTP id v63mr5019550ioi.184.1453479920888; Fri, 22 Jan 2016 08:25:20 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id k4si6060207igu.103.2016.01.22.08.25.20; Fri, 22 Jan 2016 08:25:20 -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 ECC0F618D1; Fri, 22 Jan 2016 16:25:19 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=AbR6EsGz; 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 4117961835; Fri, 22 Jan 2016 16:25:15 +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 75888618BF; Fri, 22 Jan 2016 16:25:12 +0000 (UTC) Received: from mail-ob0-f180.google.com (mail-ob0-f180.google.com [209.85.214.180]) by lists.linaro.org (Postfix) with ESMTPS id 980F3617D0 for ; Fri, 22 Jan 2016 16:25:11 +0000 (UTC) Received: by mail-ob0-f180.google.com with SMTP id yo10so41568471obb.2 for ; Fri, 22 Jan 2016 08:25:11 -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=2y596DNdNT3+41nIgd+T1Z6hHNcQwA5s/8rNRYC9CzY=; b=AbR6EsGzgyz5MmNLT/1JS0M2yWWdimUQiUOPAMCnzeIJwg6IRL4babToUoeZXT+K8r c5h6/+45wd6qCMt4x+3sbmi5llDJFIXOt/FbjiGzO/59QrFiOU70nZvyTpKoq66UaJ04 6diOGzRlp+u/cQXrxzqQFRx8ByQdEsYMGgyTo= 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=2y596DNdNT3+41nIgd+T1Z6hHNcQwA5s/8rNRYC9CzY=; b=CBwyO3I10JEVvQ5uN9+EeyZKuH/gKK1N5HMT6Ihn+rKhBRsBeicqYOgH0py0FvjUAV giMr5bIk4x63e+SDvbTus2z1MN6JobNxM49xW43c8ifm1WlDU/CKZGLe+oMyAIzkXVpN ZH2CLz5yF4i6IvZLvc2l72oyFnvZX8VZd8kaMEFCKNIiTOUDG167Bn+LmFt5XG3df59s f6tvpz+LSmiZ1/SJhUu3ODwVaO6yPNmLKO7eZcZgjmQ0pWHXmaI7xVFVj+yIcKZeNumX 49Td5eHR/aRl7Ycc0WAz/SPtrZs0uqvvNuecUJU9yVc12lTJAyAr5aUO+O3eiqqCj9af rZcA== X-Gm-Message-State: AG10YOTPUIaaeb1PTU4QDlSuAh2HXa0W4GqVdaFQMXP8jUbM/rXu3ZbCI/p6F2zckE5eDyVMa0Y= X-Received: by 10.182.102.136 with SMTP id fo8mr3086716obb.11.1453479911072; Fri, 22 Jan 2016 08:25:11 -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 t74sm3384329oie.21.2016.01.22.08.25.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Jan 2016 08:25:10 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Fri, 22 Jan 2016 10:25:05 -0600 Message-Id: <1453479905-28870-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv4] 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 | 42 +++++++++++++++++++++++++++++++---- test/validation/scheduler/scheduler.h | 3 +++ 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/test/validation/scheduler/scheduler.c b/test/validation/scheduler/scheduler.c index 7ba6a06..ff95b4b 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,14 @@ 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 +641,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 +1551,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);