From mboxrd@z Thu Jan 1 00:00:00 1970 From: Akio Takebe Subject: Re: [PATCH] Add CPU topology info (thread/core/socket) in xenpm Date: Fri, 13 Mar 2009 19:46:19 +0900 Message-ID: <49BA397B.80305@jp.fujitsu.com> References: <4D05DB80B95B23498C72C700BD6C2E0B085EA034@pdsmsx502.ccr.corp.intel.com> <49BA2B72.6090600@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <49BA2B72.6090600@jp.fujitsu.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Yu, Ke" Cc: "Liu, Jinsong" , "Tian, Kevin" , "xen-devel@lists.xensource.com" , Keir Fraser , "Wei, Gang" List-Id: xen-devel@lists.xenproject.org Hi, Akio Takebe wrote: > Hi, Yu > > Good patch! We wanted this feature. > >> Add CPU topology info (thread/core/socket) in xenpm > Can this patch show thread? > >> +#define MAX_NR_CPU 512 >> + >> +void cpu_topology_func(int argc, char *argv[]) >> +{ >> + uint32_t cpu_to_core[MAX_NR_CPU]; >> + uint32_t cpu_to_socket[MAX_NR_CPU]; >> + struct xc_get_cputopo info; >> + int i, ret; >> + >> + info.cpu_to_core = cpu_to_core; >> + info.cpu_to_socket = cpu_to_socket; >> + info.max_cpus = MAX_NR_CPU; >> + ret = xc_get_cputopo(xc_fd, &info); >> + if (!ret) >> + { >> + printf("CPU\tcore\tsocket\n"); >> + for (i=0; i> + { >> + if ( info.cpu_to_core[i] != INVALID_TOPOLOGY_ID && >> + info.cpu_to_socket[i] != INVALID_TOPOLOGY_ID ) >> + { >> + printf("CPU%d\t %d\t %d\n", i, info.cpu_to_core[i], >> + info.cpu_to_socket[i]); >> + } >> + } >> + } >> + else >> + { >> + printf("Can not get Xen CPU topology!\n"); >> + } >> + >> + return ; >> +} > The function looks like only show core/socket. > Is the CPU%d means thread? Best Regards, Akio Takebe