[LTP] [PATCH] pm_include.sh: Fix no_of_sockets calculation error of is_multi_socket() function.

dreamhj huangjuniter@foxmail.com
Wed Aug 31 04:54:22 CEST 2022


> nit: Commit message could be better: shorter subject (first line)nit: Commit message could be better: shorter subject (first line)
> and more descriptive description after single blank line.
> That would help me avoiding asking question bellow.
> 
> > From: Jun Huang <huangjuniter@foxmail.com>
> 
> nit: there should have been your Signed-off-by:
> 
> Signed-off-by: Jun Huang <huangjuniter@foxmail.com>


Thanks for your suggestion!


> I was going to merge it, but is it really needed? Unsorted input to unique will
> can lead to higher number of count, but because anything higher than 1 results
> in echo 0 and 0 will result in 1 due this code:
>
> [ $no_of_sockets -gt 1 ] ; echo $?
>
> i.e. 2 or more different files will result in count higher than 1 regardless
> using sorted uniq (sort -u) or just uniq. Or am I missing something?


The main purpose of this patch is to change 'cpu?' to 'cpu*', otherwise an error
will occur when the number of cores exceeds 10.
As you said 'sort -u' has the same effect as 'uniq'. I suggest using 'sort -u'
to make the command result more in line with the naming of 'no_of_sockets'.




Thanks,
Jun.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20220831/f3142fdb/attachment.htm>


More information about the ltp mailing list