From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11174 invoked by alias); 5 Jul 2005 07:24:39 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 11132 invoked by uid 22791); 5 Jul 2005 07:24:31 -0000 Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 05 Jul 2005 07:24:31 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1Dphmd-0002pC-00; Tue, 05 Jul 2005 09:23:55 +0200 Date: Tue, 05 Jul 2005 07:24:00 -0000 To: Yuriy Coureelo Cc: ecos-discuss@sources.redhat.com Message-ID: <20050705072355.GB30398@lunn.ch> Mail-Followup-To: Yuriy Coureelo , ecos-discuss@sources.redhat.com References: <526561229.20050701155934@micran.ru> <20050701105246.GJ5563@lunn.ch> <665984288.20050704172147@micran.ru> <20050704111330.GA30398@lunn.ch> <1626342822.20050705105105@micran.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1626342822.20050705105105@micran.ru> User-Agent: Mutt/1.5.9i From: Andrew Lunn Subject: Re: [ECOS] Task switching problem X-SW-Source: 2005-07/txt/msg00042.txt.bz2 On Tue, Jul 05, 2005 at 10:51:05AM +0600, Yuriy Coureelo wrote: > 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: Do you have assertions enabled? That might also give a clue as to what is happening. CYGPKG_INFRA_DEBUG is what you need. > > 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 What is happening at 152? Is your code locking the schedular before calling the flag_wait function? Andrew -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss