From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16853 invoked by alias); 14 Aug 2010 00:54:27 -0000 Received: (qmail 16844 invoked by uid 22791); 14 Aug 2010 00:54:26 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from ausc60ps301.us.dell.com (HELO ausc60ps301.us.dell.com) (143.166.148.206) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 14 Aug 2010 00:54:22 +0000 X-Loopcount0: from 10.152.240.141 Subject: Re: Debug threads Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Paul Koning In-Reply-To: <4C65DCDA.1020609@vmware.com> Date: Sat, 14 Aug 2010 00:54:00 -0000 Cc: hce , "gdb@sourceware.org" Content-Transfer-Encoding: 7bit Message-Id: <8B4A093D-2AE6-41EC-8781-44BAF89FE5AC@dell.com> References: <4C65DCDA.1020609@vmware.com> To: Michael Snyder X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-08/txt/msg00089.txt.bz2 Another option (not using gdb) is ps -L, which lists threads. paul On Aug 13, 2010, at 8:01 PM, Michael Snyder wrote: > hce wrote: >> Hi, >> I am debug a problem on CentOS 5, the problem used %100 CPU and there >> are 9 threads running. Which gdb command can I find out which thread >> is current running and hooked %100 CPU? > > If you can attach with gdb, then there is a high probability that > the "current" thread is the one that is eating up all the CPU. > > Do "info threads", and look for the thread that has an asterisk > ("*") in the left hand column. > > If you do "continue" and then control-c and repeat the info threads > command, it is likely that the busy thread will remain as the > "current" thread each time (or the majority of times). > > Otherwise, gdb does not have a formal way of showing you which > thread is the most busy. > > Michael