On 06/15/2012 09:12 AM, Chris Evich wrote:
> On 06/14/2012 09:52 AM, Eduardo Bacchi Kienetz wrote:
>> On 06/13/2012 10:55 PM, guyanhua wrote:
>>> Signed-off-by: Gu Yanhua<guyanhua-f...@cn.fujitsu.com>
>
>>> +        # Check CPU frequency
>>> +        cpu_frequency_nodeinfo = _check_nodeinfo(nodeinfo_output, 
>>> 'CPU frequency', 3)
>>> +        cmd = ("cat /proc/cpuinfo | grep 'cpu MHz' | head -n1 | "
>>
>> grep 'cpu MHz' /proc/cpuinfo
>> Just like you do below for 'physical id'? That way you avoid the cat :)
>>
>> You could even make it:
>> grep -m 1 'cpu MHz' /proc/cpuinfo
>> and also avoid the extra "head -n1", although -m could not be available
>> on older distro versions? How far back to we care about? I guess virsh
>> wouldn't be used on systems old enough not to have -m on grep...
>>
>>> +               "awk '{print $4}' | awk -F. '{print $1}'")
>>
>> I wonder if cut wouldn't be less of a burden:
>> cut -d" " -f3 | cut -d. -f1
>>
>
>>> +        # Check CPU socket(s)
>>> +        cpu_sockets_nodeinfo = int(_check_nodeinfo(nodeinfo_output, 
>>> 'CPU socket(s)', 3))
>>> +        cmd = "grep 'physical id' /proc/cpuinfo | uniq | sort | 
>>> uniq |wc -l"
>>
>> grep 'physical id' /proc/cpuinfo | sort | uniq | wc -l
>> ?
>>
>
>>> +        # Check Core(s) per socket
>>> +        cores_per_socket_nodeinfo = 
>>> _check_nodeinfo(nodeinfo_output, 'Core(s) per socket', 4)
>>> +        cmd = "grep 'cpu cores' /proc/cpuinfo | head -n1 | awk 
>>> '{print $4}'"
>>
>> grep -m 1 'cpu cores' /proc/cpuinfo | cut -d" " -f3
>> ?
>
>>
>> Regards,
>>
>> -- 
>> Eduardo Bacchi Kienetz
>> Staff Software Engineer
>> IBM Linux Technology Center
>
> Oh, one more thing.  I'm of the mind we should accept 'good enough' 
> code, then expect minor fixes and refinement to follow.  i.e. it 
> works, doesn't cause problems with other code, meets content 
> standards, and is commented/documented then it's 'good enough'.  Do 
> you see the items above as important to fix before inclusion?  I 
> thought I'd ask before assuming :)  Thanks again for your input!
>

I'm glad to learn that you have such mind, and completely agree!
I would have submitted a patch if the author had no time and/or agreed 
with the changes :)

Have a nice weekend,

-- 
Eduardo Bacchi Kienetz
Staff Software Engineer
IBM Linux Technology Center

_______________________________________________
Autotest mailing list
Autotest@test.kernel.org
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to