From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28882 invoked by alias); 14 Aug 2010 00:01:37 -0000 Received: (qmail 28871 invoked by uid 22791); 14 Aug 2010 00:01:37 -0000 X-SWARE-Spam-Status: No, hits=-3.2 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 14 Aug 2010 00:01:32 +0000 Received: from mailhost3.vmware.com (mailhost3.vmware.com [10.16.27.45]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 5F2CD17007; Fri, 13 Aug 2010 17:01:31 -0700 (PDT) Received: from msnyder-server.eng.vmware.com (promd-2s-dhcp138.eng.vmware.com [10.20.124.138]) by mailhost3.vmware.com (Postfix) with ESMTP id 56A5DCD918; Fri, 13 Aug 2010 17:01:31 -0700 (PDT) Message-ID: <4C65DCDA.1020609@vmware.com> Date: Sat, 14 Aug 2010 00:01:00 -0000 From: Michael Snyder User-Agent: Thunderbird 2.0.0.22 (X11/20090609) MIME-Version: 1.0 To: hce CC: "gdb@sourceware.org" Subject: Re: Debug threads References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00088.txt.bz2 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