All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] pm_include.sh: Fix calculation error of no_of_sockets
@ 2022-09-01  9:03 huangjuniter
  2022-09-13  6:33 ` Petr Vorel
  0 siblings, 1 reply; 2+ messages in thread
From: huangjuniter @ 2022-09-01  9:03 UTC (permalink / raw)
  To: ltp; +Cc: Jun Huang

From: Jun Huang <huangjuniter@foxmail.com>

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.

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 $?
 }
 
-- 
2.37.2.windows.2


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [LTP] [PATCH] pm_include.sh: Fix calculation error of no_of_sockets
  2022-09-01  9:03 [LTP] [PATCH] pm_include.sh: Fix calculation error of no_of_sockets huangjuniter
@ 2022-09-13  6:33 ` Petr Vorel
  0 siblings, 0 replies; 2+ messages in thread
From: Petr Vorel @ 2022-09-13  6:33 UTC (permalink / raw)
  To: huangjuniter; +Cc: ltp

Hi Jun,

thanks for git commit description.

Merged!

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-13  6:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-01  9:03 [LTP] [PATCH] pm_include.sh: Fix calculation error of no_of_sockets huangjuniter
2022-09-13  6:33 ` Petr Vorel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.