From patchwork Thu Apr 17 09:54:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 28515 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5580520674 for ; Thu, 17 Apr 2014 09:54:40 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id rd18sf1048421iec.8 for ; Thu, 17 Apr 2014 02:54:39 -0700 (PDT) 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:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=SKomIvxG+SX/FjL6Ocs/R5MhVsNn8fpxAFRomVhbyWc=; b=FWt/H4gn0L6clDXgJx3qAiGn+dC1mi9EY/QHo3Q/ewpVwnq24/b6y5gWmT0DJROwwn i6YYlogOpLAiCCVOc8OsDob81PSiN7IspXRiNDBENyaX9lE0acCMR6n2/yrE+w3R44Tq n3cdp40VRN+CI6m/IlHfgcZPrTEpDbdjnUntciUusf59QYEsDSfkrc1ko4uzNBJGRpj5 CrHE6LaDfdMFbTFZ8KCRY1/BDbOH/ZjNaHTA5aSI7OW1WK46wtqJ+TjjHpLF7cZaoeKh 7jb7L9WODDgBhXh4vS3nOQCVAB8C2nbKYNGk0jq+p6RldAsW2opWxX3FT77FJIUUyD0a 38oQ== X-Gm-Message-State: ALoCoQkguswz7LNFxWq2A3hV4hpP/kvacQ75evydSLDc4pqtHjILkaKrGM5evPQ6S/5R6QJZq81y X-Received: by 10.43.78.135 with SMTP id zm7mr4765392icb.27.1397728479638; Thu, 17 Apr 2014 02:54:39 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.101.245 with SMTP id u108ls1005767qge.79.gmail; Thu, 17 Apr 2014 02:54:39 -0700 (PDT) X-Received: by 10.58.105.105 with SMTP id gl9mr10869472veb.3.1397728479481; Thu, 17 Apr 2014 02:54:39 -0700 (PDT) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id rn1si4357288vec.186.2014.04.17.02.54.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 17 Apr 2014 02:54:39 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.175; Received: by mail-ve0-f175.google.com with SMTP id oz11so235302veb.34 for ; Thu, 17 Apr 2014 02:54:39 -0700 (PDT) X-Received: by 10.58.211.69 with SMTP id na5mr719275vec.30.1397728479403; Thu, 17 Apr 2014 02:54:39 -0700 (PDT) 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.220.221.72 with SMTP id ib8csp21778vcb; Thu, 17 Apr 2014 02:54:39 -0700 (PDT) X-Received: by 10.229.58.68 with SMTP id f4mr9315387qch.18.1397728478661; Thu, 17 Apr 2014 02:54:38 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id m17si806461qgd.69.2014.04.17.02.54.37 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 17 Apr 2014 02:54:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Waj1V-0004Af-QE; Thu, 17 Apr 2014 09:54:25 +0000 Received: from mail-la0-f51.google.com ([209.85.215.51]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Waj1P-0004Aa-L8 for lng-odp@lists.linaro.org; Thu, 17 Apr 2014 09:54:19 +0000 Received: by mail-la0-f51.google.com with SMTP id pv20so177729lab.24 for ; Thu, 17 Apr 2014 02:54:25 -0700 (PDT) X-Received: by 10.152.235.3 with SMTP id ui3mr9292958lac.2.1397728465296; Thu, 17 Apr 2014 02:54:25 -0700 (PDT) Received: from localhost.localdomain ([81.200.0.212]) by mx.google.com with ESMTPSA id i2sm12992702lbc.24.2014.04.17.02.54.23 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 17 Apr 2014 02:54:24 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Thu, 17 Apr 2014 13:54:09 +0400 Message-Id: <1397728449-8263-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 Subject: [lng-odp] [PATCH] scheduler patch code style clean up 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: maxim.uvarov@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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 Signed-off-by: Maxim Uvarov --- Hello Petri, please review this clean up and merge to your patch. Changes: 1. Doxygen warnings fix. 2. Removed not needed white spaces from timer_test examples which reduced generated documentation and code by 1 page. include/odp_schedule.h | 2 +- platform/linux-generic/source/odp_schedule.c | 1 - test/timer/odp_timer_test.c | 30 ++-------------------------- 3 files changed, 3 insertions(+), 30 deletions(-) diff --git a/include/odp_schedule.h b/include/odp_schedule.h index 80862c2..8087021 100644 --- a/include/odp_schedule.h +++ b/include/odp_schedule.h @@ -33,7 +33,7 @@ extern "C" { * * Converts nanoseconds to wait values for other schedule functions. * - * @param time_ns + * @param ns Nanoseconds * * @return Value for the wait parameter in schedule functions */ diff --git a/platform/linux-generic/source/odp_schedule.c b/platform/linux-generic/source/odp_schedule.c index 12f192b..eb4d9ee 100644 --- a/platform/linux-generic/source/odp_schedule.c +++ b/platform/linux-generic/source/odp_schedule.c @@ -338,7 +338,6 @@ static int schedule_loop(odp_queue_t *out_queue, uint64_t wait, while (1) { ret = schedule(out_queue, out_buf, max_num, max_deq); - if (ret) break; diff --git a/test/timer/odp_timer_test.c b/test/timer/odp_timer_test.c index af080be..337d80c 100644 --- a/test/timer/odp_timer_test.c +++ b/test/timer/odp_timer_test.c @@ -7,7 +7,7 @@ /** * @file * - * @example odp_example.c ODP example application + * @example odp_timer_test.c ODP timer example application */ #include @@ -22,7 +22,6 @@ /* GNU lib C */ #include - #define MAX_WORKERS 32 /**< Max worker threads */ #define MSG_POOL_SIZE (4*1024*1024) /**< Message pool size */ @@ -40,14 +39,13 @@ typedef struct { int core_count; /**< Core count*/ } test_args_t; - /** @private Barrier for test synchronisation */ static odp_barrier_t test_barrier; /** @private Timer handle*/ static odp_timer_t test_timer; - +/** @private test timeout */ static void test_timeouts(int thr) { uint64_t tick; @@ -58,14 +56,10 @@ static void test_timeouts(int thr) ODP_DBG(" [%i] test_timeouts\n", thr); queue = odp_queue_lookup("timer_queue"); - tick = odp_timer_current_tick(test_timer); - tick += 100; - odp_timer_absolute_tmo(test_timer, tick, queue, ODP_BUFFER_INVALID); - ODP_DBG(" [%i] current tick %"PRIu64"\n", thr, tick); while (1) { @@ -73,18 +67,14 @@ static void test_timeouts(int thr) /* TODO: read tick from tmo metadata */ tick = odp_timer_current_tick(test_timer); - ODP_DBG(" [%i] timeout, tick %"PRIu64"\n", thr, tick); - odp_buffer_free(buf); num--; - if (num == 0) break; tick += 100; - odp_timer_absolute_tmo(test_timer, tick, queue, ODP_BUFFER_INVALID); } @@ -93,7 +83,6 @@ static void test_timeouts(int thr) odp_schedule_release_atomic(); } - /** * @internal Worker thread * @@ -122,7 +111,6 @@ static void *run_thread(void *arg) * Find the buffer pool */ msg_pool = odp_buffer_pool_lookup("msg_pool"); - if (msg_pool == ODP_BUFFER_POOL_INVALID) { ODP_ERR(" [%i] msg_pool not found\n", thr); return NULL; @@ -132,13 +120,11 @@ static void *run_thread(void *arg) test_timeouts(thr); - printf("Thread %i exits\n", thr); fflush(NULL); return arg; } - /** * @internal Print help */ @@ -151,7 +137,6 @@ static void print_usage(void) printf("\n\n"); } - /** * @internal Parse arguments * @@ -172,7 +157,6 @@ static void parse_args(int argc, char *argv[], test_args_t *args) while (1) { opt = getopt_long(argc, argv, "+c:h", longopts, &long_index); - if (opt == -1) break; /* No more options */ @@ -192,7 +176,6 @@ static void parse_args(int argc, char *argv[], test_args_t *args) } } - /** * Test main function */ @@ -229,15 +212,12 @@ int main(int argc, char *argv[]) printf("CPU freq (hz): %"PRIu64"\n", odp_sys_cpu_hz()); printf("Cache line size: %i\n", odp_sys_cache_line_size()); printf("Max core count: %i\n", odp_sys_core_count()); - printf("\n"); /* A worker thread per core */ num_workers = odp_sys_core_count(); - if (args.core_count) num_workers = args.core_count; - /* force to max core count */ if (num_workers > MAX_WORKERS) num_workers = MAX_WORKERS; @@ -249,7 +229,6 @@ int main(int argc, char *argv[]) * Start mapping thread from core #1 */ first_core = 1; - if (odp_sys_core_count() == 1) first_core = 0; @@ -271,7 +250,6 @@ int main(int argc, char *argv[]) pool = odp_buffer_pool_create("msg_pool", pool_base, MSG_POOL_SIZE, sizeof(test_message_t), ODP_CACHE_LINE_SIZE, ODP_BUFFER_TYPE_RAW); - if (pool == ODP_BUFFER_POOL_INVALID) { ODP_ERR("Pool create failed.\n"); return -1; @@ -286,7 +264,6 @@ int main(int argc, char *argv[]) param.sched.group = ODP_SCHED_GROUP_DEFAULT; queue = odp_queue_create("timer_queue", ODP_QUEUE_TYPE_SCHED, ¶m); - if (queue == ODP_QUEUE_INVALID) { ODP_ERR("Timer queue create failed.\n"); return -1; @@ -294,8 +271,6 @@ int main(int argc, char *argv[]) test_timer = odp_timer_create("test_timer", pool, 1000000, 1000000, 1000000000000); - - odp_shm_print_all(); printf("CPU freq %"PRIu64" hz\n", odp_sys_cpu_hz()); @@ -329,6 +304,5 @@ int main(int argc, char *argv[]) odp_linux_pthread_join(thread_tbl, num_workers); printf("ODP timer test complete\n\n"); - return 0; }