Skip to contentSkip to conversation

pm_include.sh: Fix calculation error of no_of_sockets

PATCH In review [email protected] 2 participants 2 messages Sep 1, 2022 – Sep 13, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pm_include.sh: Fix calculation error of no_of_sockets

From: Jun Huang <[email protected]>

An error will occur when there are multiple sockets and each socket has more than 10 cores, resulting in the value of no_of_sockets being 1.

---
 testcases/kernel/power_management/pm_include.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
testcases/kernel/power_management/pm_include.sh +2 -2
index 35ff0f1e6..f3e160445 100755
@@ -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 $?
 }
 
Signature · 5 lines
2.37.2.windows.2


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

Hi Jun,

thanks for git commit description.

Merged!

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp