From patchwork Wed Jan 20 21:30:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 60051 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp3418803lbb; Wed, 20 Jan 2016 13:31:57 -0800 (PST) X-Received: by 10.140.165.7 with SMTP id l7mr51937586qhl.101.1453325516950; Wed, 20 Jan 2016 13:31:56 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id j32si45786407qgj.35.2016.01.20.13.31.56; Wed, 20 Jan 2016 13:31:56 -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 3B6C66177F; Wed, 20 Jan 2016 21:31:56 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=V1KCSzv6; 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 84C8261794; Wed, 20 Jan 2016 21:31:04 +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 0A2C061712; Wed, 20 Jan 2016 21:30:57 +0000 (UTC) Received: from mail-ob0-f170.google.com (mail-ob0-f170.google.com [209.85.214.170]) by lists.linaro.org (Postfix) with ESMTPS id D23E761712 for ; Wed, 20 Jan 2016 21:30:55 +0000 (UTC) Received: by mail-ob0-f170.google.com with SMTP id ba1so18757693obb.3 for ; Wed, 20 Jan 2016 13:30:55 -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=fACSvTFaioirmlAeMTTJZpeoS9NhAtNg+3YGRh9fdY4=; b=V1KCSzv6sqq9YtYMn9lfwkSGLxjJitcAchXBVpNiiAm6HklTQr/BsT1i6vJ5bdQLkV WMuFCHMN4sjjK+i9ezvdgKgIJfm7nzWQpkDjQkeXwC5dGuXFVY4Q6+DyalPb/pjgnqlE Ss7PzAWRrQnNrieCQYKnXxFPodRyP6KmeIpd4= 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=fACSvTFaioirmlAeMTTJZpeoS9NhAtNg+3YGRh9fdY4=; b=JKZ22ZDkj4v7OsVkRNXSE+0uAtcQ8A+dH7KTNPs+/2pcxWFVFMbPk8j/lLKNYElBRG vOnbSN8epzThzHWHJAaezcWwL9y4k00getyc+i2snx0dpBettltDwya/IfU7uk4ENfq9 rLAm5NWzm3dOSmGQFKPJAb03m/cUa/PVr9SF8Zk/lSIQSWyVu+lp8YSioR78hjw+L5Za bXMbw/3CB4uVBgcXC/HTdk2BTD39nIqzVQVtwI+9AF4pUmI7hK4EuxbKQK7LTUwQilWG FQjhuKKoYv31v/jI5pdewZOV2x2uHFJraF+J9UZQ+vSLy+eOGJtYRhK4MhsRsP8n4XFy qKkQ== X-Gm-Message-State: ALoCoQmPUmjJ33Lj+bNeTF1XBruLXPAtbqBRS2pDDqP5FgnJrElCm+IRt6RWiJKULnOSSDuppDtlbOCxInHieOJfzfSNwEYR1w== X-Received: by 10.60.63.81 with SMTP id e17mr29384303oes.21.1453325455234; Wed, 20 Jan 2016 13:30:55 -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 wh4sm18836979obc.10.2016.01.20.13.30.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Jan 2016 13:30:54 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Wed, 20 Jan 2016 15:30:49 -0600 Message-Id: <1453325449-28139-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv2] 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 | 53 ++++++++++++++++++++++++++++++----- test/validation/scheduler/scheduler.h | 3 ++ 2 files changed, 49 insertions(+), 7 deletions(-) diff --git a/test/validation/scheduler/scheduler.c b/test/validation/scheduler/scheduler.c index 7ba6a06..072d0da 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,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_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 +1556,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);