public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Yuriy Coureelo <coureelo@micran.ru>
To: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] Task switching problem
Date: Tue, 05 Jul 2005 03:51:00 -0000	[thread overview]
Message-ID: <1626342822.20050705105105@micran.ru> (raw)
In-Reply-To: <20050704111330.GA30398@lunn.ch>

Dear Sir!

AL> It looks like you get into trouble at 152, 153. There is a
AL> SCHED_UNLOCK missing.
Let's take a look at the group of lines 152-160
The same situation is at lines 139-147, 66-74, 35-43, but there
everything is ok.

AL> You might also want to enabled more instrumentation calls.
all the instrumentations are enabled

AL> However its hard to tell what is going on here. You could change 
AL> packages/kernel/current/include/sched.inl
AL> CYG_INSTRUMENT_SCHED(LOCK,get_sched_lock(),0);
AL> to
AL> CYG_INSTRUMENT_SCHED(LOCK,get_sched_lock(),__builtin_return_address(0));
AL> and the same with the UNLOCK call. You can then get the address of
AL> what called the lock and unlock functions.
ok, done, got this:

Num Thread Time                    Arg1       Arg2
149 06     0x1d90 SCHED_LOCK       0x00000001 0x020053d4   radiorx_data()
150 06     0x1d96 MUTEX_UNLOCK     0x0211dfc0 0x00000000   radio_mutex
151 06     0x1d9f SCHED_UNLOCK     0x00000001 0x020053d4   radiorx_data()
152 06     0x1db4 SCHED_LOCK       0x00000001 0x020054c4   radioErx_proc()
153 06     0x1dbc SCHED_LOCK       0x00000002 0x0201adbc   _flagwait
154 06     0x1dc3 SCHED_UNLOCK     0x00000002 0x0201adbc   _flagwait
155 06     0x1dcf THREAD_SLEEP     0x0211dfe0 0x00000000   radioErx_thread
156 06     0x1dd6 SCHED_LOCK       0x00000002 0x0201ae3c   _flagwait
157 06     0x1de0 SCHED_UNLOCK     0x00000002 0x0201ae3c   _flagwait
158 06     0x1dea SCHED_RESCHEDULE 0x00000001 0x00000000
159 06     0x1df2 SCHED_RESCHEDULE 0x00000000 0x00000000
160 06     0x1e0f THREAD_SWITCH    0x0211dfe0 0x0208cfe4   radioErx_thread => idle_thread

161 01     0x1e27 INTR_RESTORE     0x00000000 0x00000000
162 01     0x1d72 INTR_MASK        0x00000000 0x00000000
163 01     0x1d7b INT_ACK          0x00000000 0x00000000
164 01     0x1d8a INTR_END         0x00000000 0x00000003
165 01     0x1d91 INTR_POST_DSR    0x00000000 0x00000000
166 01     0x1d99 SCHED_UNLOCK     0x00000002 0x02000538   return_from_exception
167 01     0x1da1 INTR_RESTORE     0x00000000 0x00000000

here all stops, no more messages, processor hangs (?)

Function radiorx_data() works with mutex, unlocks it (...149-151).
Then radiorx_data() returns to radioErx_proc() thread function.
radioErx_proc() begins waiting on flag (152-157), so it's correct
number of SCHED_LOCKs.

Can't understand anything :(((

Sincerely yours
Yuriy Coureelo
------------------------
Engineer
Telecommunication Equipment Division
Micran Company
Tomsk, Russia


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

  reply	other threads:[~2005-07-05  3:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-01  8:59 Yuriy Coureelo
2005-07-01 10:53 ` Andrew Lunn
2005-07-04 10:22   ` Re[2]: " Yuriy Coureelo
2005-07-04 11:13     ` Andrew Lunn
2005-07-05  3:51       ` Yuriy Coureelo [this message]
2005-07-05  7:24         ` Andrew Lunn
2005-07-07  5:33           ` Yuriy Coureelo

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=1626342822.20050705105105@micran.ru \
    --to=coureelo@micran.ru \
    --cc=ecos-discuss@sources.redhat.com \
    /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).