From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ryan Harper Subject: Re: Is there an equivalent to logical_proc_id[] ? Date: Mon, 20 Jun 2005 14:28:03 -0500 Message-ID: <20050620192803.GD867@us.ibm.com> References: <6C21311CEE34E049B74CC0EF339464B924B3E3@cacexc12.americas.cpqcorp.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <6C21311CEE34E049B74CC0EF339464B924B3E3@cacexc12.americas.cpqcorp.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Santos, Jose Renato G" Cc: "Turner, Yoshio" , Aravind Menon , xen-devel@lists.xensource.com, G John Janakiraman List-Id: xen-devel@lists.xenproject.org * Santos, Jose Renato G [2005-06-20 14:10]: > > Hi, > > I am trying to port xenoprof to the latest version of xen-unstable > and noticed the variable "logical_proc_id[]" that used to be defined > in setup.c is gone. I spent sometime trying to find an equivalent > variable/function without success. > > Does anyone know a simple way of determining the logical CPU id in > a given physical CPU (i.e an id in the range [0,smp_num_siblings-1])? > > Thanks in advance for any help > > Renato > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel I used the cpuid_apic id which I found in arch/i386/kernel/cpu/common.c in the detech_ht() routine. unsigned int logical_proc_id; u32 eax, ebx, ecx, edx; cpuid(1, &eax, &ebx, &ecx, &edx); logical_proc_id = (ebx >> 24 & 0xff) & 1; That worked for me when I was trying to get xenoprof to build/work against unstable tree. -- Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx (512) 838-9253 T/L: 678-9253 ryanh@us.ibm.com