[LTP] [PATCH] pm_include.sh: Fix no_of_sockets calculation error of is_multi_socket() function.
Petr Vorel
pvorel@suse.cz
Mon Aug 29 21:49:12 CEST 2022
Hi Jun,
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>
> ---
> testcases/kernel/power_management/pm_include.sh | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> diff --git a/testcases/kernel/power_management/pm_include.sh b/testcases/kernel/power_management/pm_include.sh
> index 35ff0f1e6..f3e160445 100755
> --- a/testcases/kernel/power_management/pm_include.sh
> +++ b/testcases/kernel/power_management/pm_include.sh
> @@ -124,8 +124,8 @@ check_input() {
> is_multi_socket() {
> no_of_sockets=`cat \
> - /sys/devices/system/cpu/cpu?/topology/physical_package_id \
> - | uniq | wc -l`
> + /sys/devices/system/cpu/cpu*/topology/physical_package_id \
> + | sort -u | wc -l`
> [ $no_of_sockets -gt 1 ] ; echo $?
> }
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?
Kind regards,
Petr
More information about the ltp
mailing list