[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] Add CPU topology info (thread/core/socket) in xenpm



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<info.nr_cpus; 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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.