From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26232 invoked by alias); 17 Nov 2014 13:06:52 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 26219 invoked by uid 89); 17 Nov 2014 13:06:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx3.zhaw.ch Received: from srv-mail-013.zhaw.ch (HELO mx3.zhaw.ch) (160.85.104.123) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 17 Nov 2014 13:06:49 +0000 Received: from mx3.zhaw.ch (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 5DD481A7 for ; Mon, 17 Nov 2014 14:06:47 +0100 (CET) Received: from [10.0.12.16] (clt-lab-t-6006.zhaw.ch [160.85.232.249]) by mx3.zhaw.ch (Postfix) with ESMTP id 3B8821A4 for ; Mon, 17 Nov 2014 14:06:47 +0100 (CET) Message-ID: <5469F2E1.6010001@zhaw.ch> Date: Mon, 17 Nov 2014 13:06:00 -0000 From: lesc User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: eCos Discussion Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' FROM_NAME_ONE_WORD 0.05, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1400_1499 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, __ANY_URI 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_FROM 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MOZILLA_MSGID 0, __MOZILLA_USER_AGENT 0, __SANE_MSGID 0, __STOCK_PHRASE_7 0, __TO_MALFORMED_2 0, __URI_NO_PATH 0, __URI_NO_WWW 0, __URI_NS , __USER_AGENT 0' X-IsSubscribed: yes Subject: [ECOS] Problem with CPU Load Measurements and gcc-arm-eabi optimization. X-SW-Source: 2014-11/txt/msg00000.txt.bz2 Hello Everyone I just encountered the Problem that the cyg_cpuload_create always delivers 100% on my System. After a bit of debugging I figured out, that the whole for-loop in idle_thread_main seems to be omitted. I could fix this Problem with declaring idle_thread_loops[CYGNUM_KERNEL_CPU_MAX] as volatile (patch below). But this has maybe some consequences I am not thinking of, as the variables are now always synced to the ram and no kept in a CPU register. Do you see any Problem with my approach? Regards Serafin Patch: From 2799f68a5e508c6bece6ec85b1e201282983b98d Mon Sep 17 00:00:00 2001 From: Serafin Leschke Date: Mon, 17 Nov 2014 13:51:23 +0100 Subject: [PATCH] declare idle_thread_loops as volatile --- packages/kernel/current/src/common/thread.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kernel/current/src/common/thread.cxx b/packages/kernel/current/src/common/thread.cxx index 86a3dc4..bd1aa99 100644 --- a/packages/kernel/current/src/common/thread.cxx +++ b/packages/kernel/current/src/common/thread.cxx @@ -1211,7 +1211,7 @@ Cyg_ThreadTimer::alarm( #endif // CYGNUM_HAL_STACK_SIZE_MINIMUM // Loop counter for debugging/housekeeping -cyg_uint32 idle_thread_loops[CYGNUM_KERNEL_CPU_MAX]; +volatile cyg_uint32 idle_thread_loops[CYGNUM_KERNEL_CPU_MAX]; static char idle_thread_stack[CYGNUM_KERNEL_CPU_MAX][CYGNUM_KERNEL_THREADS_IDLE_STACK_SIZE]; -- 1.9.1 -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss