From: "Richard Rauch" <rrauch@itrgmbh.de>
To: "'lesc'" <lesc@zhaw.ch>,
"'eCos Discussion'" <ecos-discuss@sourceware.org>
Subject: AW: [ECOS] Problem with CPU Load Measurements and gcc-arm-eabi optimization.
Date: Mon, 17 Nov 2014 17:47:00 -0000 [thread overview]
Message-ID: <019901d0028e$9bacd070$d3067150$@itrgmbh.de> (raw)
In-Reply-To: <5469F2E1.6010001@zhaw.ch>
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üngliche 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.
>
> 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 <lesc@zhaw.ch>
> 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_THREA
> DS_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
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
next prev parent reply other threads:[~2014-11-17 17:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-17 13:06 lesc
2014-11-17 17:47 ` Richard Rauch [this message]
2014-11-18 9:26 ` AW: " lesc
2014-11-20 18:34 Tomasz Gorochowik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='019901d0028e$9bacd070$d3067150$@itrgmbh.de' \
--to=rrauch@itrgmbh.de \
--cc=ecos-discuss@sourceware.org \
--cc=lesc@zhaw.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).