From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32264 invoked by alias); 29 Jul 2010 02:21:08 -0000 Received: (qmail 32247 invoked by uid 22791); 29 Jul 2010 02:21:06 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KAM_STOCKGEN X-Spam-Check-By: sourceware.org Received: from mail-wy0-f169.google.com (HELO mail-wy0-f169.google.com) (74.125.82.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Jul 2010 02:21:01 +0000 Received: by wyg36 with SMTP id 36so26763wyg.0 for ; Wed, 28 Jul 2010 19:20:59 -0700 (PDT) Received: by 10.216.164.141 with SMTP id c13mr11413752wel.83.1280370059426; Wed, 28 Jul 2010 19:20:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.186.205 with HTTP; Wed, 28 Jul 2010 19:20:39 -0700 (PDT) In-Reply-To: References: From: Hui Zhu Date: Thu, 29 Jul 2010 02:21:00 -0000 Message-ID: Subject: Re: Command for number of cores To: Marc Khouzam Cc: "gdb@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 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-07/txt/msg00115.txt.bz2 On Thu, Jul 29, 2010 at 03:02, Marc Khouzam wrote: >> -----Original Message----- >> From: Hui Zhu [mailto:teawater@gmail.com] >> Sent: Tuesday, July 27, 2010 10:05 PM >> To: Marc Khouzam >> Cc: gdb@sourceware.org >> Subject: Re: Command for number of cores >> >> p sysconf(_SC_NPROCESSORS_CONF) > > How do I get GDB to know about the symbol _SC_NPROCESSORS_CONF? > > And when I call sysconf() does it execute on the host or the target? This command will let inferior call function sysconf(_SC_NPROCESSORS_CONF). _SC_NPROCESSORS_CONF is a enum. In my pc, it's 83. You can run a small program that have "printf ("%d", _SC_NPROCESSORS_CONF);" to get it's value in your target. I try "p sysconf(83)" in my part. It works OK. Thanks, Hui > > Thanks > > >> On Wed, Jul 28, 2010 at 03:55, Marc Khouzam >> wrote: >> > Hi, >> > >> > I need a way to know how many cores are on my target (where >> gdbserver is running). >> > I'm wondering if GDB already has this information? >> > >> > If not, I was thinking of adding 'info cores' or 'show cores'. >> > Or maybe a convenience variable '$numcores'? >> > >> > I'm thinking 'info cores'. >> > >> > If this makes sense, I'll give it a try. >> > >> > Thanks >> > >> > Marc >> > >>