From patchwork Thu Feb 5 09:57:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 44414 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f197.google.com (mail-we0-f197.google.com [74.125.82.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A080C21521 for ; Thu, 5 Feb 2015 09:58:21 +0000 (UTC) Received: by mail-we0-f197.google.com with SMTP id l61sf4586216wev.0 for ; Thu, 05 Feb 2015 01:58:20 -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=LTzel1a9PL1uyaYkNNFWcZd/yq4sjOAffJCKhxjLt5E=; b=QYp4FAxGDjNIG5tXM4mc3YlwBOjJgcayTC2nx+AvkGb4OncBAHMuxqJF8lYhNhYzQq Exyju3ByOSIx7UGHEphvh8km7hzjHGJB8LWb52bb8Gl48YdQyDXLbrRXNNr2QShbu0pO YlL4Sq5+HAtmvjvOBwjA5HmQt04JAzcsUIolrxZp/DvSnSwUYMddySEO0yfi9ChD78XZ QheJRpyberzMgQ/1u3kTpB23Zvl+AHlpNYE/YEJp6bm5j18x3gEnnHUtkpDLut74uK9y DPz+m19j0Mv78OU57Omq1riekZo/uB1fMBQh5DIZC63Cd3OKyY95MFUiBEQjWxFhBllL 7/Ig== X-Gm-Message-State: ALoCoQkCIszyIl1iizGgBk0UBPj7mu9xXR0wwEHck4U6DsoQOeEn+IOzEdlr18NZo+h+J7mvo476 X-Received: by 10.112.175.10 with SMTP id bw10mr350983lbc.7.1423130300797; Thu, 05 Feb 2015 01:58:20 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.116.67 with SMTP id ju3ls113620lab.105.gmail; Thu, 05 Feb 2015 01:58:20 -0800 (PST) X-Received: by 10.112.98.202 with SMTP id ek10mr2536204lbb.30.1423130300473; Thu, 05 Feb 2015 01:58:20 -0800 (PST) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id uk4si3523050lbb.68.2015.02.05.01.58.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Feb 2015 01:58:20 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by mail-la0-f54.google.com with SMTP id s18so5174059lam.13 for ; Thu, 05 Feb 2015 01:58:20 -0800 (PST) X-Received: by 10.112.173.202 with SMTP id bm10mr2519436lbc.24.1423130300373; Thu, 05 Feb 2015 01:58:20 -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 h5csp1034755lbj; Thu, 5 Feb 2015 01:58:19 -0800 (PST) X-Received: by 10.140.104.234 with SMTP id a97mr6110569qgf.80.1423130298922; Thu, 05 Feb 2015 01:58:18 -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 r5si5530434qad.68.2015.02.05.01.57.48 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 05 Feb 2015 01:58:18 -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 1YJJBy-0008Os-FY; Thu, 05 Feb 2015 09:57:46 +0000 Received: from mail-qa0-f45.google.com ([209.85.216.45]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YJJBr-0008ON-8S for lng-odp@lists.linaro.org; Thu, 05 Feb 2015 09:57:39 +0000 Received: by mail-qa0-f45.google.com with SMTP id n8so5112746qaq.4 for ; Thu, 05 Feb 2015 01:57:34 -0800 (PST) X-Received: by 10.140.94.6 with SMTP id f6mr6170067qge.38.1423130254108; Thu, 05 Feb 2015 01:57:34 -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 r8sm2494306qad.43.2015.02.05.01.57.32 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Feb 2015 01:57:33 -0800 (PST) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Thu, 5 Feb 2015 11:57:12 +0200 Message-Id: <1423130234-6305-2-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.2.2 In-Reply-To: <1423130234-6305-1-git-send-email-petri.savolainen@linaro.org> References: <1423130234-6305-1-git-send-email-petri.savolainen@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v3 2/4] api: cpu: Renamed odp_thread_cpu to odp_cpu_id 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.54 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 returns system specific cpu id. 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..8274a44 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_id()); /* * Find the pool diff --git a/include/odp/api/thread.h b/include/odp/api/thread.h index d6016cb..844f45a 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 number 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..ac8c9de 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_id(void) { return this_thread->cpu; } diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c index 98c060e..820ac12 100644 --- a/test/performance/odp_scheduling.c +++ b/test/performance/odp_scheduling.c @@ -610,7 +610,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_id()); 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..8786c69 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_id(); 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_id() + 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_id() + 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_id() + 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_id() + 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_id() + 1; per_thread_mem = thread_init(); global_mem = per_thread_mem->global_mem; iterations = global_mem->g_iterations;