From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 487 invoked by alias); 4 Jul 2005 11:13:57 -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 398 invoked by uid 22791); 4 Jul 2005 11:13:47 -0000 Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 04 Jul 2005 11:13:47 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1DpOtG-0002DI-00; Mon, 04 Jul 2005 13:13:30 +0200 Date: Mon, 04 Jul 2005 11:13:00 -0000 To: Yuriy Coureelo Cc: ecos-discuss@sources.redhat.com Message-ID: <20050704111330.GA30398@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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <665984288.20050704172147@micran.ru> User-Agent: Mutt/1.5.9i From: Andrew Lunn Subject: Re: [ECOS] Task switching problem X-SW-Source: 2005-07/txt/msg00036.txt.bz2 On Mon, Jul 04, 2005 at 05:21:47PM +0600, Yuriy Coureelo wrote: > Dear Sir! > > AL> You could try enabling the kernel instramentation. > AL> Andrew > > Attached file contains instrumentation info. > I translated every byte from memory dump to textual representation. There is a program to do that. See packages/kernel/current/host/instr > Would take a look there and maybe catch something wrong, please. > Num Thread Time Arg1 Arg2 > > 130 0e 0x2316 SCHED_UNLOCK 0x00000001 0x00000000 > 131 0e 0x2327 SCHED_LOCK 0x00000001 0x00000000 > 132 0e 0x232d SCHED_UNLOCK 0x00000001 0x00000000 > 133 0e 0x2344 ALARM_INIT 0x020f3080 0x00000000 > 134 0e 0x234a ALARM_TRIGGER 0x00000af6 0x00000000 > 135 0e 0x234f ALARM_INTERVAL 0x00000000 0x00000000 > 136 0e 0x2358 SCHED_LOCK 0x00000001 0x00000000 > 137 0e 0x2360 ALARM_ADD 0x020eb158 0x020f3080 > 138 0e 0x237f SCHED_UNLOCK 0x00000001 0x00000000 > 139 0e 0x2396 SCHED_LOCK 0x00000001 0x00000000 > 140 0e 0x239e SCHED_LOCK 0x00000002 0x00000000 > 141 0e 0x23a4 SCHED_UNLOCK 0x00000002 0x00000000 > 142 0e 0x23b0 THREAD_SLEEP 0x020ff280 0x00000000 > 143 0e 0x23b7 SCHED_LOCK 0x00000002 0x00000000 > 144 0e 0x23c2 SCHED_UNLOCK 0x00000002 0x00000000 > 145 0e 0x23cc SCHED_RESCHEDULE 0x00000001 0x00000000 > 146 0e 0x23d4 SCHED_RESCHEDULE 0x00000000 0x00000000 > 147 0e 0x23e5 THREAD_SWITCH 0x020ff280 0x0211dea0 > > 148 06 0x23fc INTR_RESTORE 0x00000012 0x00000000 > 149 06 0x24e9 SCHED_LOCK 0x00000001 0x00000000 > 150 06 0x24ef MUTEX_UNLOCK 0x0211de80 0x00000000 > 151 06 0x24f8 SCHED_UNLOCK 0x00000001 0x00000000 > 152 06 0x250c SCHED_LOCK 0x00000001 0x00000000 > 153 06 0x2514 SCHED_LOCK 0x00000002 0x00000000 > 154 06 0x251b SCHED_UNLOCK 0x00000002 0x00000000 > 155 06 0x2527 THREAD_SLEEP 0x0211dea0 0x00000000 > 156 06 0x252e SCHED_LOCK 0x00000002 0x00000000 > 157 06 0x2538 SCHED_UNLOCK 0x00000002 0x00000000 > 158 06 0x2543 SCHED_RESCHEDULE 0x00000001 0x00000000 > 159 06 0x254a SCHED_RESCHEDULE 0x00000000 0x00000000 > 160 06 0x2567 THREAD_SWITCH 0x0211dea0 0x0208cea4 It looks like you get into trouble at 152, 153. There is a SCHED_UNLOCK missing. However its hard to tell what is going on here. You could change packages/kernel/current/include/sched.inl CYG_INSTRUMENT_SCHED(LOCK,get_sched_lock(),0); to CYG_INSTRUMENT_SCHED(LOCK,get_sched_lock(),__builtin_return_address(0)); and the same with the UNLOCK call. You can then get the address of what called the lock and unlock functions. You might also want to enabled more instrumentation calls. 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