From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6561 invoked by alias); 17 Nov 2014 17:47:59 -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 6541 invoked by uid 89); 17 Nov 2014 17:47:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: relay01.alfahosting-server.de Received: from relay01.alfahosting-server.de (HELO relay01.alfahosting-server.de) (109.237.142.236) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 17 Nov 2014 17:47:56 +0000 Received: by relay01.alfahosting-server.de (Postfix, from userid 1001) id 69FA732C03AA; Mon, 17 Nov 2014 18:47:52 +0100 (CET) X-Spam-DCC: : Received: from alfa3017.alfahosting-server.de (alfa3017.alfahosting-server.de [109.237.140.28]) by relay01.alfahosting-server.de (Postfix) with ESMTPS id 4224632C0329; Mon, 17 Nov 2014 18:47:50 +0100 (CET) Received: from itrrrauch (p578a450a.dip0.t-ipconnect.de [87.138.69.10]) by alfa3017.alfahosting-server.de (Postfix) with ESMTPA id 98BE62935A55; Mon, 17 Nov 2014 18:47:49 +0100 (CET) From: "Richard Rauch" To: "'lesc'" , "'eCos Discussion'" References: <5469F2E1.6010001@zhaw.ch> In-Reply-To: <5469F2E1.6010001@zhaw.ch> Date: Mon, 17 Nov 2014 17:47:00 -0000 Message-ID: <019901d0028e$9bacd070$d3067150$@itrgmbh.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Virus-Checker-Version: clamassassin 1.2.4 with ClamAV 0.97.3/19641/Mon Nov 17 17:00:21 2014 X-IsSubscribed: yes Subject: AW: [ECOS] Problem with CPU Load Measurements and gcc-arm-eabi optimization. X-SW-Source: 2014-11/txt/msg00001.txt.bz2 Hello, are you sure, that you are using current version of eCos? This issue should be already solved. Current version has "volatile" keyword= as you proposed! Richard Rauch www.itrgmbh.com > -----Urspr=C3=BCngliche Nachricht----- > Von: ecos-discuss-owner@ecos.sourceware.org [mailto:ecos-discuss- > owner@ecos.sourceware.org] Im Auftrag von lesc > Gesendet: Montag, 17. November 2014 14:07 > An: eCos Discussion > Betreff: [ECOS] Problem with CPU Load Measurements and gcc-arm-eabi > optimization. >=20 > Hello Everyone >=20 > 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. >=20 > 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 variabl= es > are now always synced to the ram and no kept in a CPU register. >=20 > Do you see any Problem with my approach? >=20 > Regards Serafin >=20 > Patch: >=20 > 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 >=20 > --- > packages/kernel/current/src/common/thread.cxx | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > 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 >=20 > // Loop counter for debugging/housekeeping > -cyg_uint32 idle_thread_loops[CYGNUM_KERNEL_CPU_MAX]; > +volatile cyg_uint32 idle_thread_loops[CYGNUM_KERNEL_CPU_MAX]; >=20 > static char > idle_thread_stack[CYGNUM_KERNEL_CPU_MAX][CYGNUM_KERNEL_THREA > DS_IDLE_STACK_SIZE]; >=20 > -- > 1.9.1 >=20 >=20 > -- > Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos > and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss