From patchwork Fri Jan 30 11:39:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 44036 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A057A2410D for ; Fri, 30 Jan 2015 11:40:09 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id u10sf558858lbd.3 for ; Fri, 30 Jan 2015 03:40:05 -0800 (PST) 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:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=6sijlul6vMHlq6tpI6S4n/2amsAivtbWPzyM6lk/gSE=; b=DQSKcjasom1cuLfRPA5cKZFpjvmwRdWsy/rJWOlveS6hLlHowkFgiw2ImDM+5i9MWH U2uSKLtoBjsbTtREhO0hH4bkdLCTDfwV/khwNFMDYgSwR03gCfc5I6x9NJLtAxmqcK6m 5et3ZSfCLqDPbcUHHx3BEIYNwZKYVG9crbWMlyZtAQVHHXrK/z9XFABt4crMWWS/LXkA +rZVrnj3o7yMI8esf/xDsyraB8FZatXMHlfYLKAOO1dzubdvlMhoPbeF+n6V/osPghHm hfq37HdvYzyO8Awc9QxVnHewjli+lKLfe5SK6LkeGzl9jEmQByyNQWJKQ/It7qdN9E3v QWlw== X-Gm-Message-State: ALoCoQmAfGLWTYv2UX7fpImO5Hy3kmde2p1vSbhGtyJ4RKe6OQprmcoz+DeSQTipkQDls2BBjlm9 X-Received: by 10.112.89.36 with SMTP id bl4mr751581lbb.1.1422618005292; Fri, 30 Jan 2015 03:40:05 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.69 with SMTP id i5ls416892lah.23.gmail; Fri, 30 Jan 2015 03:40:05 -0800 (PST) X-Received: by 10.152.9.170 with SMTP id a10mr5944048lab.1.1422618005150; Fri, 30 Jan 2015 03:40:05 -0800 (PST) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id x6si9874208lax.124.2015.01.30.03.40.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 30 Jan 2015 03:40:05 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id gd6so23114286lab.4 for ; Fri, 30 Jan 2015 03:40:05 -0800 (PST) X-Received: by 10.152.203.230 with SMTP id kt6mr5902039lac.38.1422618005019; Fri, 30 Jan 2015 03:40:05 -0800 (PST) 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.112.35.133 with SMTP id h5csp253325lbj; Fri, 30 Jan 2015 03:40:04 -0800 (PST) X-Received: by 10.224.40.136 with SMTP id k8mr11282373qae.28.1422618002040; Fri, 30 Jan 2015 03:40:02 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id j7si13849138qaf.48.2015.01.30.03.40.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 30 Jan 2015 03:40:02 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YH9vb-0002QW-2J; Fri, 30 Jan 2015 11:39:59 +0000 Received: from mail-qg0-f51.google.com ([209.85.192.51]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YH9vU-0002Q1-75 for lng-odp@lists.linaro.org; Fri, 30 Jan 2015 11:39:52 +0000 Received: by mail-qg0-f51.google.com with SMTP id z107so37590689qgd.10 for ; Fri, 30 Jan 2015 03:39:47 -0800 (PST) X-Received: by 10.224.161.14 with SMTP id p14mr11120831qax.77.1422617986989; Fri, 30 Jan 2015 03:39:46 -0800 (PST) Received: from mcpro03.emea.nsn-net.net (ec2-23-23-178-99.compute-1.amazonaws.com. [23.23.178.99]) by mx.google.com with ESMTPSA id y17sm9778758qaq.14.2015.01.30.03.39.44 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 30 Jan 2015 03:39:45 -0800 (PST) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Fri, 30 Jan 2015 13:39:24 +0200 Message-Id: <1422617966-27160-2-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.2.2 In-Reply-To: <1422617966-27160-1-git-send-email-petri.savolainen@linaro.org> References: <1422617966-27160-1-git-send-email-petri.savolainen@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 2/4] api: cpu: Renamed odp_thread_cpu to odp_cpu 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: petri.savolainen@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) 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 This return system cpu number. Signed-off-by: Petri Savolainen --- example/timer/odp_timer_test.c | 2 +- include/odp/api/thread.h | 8 -------- platform/linux-generic/odp_thread.c | 3 ++- test/performance/odp_scheduling.c | 2 +- test/validation/odp_synchronizers.c | 12 ++++++------ 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 0df041f..35ea2a1 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -192,7 +192,7 @@ static void *run_thread(void *ptr) args = ptr; thr = odp_thread_id(); - printf("Thread %i starts on cpu %i\n", thr, odp_thread_cpu()); + printf("Thread %i starts on cpu %i\n", thr, odp_cpu()); /* * Find the pool diff --git a/include/odp/api/thread.h b/include/odp/api/thread.h index 469d298..97d5de7 100644 --- a/include/odp/api/thread.h +++ b/include/odp/api/thread.h @@ -29,14 +29,6 @@ extern "C" { */ int odp_thread_id(void); - -/** - * Get CPU number - * - * @return CPU ID where the thread is currently running - */ -int odp_thread_cpu(void); - /** * @} */ diff --git a/platform/linux-generic/odp_thread.c b/platform/linux-generic/odp_thread.c index e66b8c1..9169191 100644 --- a/platform/linux-generic/odp_thread.c +++ b/platform/linux-generic/odp_thread.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -118,7 +119,7 @@ int odp_thread_id(void) } -int odp_thread_cpu(void) +int odp_cpu(void) { return this_thread->cpu; } diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c index 3d7167f..2f32d96 100644 --- a/test/performance/odp_scheduling.c +++ b/test/performance/odp_scheduling.c @@ -606,7 +606,7 @@ static void *run_thread(void *arg) thr = odp_thread_id(); - printf("Thread %i starts on CPU %i\n", thr, odp_thread_cpu()); + printf("Thread %i starts on CPU %i\n", thr, odp_cpu()); shm = odp_shm_lookup("test_globals"); globals = odp_shm_addr(shm); diff --git a/test/validation/odp_synchronizers.c b/test/validation/odp_synchronizers.c index 3361835..f48141a 100644 --- a/test/validation/odp_synchronizers.c +++ b/test/validation/odp_synchronizers.c @@ -119,7 +119,7 @@ static per_thread_mem_t *thread_init(void) per_thread_mem->delay_counter = 1; per_thread_mem->thread_id = odp_thread_id(); - per_thread_mem->thread_core = odp_thread_cpu(); + per_thread_mem->thread_core = odp_cpu(); global_shm = odp_shm_lookup(GLOBAL_SHM_NAME); global_mem = odp_shm_addr(global_shm); @@ -165,7 +165,7 @@ static uint32_t barrier_test(per_thread_mem_t *per_thread_mem, uint32_t thread_num, slow_thread_num, next_slow_thread, num_threads; uint32_t lock_owner_delay, barrier_cnt1, barrier_cnt2; - thread_num = odp_thread_cpu() + 1; + thread_num = odp_cpu() + 1; global_mem = per_thread_mem->global_mem; num_threads = global_mem->g_num_threads; iterations = BARRIER_ITERATIONS; @@ -389,7 +389,7 @@ static void *no_lock_functional_test(void *arg UNUSED) uint32_t thread_num, resync_cnt, rs_idx, iterations, cnt; uint32_t sync_failures, current_errs, lock_owner_delay; - thread_num = odp_thread_cpu() + 1; + thread_num = odp_cpu() + 1; per_thread_mem = thread_init(); global_mem = per_thread_mem->global_mem; iterations = global_mem->g_iterations; @@ -460,7 +460,7 @@ static void *spinlock_functional_test(void *arg UNUSED) uint32_t sync_failures, is_locked_errs, current_errs; uint32_t lock_owner_delay; - thread_num = odp_thread_cpu() + 1; + thread_num = odp_cpu() + 1; per_thread_mem = thread_init(); global_mem = per_thread_mem->global_mem; iterations = global_mem->g_iterations; @@ -543,7 +543,7 @@ static void *ticketlock_functional_test(void *arg UNUSED) uint32_t sync_failures, is_locked_errs, current_errs; uint32_t lock_owner_delay; - thread_num = odp_thread_cpu() + 1; + thread_num = odp_cpu() + 1; per_thread_mem = thread_init(); global_mem = per_thread_mem->global_mem; iterations = global_mem->g_iterations; @@ -627,7 +627,7 @@ static void *rwlock_functional_test(void *arg UNUSED) uint32_t thread_num, resync_cnt, rs_idx, iterations, cnt; uint32_t sync_failures, current_errs, lock_owner_delay; - thread_num = odp_thread_cpu() + 1; + thread_num = odp_cpu() + 1; per_thread_mem = thread_init(); global_mem = per_thread_mem->global_mem; iterations = global_mem->g_iterations;